From 5310efa7e5c5298a0be15f6193e4e6c4578de88b Mon Sep 17 00:00:00 2001 From: Christopher Bartz Date: Mon, 16 Nov 2026 14:48:39 +0000 Subject: [PATCH 1/2] build(deps): bump garm-provider-common for ppc64le, s390x and riscv64 garm-provider-common v0.1.9 GetTools rejects any architecture other than amd64, arm and arm64, so the provider fails to create s390x or ppc64le instances even when GARM passes it matching runner tools. main drops that check; it is not tagged yet, hence the pseudo-version. --- go.mod | 10 +- go.sum | 20 +- .../cloudconfig/cloudconfig.go | 10 +- .../garm-provider-common/cloudconfig/util.go | 8 +- .../garm-provider-common/errors/errors.go | 129 +- .../garm-provider-common/params/github.go | 9 + .../garm-provider-common/params/params.go | 80 +- .../garm-provider-common/util/util.go | 35 +- .../felixge/httpsnoop/capture_metrics.go | 37 +- .../felixge/httpsnoop/wrap_generated.go | 16179 ++++++++++++++++ .../httpsnoop/wrap_generated_gteq_1.8.go | 436 - .../httpsnoop/wrap_generated_lt_1.8.go | 278 - .../mattn/go-isatty/isatty_windows.go | 9 +- vendor/github.com/minio/sio/sio.go | 63 +- vendor/go.yaml.in/yaml/v4/.gitignore | 5 +- vendor/go.yaml.in/yaml/v4/.typos.toml | 3 + vendor/go.yaml.in/yaml/v4/doc.go | 10 +- .../yaml/v4/internal/libyaml/README.md | 54 +- .../yaml/v4/internal/libyaml/api.go | 733 - .../yaml/v4/internal/libyaml/composer.go | 330 +- .../yaml/v4/internal/libyaml/constructor.go | 1473 +- .../yaml/v4/internal/libyaml/desolver.go | 152 + .../yaml/v4/{ => internal/libyaml}/dumper.go | 93 +- .../yaml/v4/internal/libyaml/emitter.go | 890 +- .../yaml/v4/internal/libyaml/errors.go | 196 +- .../yaml/v4/{ => internal/libyaml}/loader.go | 236 +- .../yaml/v4/internal/libyaml/node.go | 158 +- .../yaml/v4/internal/libyaml/options.go | 67 +- .../yaml/v4/internal/libyaml/parser.go | 785 +- .../yaml/v4/internal/libyaml/reader.go | 209 +- .../yaml/v4/internal/libyaml/representer.go | 779 +- .../yaml/v4/internal/libyaml/resolver.go | 221 +- .../yaml/v4/internal/libyaml/scanner.go | 3302 ++-- .../yaml/v4/internal/libyaml/serializer.go | 321 +- .../yaml/v4/internal/libyaml/structmeta.go | 250 + .../yaml/v4/internal/libyaml/yaml.go | 490 +- .../internal/libyaml/yamldatatest_loader.go | 192 - .../yaml/v4/internal/libyaml/yamlprivate.go | 249 - vendor/go.yaml.in/yaml/v4/node.go | 98 + vendor/go.yaml.in/yaml/v4/plugin.go | 25 + .../go.yaml.in/yaml/v4/plugin/limit/plugin.go | 191 + vendor/go.yaml.in/yaml/v4/yaml.go | 743 +- vendor/modules.txt | 13 +- 43 files changed, 23040 insertions(+), 6531 deletions(-) create mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated.go delete mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go delete mode 100644 vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go delete mode 100644 vendor/go.yaml.in/yaml/v4/internal/libyaml/api.go create mode 100644 vendor/go.yaml.in/yaml/v4/internal/libyaml/desolver.go rename vendor/go.yaml.in/yaml/v4/{ => internal/libyaml}/dumper.go (61%) rename vendor/go.yaml.in/yaml/v4/{ => internal/libyaml}/loader.go (55%) create mode 100644 vendor/go.yaml.in/yaml/v4/internal/libyaml/structmeta.go delete mode 100644 vendor/go.yaml.in/yaml/v4/internal/libyaml/yamldatatest_loader.go delete mode 100644 vendor/go.yaml.in/yaml/v4/internal/libyaml/yamlprivate.go create mode 100644 vendor/go.yaml.in/yaml/v4/node.go create mode 100644 vendor/go.yaml.in/yaml/v4/plugin.go create mode 100644 vendor/go.yaml.in/yaml/v4/plugin/limit/plugin.go diff --git a/go.mod b/go.mod index c7088eb..c44ecd1 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.25.0 require ( github.com/BurntSushi/toml v1.6.0 - github.com/cloudbase/garm-provider-common v0.1.9 + github.com/cloudbase/garm-provider-common v0.1.10-0.20261111212522-a63fbe8afd51 github.com/google/uuid v1.6.0 github.com/gophercloud/gophercloud/v2 v2.15.0 github.com/gophercloud/utils/v2 v2.0.0-20260626221802-4ae35253ac13 @@ -20,14 +20,14 @@ require ( github.com/pb33f/ordered-map/v2 v2.3.1 // indirect github.com/stretchr/objx v0.5.3 // indirect go.yaml.in/yaml/v3 v3.0.5 // indirect - go.yaml.in/yaml/v4 v4.0.0-rc.4 // indirect + go.yaml.in/yaml/v4 v4.0.0-rc.6 // indirect ) require ( - github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/felixge/httpsnoop v1.1.0 // indirect github.com/gorilla/handlers v1.5.2 // indirect - github.com/mattn/go-isatty v0.0.21 // indirect - github.com/minio/sio v0.4.3 // indirect + github.com/mattn/go-isatty v0.0.22 // indirect + github.com/minio/sio v0.5.1 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/teris-io/shortid v0.0.0-20220617161101-71ec9f2aa569 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect diff --git a/go.sum b/go.sum index a304ad0..bd37f69 100644 --- a/go.sum +++ b/go.sum @@ -4,11 +4,11 @@ github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPn github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= github.com/buger/jsonparser v1.1.2 h1:frqHqw7otoVbk5M8LlE/L7HTnIq2v9RX6EJ48i9AxJk= github.com/buger/jsonparser v1.1.2/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= -github.com/cloudbase/garm-provider-common v0.1.9 h1:ZL53ma/j7BgMAqW/OJ/jCnx1MUd8hLcYxUTEFb/o/e0= -github.com/cloudbase/garm-provider-common v0.1.9/go.mod h1:8tnJcLXtaMUDEUgX3MGLFEYnMpiCAKaKWPtzNnzEpAE= +github.com/cloudbase/garm-provider-common v0.1.10-0.20261111212522-a63fbe8afd51 h1:WMeG7MyUnjwpM2qBAo5NmyE3NSzTCqRTv8dmOFUEYdM= +github.com/cloudbase/garm-provider-common v0.1.10-0.20261111212522-a63fbe8afd51/go.mod h1:9UvQ/bHlwgSAeLFV94by9M7kRg3d0H3kemkjcFzJMmc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= -github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= +github.com/felixge/httpsnoop v1.1.0 h1:3YtUj32ZZkqZtt3sZZsClsymw/QDuVfpNhoA31zeORc= +github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0= github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -21,10 +21,10 @@ github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyE github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/invopop/jsonschema v0.14.0 h1:MHQqLhvpNUZfw+hM3AZDYK7jxO8FZoQeQM77g8iyZjg= github.com/invopop/jsonschema v0.14.0/go.mod h1:ygm6C2EaVNMBDPpaPlnOA2pFAxBnxGjFlMZABxm9n2I= -github.com/mattn/go-isatty v0.0.21 h1:xYae+lCNBP7QuW4PUnNG61ffM4hVIfm+zUzDuSzYLGs= -github.com/mattn/go-isatty v0.0.21/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= -github.com/minio/sio v0.4.3 h1:JqyID1XM86KwBZox5RAdLD4MLPIDoCY2cke2CXCJCkg= -github.com/minio/sio v0.4.3/go.mod h1:4ANoe4CCXqnt1FCiLM0+vlBUhhWZzVOhYCz0069KtFc= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= +github.com/minio/sio v0.5.1 h1:sqtImrnCSHbDqO/lVy3tfbsctHzfelDv3NbXWEVcWT8= +github.com/minio/sio v0.5.1/go.mod h1:4ANoe4CCXqnt1FCiLM0+vlBUhhWZzVOhYCz0069KtFc= github.com/pb33f/ordered-map/v2 v2.3.1 h1:5319HDO0aw4DA4gzi+zv4FXU9UlSs3xGZ40wcP1nBjY= github.com/pb33f/ordered-map/v2 v2.3.1/go.mod h1:qxFQgd0PkVUtOMCkTapqotNgzRhMPL7VvaHKbd1HnmQ= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -47,8 +47,8 @@ github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17 github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= -go.yaml.in/yaml/v4 v4.0.0-rc.4 h1:UP4+v6fFrBIb1l934bDl//mmnoIZEDK0idg1+AIvX5U= -go.yaml.in/yaml/v4 v4.0.0-rc.4/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= +go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4= +go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.55.0 h1:+KWHjbgOaAQ66dh/YlkZKHlz9ZUlq61AFirAR9ntP8M= golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= diff --git a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/cloudconfig.go b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/cloudconfig.go index a49fe42..eb73bc4 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/cloudconfig.go +++ b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/cloudconfig.go @@ -23,8 +23,8 @@ import ( "github.com/cloudbase/garm-provider-common/defaults" + "go.yaml.in/yaml/v4" "github.com/pkg/errors" - "gopkg.in/yaml.v3" ) func NewDefaultCloudInitConfig() *CloudInit { @@ -78,6 +78,7 @@ type CloudInit struct { RunCmd []string `yaml:"runcmd,omitempty"` WriteFiles []File `yaml:"write_files,omitempty"` CACerts CACerts `yaml:"ca-certs,omitempty"` + BootCmd []string `yaml:"bootcmd,omitempty"` } type CACerts struct { @@ -142,10 +143,15 @@ func (c *CloudInit) AddPackage(pkgs ...string) { func (c *CloudInit) AddRunCmd(cmd string) { c.mux.Lock() defer c.mux.Unlock() - c.RunCmd = append(c.RunCmd, cmd) } +func (c *CloudInit) AddBootCmd(cmd string) { + c.mux.Lock() + defer c.mux.Unlock() + c.BootCmd = append(c.BootCmd, cmd) +} + func (c *CloudInit) AddFile(contents []byte, path, owner, permissions string) { c.mux.Lock() defer c.mux.Unlock() diff --git a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go index 2a8f4a3..bf4021e 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go +++ b/vendor/github.com/cloudbase/garm-provider-common/cloudconfig/util.go @@ -117,7 +117,7 @@ func GetRunnerInstallScript(bootstrapParams params.BootstrapInstance, tools para UseJITConfig: bootstrapParams.JitConfigEnabled, } - if bootstrapParams.CACertBundle != nil && len(bootstrapParams.CACertBundle) > 0 { + if len(bootstrapParams.CACertBundle) > 0 { installRunnerParams.CABundle = string(bootstrapParams.CACertBundle) } @@ -162,12 +162,16 @@ func GetCloudInitConfig(bootstrapParams params.BootstrapInstance, installScript cloudCfg.AddFile(installScript, "/install_runner.sh", "root:root", "755") cloudCfg.AddRunCmd(fmt.Sprintf("su -l -c /install_runner.sh %s", defaults.DefaultUser)) cloudCfg.AddRunCmd("rm -f /install_runner.sh") - if bootstrapParams.CACertBundle != nil && len(bootstrapParams.CACertBundle) > 0 { + if len(bootstrapParams.CACertBundle) > 0 { if err := cloudCfg.AddCACert(bootstrapParams.CACertBundle); err != nil { return "", errors.Wrap(err, "adding CA cert bundle") } } + if proxyCfg, ok := bootstrapParams.ProxyConfig.GetBootCmd(); ok { + cloudCfg.AddBootCmd(proxyCfg) + } + asStr, err := cloudCfg.Serialize() if err != nil { return "", errors.Wrap(err, "creating cloud config") diff --git a/vendor/github.com/cloudbase/garm-provider-common/errors/errors.go b/vendor/github.com/cloudbase/garm-provider-common/errors/errors.go index 76e85d9..179073e 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/errors/errors.go +++ b/vendor/github.com/cloudbase/garm-provider-common/errors/errors.go @@ -14,12 +14,19 @@ package errors -import "fmt" +import ( + "fmt" + + "github.com/cloudbase/garm-provider-common/params" +) var ( // ErrUnauthorized is returned when a user does not have // authorization to perform a request ErrUnauthorized = NewUnauthorizedError("Unauthorized") + // ErrForbidden is returned when a user does not have + // permission to perform a request + ErrForbidden = NewForbiddenError("Forbidden") // ErrNotFound is returned if an object is not found in // the database. ErrNotFound = NewNotFoundError("not found") @@ -32,6 +39,7 @@ var ( ErrTimeout = NewTimeoutError("timed out") ErrUnprocessable = NewUnprocessableError("cannot process request") ErrNoPoolsAvailable = NewNoPoolsAvailableError("no pools available") + ErrNoCapacity = NewNoCapacityError("no capacity available") ) type baseError struct { @@ -43,7 +51,7 @@ func (b *baseError) Error() string { } // NewProviderError returns a new ProviderError -func NewProviderError(msg string, a ...interface{}) error { +func NewProviderError(msg string, a ...any) error { return &ProviderError{ baseError{ msg: fmt.Sprintf(msg, a...), @@ -66,7 +74,7 @@ func (p *ProviderError) Is(target error) bool { } // NewMissingSecretError returns a new MissingSecretError -func NewMissingSecretError(msg string, a ...interface{}) error { +func NewMissingSecretError(msg string, a ...any) error { return &MissingSecretError{ baseError{ msg: fmt.Sprintf(msg, a...), @@ -89,10 +97,10 @@ func (p *MissingSecretError) Is(target error) bool { } // NewUnauthorizedError returns a new UnauthorizedError -func NewUnauthorizedError(msg string) error { +func NewUnauthorizedError(msg string, a ...any) error { return &UnauthorizedError{ baseError{ - msg: msg, + msg: fmt.Sprintf(msg, a...), }, } } @@ -111,8 +119,31 @@ func (p *UnauthorizedError) Is(target error) bool { return ok } +// NewForbiddenError returns a new ForbiddenError +func NewForbiddenError(msg string, a ...any) error { + return &ForbiddenError{ + baseError{ + msg: fmt.Sprintf(msg, a...), + }, + } +} + +// ForbiddenError is returned when a request is not allowed +type ForbiddenError struct { + baseError +} + +func (p *ForbiddenError) Is(target error) bool { + if target == nil { + return false + } + + _, ok := target.(*ForbiddenError) + return ok +} + // NewNotFoundError returns a new NotFoundError -func NewNotFoundError(msg string, a ...interface{}) error { +func NewNotFoundError(msg string, a ...any) error { return &NotFoundError{ baseError{ msg: fmt.Sprintf(msg, a...), @@ -135,10 +166,10 @@ func (p *NotFoundError) Is(target error) bool { } // NewDuplicateUserError returns a new DuplicateUserError -func NewDuplicateUserError(msg string) error { +func NewDuplicateUserError(msg string, a ...any) error { return &DuplicateUserError{ baseError{ - msg: msg, + msg: fmt.Sprintf(msg, a...), }, } } @@ -158,7 +189,7 @@ func (p *DuplicateUserError) Is(target error) bool { } // NewBadRequestError returns a new BadRequestError -func NewBadRequestError(msg string, a ...interface{}) error { +func NewBadRequestError(msg string, a ...any) error { return &BadRequestError{ baseError{ msg: fmt.Sprintf(msg, a...), @@ -181,7 +212,7 @@ func (p *BadRequestError) Is(target error) bool { } // NewConflictError returns a new ConflictError -func NewConflictError(msg string, a ...interface{}) error { +func NewConflictError(msg string, a ...any) error { return &ConflictError{ baseError{ msg: fmt.Sprintf(msg, a...), @@ -204,7 +235,7 @@ func (p *ConflictError) Is(target error) bool { } // NewTimeoutError returns a new TimoutError -func NewTimeoutError(msg string, a ...interface{}) error { +func NewTimeoutError(msg string, a ...any) error { return &TimoutError{ baseError{ msg: fmt.Sprintf(msg, a...), @@ -227,15 +258,15 @@ func (p *TimoutError) Is(target error) bool { } // NewUnprocessableError returns a new UnprocessableError -func NewUnprocessableError(msg string, a ...interface{}) error { - return &TimoutError{ +func NewUnprocessableError(msg string, a ...any) error { + return &UnprocessableError{ baseError{ msg: fmt.Sprintf(msg, a...), }, } } -// TimoutError is returned when an operation times out. +// UnprocessableError is returned when a request cannot be processed. type UnprocessableError struct { baseError } @@ -249,16 +280,16 @@ func (p *UnprocessableError) Is(target error) bool { return ok } -// NewNoPoolsAvailableError returns a new UnprocessableError -func NewNoPoolsAvailableError(msg string, a ...interface{}) error { - return &TimoutError{ +// NewNoPoolsAvailableError returns a new NoPoolsAvailableError +func NewNoPoolsAvailableError(msg string, a ...any) error { + return &NoPoolsAvailableError{ baseError{ msg: fmt.Sprintf(msg, a...), }, } } -// NoPoolsAvailableError is returned when anthere are not pools available. +// NoPoolsAvailableError is returned when there are no pools available. type NoPoolsAvailableError struct { baseError } @@ -271,3 +302,65 @@ func (p *NoPoolsAvailableError) Is(target error) bool { _, ok := target.(*NoPoolsAvailableError) return ok } + +// NewNoCapacityError returns a new NoCapacityError +func NewNoCapacityError(msg string, a ...any) error { + return &NoCapacityError{ + baseError{ + msg: fmt.Sprintf(msg, a...), + }, + } +} + +// NoCapacityError is returned when there is no capacity available. +type NoCapacityError struct { + baseError +} + +func (p *NoCapacityError) Is(target error) bool { + if target == nil { + return false + } + + _, ok := target.(*NoCapacityError) + return ok +} + +// NewInstanceTransitionError returns an InstanceTransitionError describing an +// invalid instance status state machine transition. +func NewInstanceTransitionError(from, to params.InstanceStatus) error { + return &InstanceTransitionError{ + baseError: baseError{ + msg: fmt.Sprintf("invalid instance status transition from %s to %s", from, to), + }, + From: from, + To: to, + } +} + +// InstanceTransitionError is returned when a requested instance status +// transition is rejected by the state machine. It carries the current (From) +// and requested (To) statuses as their proper type, so callers working with a +// params.Instance can compare them directly (via errors.As) without casting +// through strings, and decide whether the refusal is benign for their intent +// (for example, the instance is already further along the same terminal path) +// or a genuine error to stop on. It also reports as a BadRequestError, so it +// maps to an HTTP 400. +type InstanceTransitionError struct { + baseError + From params.InstanceStatus + To params.InstanceStatus +} + +func (e *InstanceTransitionError) Is(target error) bool { + if target == nil { + return false + } + + switch target.(type) { + case *InstanceTransitionError, *BadRequestError: + return true + default: + return false + } +} diff --git a/vendor/github.com/cloudbase/garm-provider-common/params/github.go b/vendor/github.com/cloudbase/garm-provider-common/params/github.go index c3e9a0a..bcd66a9 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/params/github.go +++ b/vendor/github.com/cloudbase/garm-provider-common/params/github.go @@ -26,6 +26,15 @@ type RunnerApplicationDownload struct { SHA256Checksum *string `json:"sha256_checksum,omitempty"` } +// Platform returns the "os/arch" pair this download is built for, using the +// names the runner tools list uses (so "linux/x64", not "linux/amd64"). It is +// the natural key for a set of tools: exactly one download serves any given +// platform. An absent OS or architecture yields an empty segment rather than +// an error, matching the other accessors. +func (r *RunnerApplicationDownload) Platform() string { + return r.GetOS() + "/" + r.GetArchitecture() +} + // GetArchitecture returns the Architecture field if it's non-nil, zero value otherwise. func (r *RunnerApplicationDownload) GetArchitecture() string { if r == nil || r.Architecture == nil { diff --git a/vendor/github.com/cloudbase/garm-provider-common/params/params.go b/vendor/github.com/cloudbase/garm-provider-common/params/params.go index 0a63f70..5b0ad58 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/params/params.go +++ b/vendor/github.com/cloudbase/garm-provider-common/params/params.go @@ -15,7 +15,9 @@ package params import ( + "bytes" "encoding/json" + "text/template" ) type ( @@ -28,14 +30,18 @@ type ( const ( Windows OSType = "windows" Linux OSType = "linux" + Darwin OSType = "darwin" Unknown OSType = "unknown" ) const ( - Amd64 OSArch = "amd64" - I386 OSArch = "i386" - Arm64 OSArch = "arm64" - Arm OSArch = "arm" + Amd64 OSArch = "amd64" + I386 OSArch = "i386" + Arm64 OSArch = "arm64" + Arm OSArch = "arm" + Ppc64le OSArch = "ppc64le" + S390x OSArch = "s390x" + Riscv64 OSArch = "riscv64" ) const ( @@ -56,6 +62,62 @@ const ( PrivateAddress AddressType = "private" ) +var bootCmdProxyTemplate = `{{- if .HTTPProxy }} +HTTP_PROXY="{{.HTTPProxy}}" +{{- end}} +{{- if .HTTPSProxy }} +HTTPS_PROXY="{{.HTTPSProxy}}" +{{- end}} +{{- if .NoProxy }} +NO_PROXY="{{.NoProxy}}" +{{- end}} +if [ -d "/etc/apt/apt.conf.d" ]; then + APT_PROXY_CONF="/etc/apt/apt.conf.d/95garm-proxy" + : > "$APT_PROXY_CONF" + [ -n "$HTTP_PROXY" ] && printf 'Acquire::http::Proxy "%s";\n' "$HTTP_PROXY" >> "$APT_PROXY_CONF" + [ -n "$HTTPS_PROXY" ] && printf 'Acquire::https::Proxy "%s";\n' "$HTTPS_PROXY" >> "$APT_PROXY_CONF" +elif [ -f /etc/dnf/dnf.conf ]; then + PROXY="${HTTP_PROXY:-$HTTPS_PROXY}" + [ -n "$PROXY" ] && grep -q '^proxy=' /etc/dnf/dnf.conf || echo "proxy=$PROXY" >> /etc/dnf/dnf.conf +elif [ -f /etc/yum.conf ]; then + PROXY="${HTTP_PROXY:-$HTTPS_PROXY}" + [ -n "$PROXY" ] && grep -q '^proxy=' /etc/yum.conf || echo "proxy=$PROXY" >> /etc/yum.conf +elif [ -d /etc/zypp ]; then + printf 'PROXY_ENABLED="yes"\n' > /etc/sysconfig/proxy + [ -n "$HTTP_PROXY" ] && printf 'HTTP_PROXY="%s"\n' "$HTTP_PROXY" >> /etc/sysconfig/proxy + [ -n "$HTTPS_PROXY" ] && printf 'HTTPS_PROXY="%s"\n' "$HTTPS_PROXY" >> /etc/sysconfig/proxy + [ -n "$NO_PROXY" ] && printf 'NO_PROXY="%s"\n' "$NO_PROXY" >> /etc/sysconfig/proxy +fi +` + +type ProxyConfig struct { + HTTPProxy string `json:"http_proxy"` + HTTPSProxy string `json:"https_proxy"` + NoProxy string `json:"no_proxy"` +} + +func (p ProxyConfig) GetBootCmd() (string, bool) { + if !p.HasProxy() { + return "", false + } + + tmpl, err := template.New("bootcmd-proxy").Parse(bootCmdProxyTemplate) + if err != nil { + return "", false + } + + var buf bytes.Buffer + if err := tmpl.Execute(&buf, p); err != nil { + return "", false + } + + return buf.String(), true +} + +func (p ProxyConfig) HasProxy() bool { + return p.HTTPProxy != "" || p.HTTPSProxy != "" +} + type UserDataOptions struct { DisableUpdatesOnBoot bool `json:"disable_updates_on_boot"` ExtraPackages []string `json:"extra_packages"` @@ -98,7 +160,7 @@ type BootstrapInstance struct { // OSArch is the target OS CPU architecture of the runner. OSArch OSArch `json:"arch"` - // OSType is the target OS platform of the runner (windows, linux). + // OSType is the target OS platform of the runner (windows, linux, darwin). OSType OSType `json:"os_type"` // Flavor is the platform specific abstraction that defines what resources will be allocated @@ -124,6 +186,10 @@ type BootstrapInstance struct { // from the metadata service instead of the runner registration token. The runner registration token // is not available if the runner is configured to use JIT. JitConfigEnabled bool `json:"jit_config_enabled"` + + // ProxyConfig is the proxy configuration that gets added to the cloud-init + // config. + ProxyConfig ProxyConfig `json:"proxy_config"` } type Address struct { @@ -143,8 +209,8 @@ type ProviderInstance struct { // instance. Name string `json:"name,omitempty"` - // OSType is the operating system type. For now, only Linux and - // Windows are supported. + // OSType is the operating system type. Supported values are Linux, + // Windows and Darwin. OSType OSType `json:"os_type,omitempty"` // OSName is the name of the OS. Eg: ubuntu, centos, etc. diff --git a/vendor/github.com/cloudbase/garm-provider-common/util/util.go b/vendor/github.com/cloudbase/garm-provider-common/util/util.go index 2dd879e..1dd1882 100644 --- a/vendor/github.com/cloudbase/garm-provider-common/util/util.go +++ b/vendor/github.com/cloudbase/garm-provider-common/util/util.go @@ -70,14 +70,25 @@ var ( "windows": params.Windows, } + // githubArchMapping maps the CPU architecture names reported by providers + // and operating systems to the names used in the runner tools download + // list. Upstream GitHub only publishes x64 and arm64 (and arm for older + // releases), but third parties publish patched runners for the other + // architectures. Those are picked up through an endpoint tools metadata + // URL. githubArchMapping map[string]string = map[string]string{ - "x86_64": "x64", - "amd64": "x64", - "armv7l": "arm", - "aarch64": "arm64", - "x64": "x64", - "arm": "arm", - "arm64": "arm64", + "x86_64": "x64", + "amd64": "x64", + "armv7l": "arm", + "aarch64": "arm64", + "x64": "x64", + "arm": "arm", + "arm64": "arm64", + "ppc64le": "ppc64le", + "ppc64el": "ppc64le", + "powerpc64le": "ppc64le", + "s390x": "s390x", + "riscv64": "riscv64", } githubOSTypeMap map[string]string = map[string]string{ @@ -195,14 +206,8 @@ func GetTools(osType params.OSType, osArch params.OSArch, tools []params.RunnerA return params.RunnerApplicationDownload{}, fmt.Errorf("unsupported OS type: %s", osType) } - switch osArch { - case params.Amd64: - case params.Arm: - case params.Arm64: - default: - return params.RunnerApplicationDownload{}, fmt.Errorf("unsupported OS arch: %s", osArch) - } - + // The set of architectures we support is the set githubArchMapping knows + // how to translate. ghArch, err := ResolveToGithubArch(string(osArch)) if err != nil { return params.RunnerApplicationDownload{}, fmt.Errorf("failed to convert osArch: %w", err) diff --git a/vendor/github.com/felixge/httpsnoop/capture_metrics.go b/vendor/github.com/felixge/httpsnoop/capture_metrics.go index bec7b71..97f0a51 100644 --- a/vendor/github.com/felixge/httpsnoop/capture_metrics.go +++ b/vendor/github.com/felixge/httpsnoop/capture_metrics.go @@ -69,6 +69,16 @@ func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWri } }, + WriteString: func(next WriteStringFunc) WriteStringFunc { + return func(s string) (int, error) { + n, err := next(s) + + m.Written += int64(n) + headerWritten = true + return n, err + } + }, + ReadFrom: func(next ReadFromFunc) ReadFromFunc { return func(src io.Reader) (int64, error) { n, err := next(src) @@ -81,6 +91,31 @@ func (m *Metrics) CaptureMetrics(w http.ResponseWriter, fn func(http.ResponseWri } ) + // defer to ensure duration is updated even if the handler panics + defer func() { + m.Duration += time.Since(start) + }() fn(Wrap(w, hooks)) - m.Duration += time.Since(start) +} + +// deadliner defines two methods introduced in go 1.20. The standard library +// seems not to provide an interface we can import, hence its definition here. +type deadliner interface { + SetReadDeadline(deadline time.Time) error + SetWriteDeadline(deadline time.Time) error +} + +// fullDuplexEnabler defines a method introduced in go 1.21. The standard +// library seems not to provide an interface we can import, hence its definition +// here. +type fullDuplexEnabler interface { + EnableFullDuplex() error +} + +// httpFlushError defines a method introduced in go 1.20. The standard +// library seems not to provide an interface we can import, hence its definition +// here. +// See https://github.com/golang/go/blob/go1.20/src/net/http/responsecontroller.go#L50 +type httpFlushError interface { + FlushError() error } diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated.go b/vendor/github.com/felixge/httpsnoop/wrap_generated.go new file mode 100644 index 0000000..b6549ba --- /dev/null +++ b/vendor/github.com/felixge/httpsnoop/wrap_generated.go @@ -0,0 +1,16179 @@ +// Code generated by "httpsnoop/codegen"; DO NOT EDIT. + +package httpsnoop + +import ( + "bufio" + "io" + "net" + "net/http" + "time" +) + +// HeaderFunc is part of the http.ResponseWriter interface. +type HeaderFunc func() http.Header + +// WriteHeaderFunc is part of the http.ResponseWriter interface. +type WriteHeaderFunc func(code int) + +// WriteFunc is part of the http.ResponseWriter interface. +type WriteFunc func(b []byte) (int, error) + +// FlushFunc is part of the http.Flusher interface. +type FlushFunc func() + +// FlushErrorFunc is part of the httpFlushError interface. +type FlushErrorFunc func() error + +// CloseNotifyFunc is part of the http.CloseNotifier interface. +type CloseNotifyFunc func() <-chan bool + +// HijackFunc is part of the http.Hijacker interface. +type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) + +// ReadFromFunc is part of the io.ReaderFrom interface. +type ReadFromFunc func(src io.Reader) (int64, error) + +// SetReadDeadlineFunc is part of the deadliner interface. +type SetReadDeadlineFunc func(deadline time.Time) error + +// SetWriteDeadlineFunc is part of the deadliner interface. +type SetWriteDeadlineFunc func(deadline time.Time) error + +// EnableFullDuplexFunc is part of the fullDuplexEnabler interface. +type EnableFullDuplexFunc func() error + +// PushFunc is part of the http.Pusher interface. +type PushFunc func(target string, opts *http.PushOptions) error + +// WriteStringFunc is part of the io.StringWriter interface. +type WriteStringFunc func(s string) (int, error) + +// Hooks defines a set of method interceptors for methods included in +// http.ResponseWriter as well as some others. You can think of them as +// middleware for the function calls they target. See Wrap for more details. +// +// For each method, the exact matching hook takes precedence. For example, +// WriteString calls the WriteString hook when it is configured, even if a +// Write hook is also configured. If the exact hook is not configured, most +// methods call through to the underlying ResponseWriter directly. +// +// Two compatibility fallbacks preserve the behavior users had before Wrap +// learned about newer optional interfaces: +// - If the underlying ResponseWriter implements io.StringWriter and +// WriteString is called, but only the Write hook is configured, WriteString +// is routed through the Write hook with []byte(s). If neither hook is +// configured, WriteString calls the underlying WriteString method directly. +// - If the underlying ResponseWriter implements both http.Flusher and +// FlushError, and FlushError is called, but only the Flush hook is +// configured, FlushError is routed through the Flush hook while preserving +// the error returned by the underlying FlushError method. If neither hook is +// configured, FlushError calls the underlying FlushError method directly. +type Hooks struct { + Header func(HeaderFunc) HeaderFunc + WriteHeader func(WriteHeaderFunc) WriteHeaderFunc + Write func(WriteFunc) WriteFunc + Flush func(FlushFunc) FlushFunc + FlushError func(FlushErrorFunc) FlushErrorFunc + CloseNotify func(CloseNotifyFunc) CloseNotifyFunc + Hijack func(HijackFunc) HijackFunc + ReadFrom func(ReadFromFunc) ReadFromFunc + SetReadDeadline func(SetReadDeadlineFunc) SetReadDeadlineFunc + SetWriteDeadline func(SetWriteDeadlineFunc) SetWriteDeadlineFunc + EnableFullDuplex func(EnableFullDuplexFunc) EnableFullDuplexFunc + Push func(PushFunc) PushFunc + WriteString func(WriteStringFunc) WriteStringFunc +} + +// Wrap returns a wrapped version of w that provides the exact same interface +// as w. Specifically if w implements any combination of: +// +// - http.Flusher +// - httpFlushError +// - http.CloseNotifier +// - http.Hijacker +// - io.ReaderFrom +// - deadliner +// - fullDuplexEnabler +// - http.Pusher +// - io.StringWriter +// +// The wrapped version will implement the exact same combination. If no hooks +// are set, the wrapped version also behaves exactly as w. Hooks targeting +// methods not supported by w are ignored. Any other hooks will intercept the +// method they target and may modify the call's arguments and/or return values. +// The CaptureMetrics implementation serves as a working example for how the +// hooks can be used. +func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { + state := &rwState{w: w} + var combo uint16 + if hooks.Header != nil { + state.header = hooks.Header(w.Header) + } + if hooks.WriteHeader != nil { + state.writeHeader = hooks.WriteHeader(w.WriteHeader) + } + if hooks.Write != nil { + state.write = hooks.Write(w.Write) + } + if t0, i0 := w.(http.Flusher); i0 { + combo |= 1 << 8 + if hooks.Flush != nil { + state.flush = hooks.Flush(t0.Flush) + } + } + if t1, i1 := w.(httpFlushError); i1 { + combo |= 1 << 7 + if hooks.FlushError != nil { + state.flushError = hooks.FlushError(t1.FlushError) + } else if state.flush != nil { + state.flushError = func() (err error) { hooks.Flush(func() { err = t1.FlushError() })(); return err } + } + } + if t2, i2 := w.(http.CloseNotifier); i2 { + combo |= 1 << 6 + if hooks.CloseNotify != nil { + state.closeNotify = hooks.CloseNotify(t2.CloseNotify) + } + } + if t3, i3 := w.(http.Hijacker); i3 { + combo |= 1 << 5 + if hooks.Hijack != nil { + state.hijack = hooks.Hijack(t3.Hijack) + } + } + if t4, i4 := w.(io.ReaderFrom); i4 { + combo |= 1 << 4 + if hooks.ReadFrom != nil { + state.readFrom = hooks.ReadFrom(t4.ReadFrom) + } + } + if t5, i5 := w.(deadliner); i5 { + combo |= 1 << 3 + if hooks.SetReadDeadline != nil { + state.setReadDeadline = hooks.SetReadDeadline(t5.SetReadDeadline) + } + if hooks.SetWriteDeadline != nil { + state.setWriteDeadline = hooks.SetWriteDeadline(t5.SetWriteDeadline) + } + } + if t6, i6 := w.(fullDuplexEnabler); i6 { + combo |= 1 << 2 + if hooks.EnableFullDuplex != nil { + state.enableFullDuplex = hooks.EnableFullDuplex(t6.EnableFullDuplex) + } + } + if t7, i7 := w.(http.Pusher); i7 { + combo |= 1 << 1 + if hooks.Push != nil { + state.push = hooks.Push(t7.Push) + } + } + if t8, i8 := w.(io.StringWriter); i8 { + combo |= 1 << 0 + if hooks.WriteString != nil { + state.writeString = hooks.WriteString(t8.WriteString) + } else if state.write != nil { + state.writeString = func(s string) (int, error) { return state.write([]byte(s)) } + } + } + switch combo { + case 0: + return (*rw0)(state) + case 1: + return (*rw1)(state) + case 2: + return (*rw2)(state) + case 3: + return (*rw3)(state) + case 4: + return (*rw4)(state) + case 5: + return (*rw5)(state) + case 6: + return (*rw6)(state) + case 7: + return (*rw7)(state) + case 8: + return (*rw8)(state) + case 9: + return (*rw9)(state) + case 10: + return (*rw10)(state) + case 11: + return (*rw11)(state) + case 12: + return (*rw12)(state) + case 13: + return (*rw13)(state) + case 14: + return (*rw14)(state) + case 15: + return (*rw15)(state) + case 16: + return (*rw16)(state) + case 17: + return (*rw17)(state) + case 18: + return (*rw18)(state) + case 19: + return (*rw19)(state) + case 20: + return (*rw20)(state) + case 21: + return (*rw21)(state) + case 22: + return (*rw22)(state) + case 23: + return (*rw23)(state) + case 24: + return (*rw24)(state) + case 25: + return (*rw25)(state) + case 26: + return (*rw26)(state) + case 27: + return (*rw27)(state) + case 28: + return (*rw28)(state) + case 29: + return (*rw29)(state) + case 30: + return (*rw30)(state) + case 31: + return (*rw31)(state) + case 32: + return (*rw32)(state) + case 33: + return (*rw33)(state) + case 34: + return (*rw34)(state) + case 35: + return (*rw35)(state) + case 36: + return (*rw36)(state) + case 37: + return (*rw37)(state) + case 38: + return (*rw38)(state) + case 39: + return (*rw39)(state) + case 40: + return (*rw40)(state) + case 41: + return (*rw41)(state) + case 42: + return (*rw42)(state) + case 43: + return (*rw43)(state) + case 44: + return (*rw44)(state) + case 45: + return (*rw45)(state) + case 46: + return (*rw46)(state) + case 47: + return (*rw47)(state) + case 48: + return (*rw48)(state) + case 49: + return (*rw49)(state) + case 50: + return (*rw50)(state) + case 51: + return (*rw51)(state) + case 52: + return (*rw52)(state) + case 53: + return (*rw53)(state) + case 54: + return (*rw54)(state) + case 55: + return (*rw55)(state) + case 56: + return (*rw56)(state) + case 57: + return (*rw57)(state) + case 58: + return (*rw58)(state) + case 59: + return (*rw59)(state) + case 60: + return (*rw60)(state) + case 61: + return (*rw61)(state) + case 62: + return (*rw62)(state) + case 63: + return (*rw63)(state) + case 64: + return (*rw64)(state) + case 65: + return (*rw65)(state) + case 66: + return (*rw66)(state) + case 67: + return (*rw67)(state) + case 68: + return (*rw68)(state) + case 69: + return (*rw69)(state) + case 70: + return (*rw70)(state) + case 71: + return (*rw71)(state) + case 72: + return (*rw72)(state) + case 73: + return (*rw73)(state) + case 74: + return (*rw74)(state) + case 75: + return (*rw75)(state) + case 76: + return (*rw76)(state) + case 77: + return (*rw77)(state) + case 78: + return (*rw78)(state) + case 79: + return (*rw79)(state) + case 80: + return (*rw80)(state) + case 81: + return (*rw81)(state) + case 82: + return (*rw82)(state) + case 83: + return (*rw83)(state) + case 84: + return (*rw84)(state) + case 85: + return (*rw85)(state) + case 86: + return (*rw86)(state) + case 87: + return (*rw87)(state) + case 88: + return (*rw88)(state) + case 89: + return (*rw89)(state) + case 90: + return (*rw90)(state) + case 91: + return (*rw91)(state) + case 92: + return (*rw92)(state) + case 93: + return (*rw93)(state) + case 94: + return (*rw94)(state) + case 95: + return (*rw95)(state) + case 96: + return (*rw96)(state) + case 97: + return (*rw97)(state) + case 98: + return (*rw98)(state) + case 99: + return (*rw99)(state) + case 100: + return (*rw100)(state) + case 101: + return (*rw101)(state) + case 102: + return (*rw102)(state) + case 103: + return (*rw103)(state) + case 104: + return (*rw104)(state) + case 105: + return (*rw105)(state) + case 106: + return (*rw106)(state) + case 107: + return (*rw107)(state) + case 108: + return (*rw108)(state) + case 109: + return (*rw109)(state) + case 110: + return (*rw110)(state) + case 111: + return (*rw111)(state) + case 112: + return (*rw112)(state) + case 113: + return (*rw113)(state) + case 114: + return (*rw114)(state) + case 115: + return (*rw115)(state) + case 116: + return (*rw116)(state) + case 117: + return (*rw117)(state) + case 118: + return (*rw118)(state) + case 119: + return (*rw119)(state) + case 120: + return (*rw120)(state) + case 121: + return (*rw121)(state) + case 122: + return (*rw122)(state) + case 123: + return (*rw123)(state) + case 124: + return (*rw124)(state) + case 125: + return (*rw125)(state) + case 126: + return (*rw126)(state) + case 127: + return (*rw127)(state) + case 128: + return (*rw128)(state) + case 129: + return (*rw129)(state) + case 130: + return (*rw130)(state) + case 131: + return (*rw131)(state) + case 132: + return (*rw132)(state) + case 133: + return (*rw133)(state) + case 134: + return (*rw134)(state) + case 135: + return (*rw135)(state) + case 136: + return (*rw136)(state) + case 137: + return (*rw137)(state) + case 138: + return (*rw138)(state) + case 139: + return (*rw139)(state) + case 140: + return (*rw140)(state) + case 141: + return (*rw141)(state) + case 142: + return (*rw142)(state) + case 143: + return (*rw143)(state) + case 144: + return (*rw144)(state) + case 145: + return (*rw145)(state) + case 146: + return (*rw146)(state) + case 147: + return (*rw147)(state) + case 148: + return (*rw148)(state) + case 149: + return (*rw149)(state) + case 150: + return (*rw150)(state) + case 151: + return (*rw151)(state) + case 152: + return (*rw152)(state) + case 153: + return (*rw153)(state) + case 154: + return (*rw154)(state) + case 155: + return (*rw155)(state) + case 156: + return (*rw156)(state) + case 157: + return (*rw157)(state) + case 158: + return (*rw158)(state) + case 159: + return (*rw159)(state) + case 160: + return (*rw160)(state) + case 161: + return (*rw161)(state) + case 162: + return (*rw162)(state) + case 163: + return (*rw163)(state) + case 164: + return (*rw164)(state) + case 165: + return (*rw165)(state) + case 166: + return (*rw166)(state) + case 167: + return (*rw167)(state) + case 168: + return (*rw168)(state) + case 169: + return (*rw169)(state) + case 170: + return (*rw170)(state) + case 171: + return (*rw171)(state) + case 172: + return (*rw172)(state) + case 173: + return (*rw173)(state) + case 174: + return (*rw174)(state) + case 175: + return (*rw175)(state) + case 176: + return (*rw176)(state) + case 177: + return (*rw177)(state) + case 178: + return (*rw178)(state) + case 179: + return (*rw179)(state) + case 180: + return (*rw180)(state) + case 181: + return (*rw181)(state) + case 182: + return (*rw182)(state) + case 183: + return (*rw183)(state) + case 184: + return (*rw184)(state) + case 185: + return (*rw185)(state) + case 186: + return (*rw186)(state) + case 187: + return (*rw187)(state) + case 188: + return (*rw188)(state) + case 189: + return (*rw189)(state) + case 190: + return (*rw190)(state) + case 191: + return (*rw191)(state) + case 192: + return (*rw192)(state) + case 193: + return (*rw193)(state) + case 194: + return (*rw194)(state) + case 195: + return (*rw195)(state) + case 196: + return (*rw196)(state) + case 197: + return (*rw197)(state) + case 198: + return (*rw198)(state) + case 199: + return (*rw199)(state) + case 200: + return (*rw200)(state) + case 201: + return (*rw201)(state) + case 202: + return (*rw202)(state) + case 203: + return (*rw203)(state) + case 204: + return (*rw204)(state) + case 205: + return (*rw205)(state) + case 206: + return (*rw206)(state) + case 207: + return (*rw207)(state) + case 208: + return (*rw208)(state) + case 209: + return (*rw209)(state) + case 210: + return (*rw210)(state) + case 211: + return (*rw211)(state) + case 212: + return (*rw212)(state) + case 213: + return (*rw213)(state) + case 214: + return (*rw214)(state) + case 215: + return (*rw215)(state) + case 216: + return (*rw216)(state) + case 217: + return (*rw217)(state) + case 218: + return (*rw218)(state) + case 219: + return (*rw219)(state) + case 220: + return (*rw220)(state) + case 221: + return (*rw221)(state) + case 222: + return (*rw222)(state) + case 223: + return (*rw223)(state) + case 224: + return (*rw224)(state) + case 225: + return (*rw225)(state) + case 226: + return (*rw226)(state) + case 227: + return (*rw227)(state) + case 228: + return (*rw228)(state) + case 229: + return (*rw229)(state) + case 230: + return (*rw230)(state) + case 231: + return (*rw231)(state) + case 232: + return (*rw232)(state) + case 233: + return (*rw233)(state) + case 234: + return (*rw234)(state) + case 235: + return (*rw235)(state) + case 236: + return (*rw236)(state) + case 237: + return (*rw237)(state) + case 238: + return (*rw238)(state) + case 239: + return (*rw239)(state) + case 240: + return (*rw240)(state) + case 241: + return (*rw241)(state) + case 242: + return (*rw242)(state) + case 243: + return (*rw243)(state) + case 244: + return (*rw244)(state) + case 245: + return (*rw245)(state) + case 246: + return (*rw246)(state) + case 247: + return (*rw247)(state) + case 248: + return (*rw248)(state) + case 249: + return (*rw249)(state) + case 250: + return (*rw250)(state) + case 251: + return (*rw251)(state) + case 252: + return (*rw252)(state) + case 253: + return (*rw253)(state) + case 254: + return (*rw254)(state) + case 255: + return (*rw255)(state) + case 256: + return (*rw256)(state) + case 257: + return (*rw257)(state) + case 258: + return (*rw258)(state) + case 259: + return (*rw259)(state) + case 260: + return (*rw260)(state) + case 261: + return (*rw261)(state) + case 262: + return (*rw262)(state) + case 263: + return (*rw263)(state) + case 264: + return (*rw264)(state) + case 265: + return (*rw265)(state) + case 266: + return (*rw266)(state) + case 267: + return (*rw267)(state) + case 268: + return (*rw268)(state) + case 269: + return (*rw269)(state) + case 270: + return (*rw270)(state) + case 271: + return (*rw271)(state) + case 272: + return (*rw272)(state) + case 273: + return (*rw273)(state) + case 274: + return (*rw274)(state) + case 275: + return (*rw275)(state) + case 276: + return (*rw276)(state) + case 277: + return (*rw277)(state) + case 278: + return (*rw278)(state) + case 279: + return (*rw279)(state) + case 280: + return (*rw280)(state) + case 281: + return (*rw281)(state) + case 282: + return (*rw282)(state) + case 283: + return (*rw283)(state) + case 284: + return (*rw284)(state) + case 285: + return (*rw285)(state) + case 286: + return (*rw286)(state) + case 287: + return (*rw287)(state) + case 288: + return (*rw288)(state) + case 289: + return (*rw289)(state) + case 290: + return (*rw290)(state) + case 291: + return (*rw291)(state) + case 292: + return (*rw292)(state) + case 293: + return (*rw293)(state) + case 294: + return (*rw294)(state) + case 295: + return (*rw295)(state) + case 296: + return (*rw296)(state) + case 297: + return (*rw297)(state) + case 298: + return (*rw298)(state) + case 299: + return (*rw299)(state) + case 300: + return (*rw300)(state) + case 301: + return (*rw301)(state) + case 302: + return (*rw302)(state) + case 303: + return (*rw303)(state) + case 304: + return (*rw304)(state) + case 305: + return (*rw305)(state) + case 306: + return (*rw306)(state) + case 307: + return (*rw307)(state) + case 308: + return (*rw308)(state) + case 309: + return (*rw309)(state) + case 310: + return (*rw310)(state) + case 311: + return (*rw311)(state) + case 312: + return (*rw312)(state) + case 313: + return (*rw313)(state) + case 314: + return (*rw314)(state) + case 315: + return (*rw315)(state) + case 316: + return (*rw316)(state) + case 317: + return (*rw317)(state) + case 318: + return (*rw318)(state) + case 319: + return (*rw319)(state) + case 320: + return (*rw320)(state) + case 321: + return (*rw321)(state) + case 322: + return (*rw322)(state) + case 323: + return (*rw323)(state) + case 324: + return (*rw324)(state) + case 325: + return (*rw325)(state) + case 326: + return (*rw326)(state) + case 327: + return (*rw327)(state) + case 328: + return (*rw328)(state) + case 329: + return (*rw329)(state) + case 330: + return (*rw330)(state) + case 331: + return (*rw331)(state) + case 332: + return (*rw332)(state) + case 333: + return (*rw333)(state) + case 334: + return (*rw334)(state) + case 335: + return (*rw335)(state) + case 336: + return (*rw336)(state) + case 337: + return (*rw337)(state) + case 338: + return (*rw338)(state) + case 339: + return (*rw339)(state) + case 340: + return (*rw340)(state) + case 341: + return (*rw341)(state) + case 342: + return (*rw342)(state) + case 343: + return (*rw343)(state) + case 344: + return (*rw344)(state) + case 345: + return (*rw345)(state) + case 346: + return (*rw346)(state) + case 347: + return (*rw347)(state) + case 348: + return (*rw348)(state) + case 349: + return (*rw349)(state) + case 350: + return (*rw350)(state) + case 351: + return (*rw351)(state) + case 352: + return (*rw352)(state) + case 353: + return (*rw353)(state) + case 354: + return (*rw354)(state) + case 355: + return (*rw355)(state) + case 356: + return (*rw356)(state) + case 357: + return (*rw357)(state) + case 358: + return (*rw358)(state) + case 359: + return (*rw359)(state) + case 360: + return (*rw360)(state) + case 361: + return (*rw361)(state) + case 362: + return (*rw362)(state) + case 363: + return (*rw363)(state) + case 364: + return (*rw364)(state) + case 365: + return (*rw365)(state) + case 366: + return (*rw366)(state) + case 367: + return (*rw367)(state) + case 368: + return (*rw368)(state) + case 369: + return (*rw369)(state) + case 370: + return (*rw370)(state) + case 371: + return (*rw371)(state) + case 372: + return (*rw372)(state) + case 373: + return (*rw373)(state) + case 374: + return (*rw374)(state) + case 375: + return (*rw375)(state) + case 376: + return (*rw376)(state) + case 377: + return (*rw377)(state) + case 378: + return (*rw378)(state) + case 379: + return (*rw379)(state) + case 380: + return (*rw380)(state) + case 381: + return (*rw381)(state) + case 382: + return (*rw382)(state) + case 383: + return (*rw383)(state) + case 384: + return (*rw384)(state) + case 385: + return (*rw385)(state) + case 386: + return (*rw386)(state) + case 387: + return (*rw387)(state) + case 388: + return (*rw388)(state) + case 389: + return (*rw389)(state) + case 390: + return (*rw390)(state) + case 391: + return (*rw391)(state) + case 392: + return (*rw392)(state) + case 393: + return (*rw393)(state) + case 394: + return (*rw394)(state) + case 395: + return (*rw395)(state) + case 396: + return (*rw396)(state) + case 397: + return (*rw397)(state) + case 398: + return (*rw398)(state) + case 399: + return (*rw399)(state) + case 400: + return (*rw400)(state) + case 401: + return (*rw401)(state) + case 402: + return (*rw402)(state) + case 403: + return (*rw403)(state) + case 404: + return (*rw404)(state) + case 405: + return (*rw405)(state) + case 406: + return (*rw406)(state) + case 407: + return (*rw407)(state) + case 408: + return (*rw408)(state) + case 409: + return (*rw409)(state) + case 410: + return (*rw410)(state) + case 411: + return (*rw411)(state) + case 412: + return (*rw412)(state) + case 413: + return (*rw413)(state) + case 414: + return (*rw414)(state) + case 415: + return (*rw415)(state) + case 416: + return (*rw416)(state) + case 417: + return (*rw417)(state) + case 418: + return (*rw418)(state) + case 419: + return (*rw419)(state) + case 420: + return (*rw420)(state) + case 421: + return (*rw421)(state) + case 422: + return (*rw422)(state) + case 423: + return (*rw423)(state) + case 424: + return (*rw424)(state) + case 425: + return (*rw425)(state) + case 426: + return (*rw426)(state) + case 427: + return (*rw427)(state) + case 428: + return (*rw428)(state) + case 429: + return (*rw429)(state) + case 430: + return (*rw430)(state) + case 431: + return (*rw431)(state) + case 432: + return (*rw432)(state) + case 433: + return (*rw433)(state) + case 434: + return (*rw434)(state) + case 435: + return (*rw435)(state) + case 436: + return (*rw436)(state) + case 437: + return (*rw437)(state) + case 438: + return (*rw438)(state) + case 439: + return (*rw439)(state) + case 440: + return (*rw440)(state) + case 441: + return (*rw441)(state) + case 442: + return (*rw442)(state) + case 443: + return (*rw443)(state) + case 444: + return (*rw444)(state) + case 445: + return (*rw445)(state) + case 446: + return (*rw446)(state) + case 447: + return (*rw447)(state) + case 448: + return (*rw448)(state) + case 449: + return (*rw449)(state) + case 450: + return (*rw450)(state) + case 451: + return (*rw451)(state) + case 452: + return (*rw452)(state) + case 453: + return (*rw453)(state) + case 454: + return (*rw454)(state) + case 455: + return (*rw455)(state) + case 456: + return (*rw456)(state) + case 457: + return (*rw457)(state) + case 458: + return (*rw458)(state) + case 459: + return (*rw459)(state) + case 460: + return (*rw460)(state) + case 461: + return (*rw461)(state) + case 462: + return (*rw462)(state) + case 463: + return (*rw463)(state) + case 464: + return (*rw464)(state) + case 465: + return (*rw465)(state) + case 466: + return (*rw466)(state) + case 467: + return (*rw467)(state) + case 468: + return (*rw468)(state) + case 469: + return (*rw469)(state) + case 470: + return (*rw470)(state) + case 471: + return (*rw471)(state) + case 472: + return (*rw472)(state) + case 473: + return (*rw473)(state) + case 474: + return (*rw474)(state) + case 475: + return (*rw475)(state) + case 476: + return (*rw476)(state) + case 477: + return (*rw477)(state) + case 478: + return (*rw478)(state) + case 479: + return (*rw479)(state) + case 480: + return (*rw480)(state) + case 481: + return (*rw481)(state) + case 482: + return (*rw482)(state) + case 483: + return (*rw483)(state) + case 484: + return (*rw484)(state) + case 485: + return (*rw485)(state) + case 486: + return (*rw486)(state) + case 487: + return (*rw487)(state) + case 488: + return (*rw488)(state) + case 489: + return (*rw489)(state) + case 490: + return (*rw490)(state) + case 491: + return (*rw491)(state) + case 492: + return (*rw492)(state) + case 493: + return (*rw493)(state) + case 494: + return (*rw494)(state) + case 495: + return (*rw495)(state) + case 496: + return (*rw496)(state) + case 497: + return (*rw497)(state) + case 498: + return (*rw498)(state) + case 499: + return (*rw499)(state) + case 500: + return (*rw500)(state) + case 501: + return (*rw501)(state) + case 502: + return (*rw502)(state) + case 503: + return (*rw503)(state) + case 504: + return (*rw504)(state) + case 505: + return (*rw505)(state) + case 506: + return (*rw506)(state) + case 507: + return (*rw507)(state) + case 508: + return (*rw508)(state) + case 509: + return (*rw509)(state) + case 510: + return (*rw510)(state) + case 511: + return (*rw511)(state) + } + panic("unreachable") +} + +type rwState struct { + w http.ResponseWriter + header HeaderFunc + writeHeader WriteHeaderFunc + write WriteFunc + flush FlushFunc + flushError FlushErrorFunc + closeNotify CloseNotifyFunc + hijack HijackFunc + readFrom ReadFromFunc + setReadDeadline SetReadDeadlineFunc + setWriteDeadline SetWriteDeadlineFunc + enableFullDuplex EnableFullDuplexFunc + push PushFunc + writeString WriteStringFunc +} + +func (r *rwState) doHeader() http.Header { + if r.header != nil { + return r.header() + } + return r.w.Header() +} + +func (r *rwState) doWriteHeader(code int) { + if r.writeHeader != nil { + r.writeHeader(code) + return + } + r.w.WriteHeader(code) +} + +func (r *rwState) doWrite(b []byte) (int, error) { + if r.write != nil { + return r.write(b) + } + return r.w.Write(b) +} + +func (r *rwState) doFlush() { + if r.flush != nil { + r.flush() + return + } + r.w.(http.Flusher).Flush() +} + +func (r *rwState) doFlushError() error { + if r.flushError != nil { + return r.flushError() + } + return r.w.(httpFlushError).FlushError() +} + +func (r *rwState) doCloseNotify() <-chan bool { + if r.closeNotify != nil { + return r.closeNotify() + } + return r.w.(http.CloseNotifier).CloseNotify() +} + +func (r *rwState) doHijack() (net.Conn, *bufio.ReadWriter, error) { + if r.hijack != nil { + return r.hijack() + } + return r.w.(http.Hijacker).Hijack() +} + +func (r *rwState) doReadFrom(src io.Reader) (int64, error) { + if r.readFrom != nil { + return r.readFrom(src) + } + return r.w.(io.ReaderFrom).ReadFrom(src) +} + +func (r *rwState) doSetReadDeadline(deadline time.Time) error { + if r.setReadDeadline != nil { + return r.setReadDeadline(deadline) + } + return r.w.(deadliner).SetReadDeadline(deadline) +} + +func (r *rwState) doSetWriteDeadline(deadline time.Time) error { + if r.setWriteDeadline != nil { + return r.setWriteDeadline(deadline) + } + return r.w.(deadliner).SetWriteDeadline(deadline) +} + +func (r *rwState) doEnableFullDuplex() error { + if r.enableFullDuplex != nil { + return r.enableFullDuplex() + } + return r.w.(fullDuplexEnabler).EnableFullDuplex() +} + +func (r *rwState) doPush(target string, opts *http.PushOptions) error { + if r.push != nil { + return r.push(target, opts) + } + return r.w.(http.Pusher).Push(target, opts) +} + +func (r *rwState) doWriteString(s string) (int, error) { + if r.writeString != nil { + return r.writeString(s) + } + return r.w.(io.StringWriter).WriteString(s) +} + +// combination 1/512: http.ResponseWriter +type rw0 rwState + +func (w *rw0) Unwrap() http.ResponseWriter { return w.w } +func (w *rw0) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw0) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw0) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} + +// combination 2/512: http.ResponseWriter, io.StringWriter +type rw1 rwState + +func (w *rw1) Unwrap() http.ResponseWriter { return w.w } +func (w *rw1) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw1) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw1) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw1) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 3/512: http.ResponseWriter, http.Pusher +type rw2 rwState + +func (w *rw2) Unwrap() http.ResponseWriter { return w.w } +func (w *rw2) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw2) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw2) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw2) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 4/512: http.ResponseWriter, http.Pusher, io.StringWriter +type rw3 rwState + +func (w *rw3) Unwrap() http.ResponseWriter { return w.w } +func (w *rw3) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw3) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw3) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw3) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw3) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 5/512: http.ResponseWriter, fullDuplexEnabler +type rw4 rwState + +func (w *rw4) Unwrap() http.ResponseWriter { return w.w } +func (w *rw4) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw4) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw4) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw4) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 6/512: http.ResponseWriter, fullDuplexEnabler, io.StringWriter +type rw5 rwState + +func (w *rw5) Unwrap() http.ResponseWriter { return w.w } +func (w *rw5) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw5) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw5) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw5) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw5) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 7/512: http.ResponseWriter, fullDuplexEnabler, http.Pusher +type rw6 rwState + +func (w *rw6) Unwrap() http.ResponseWriter { return w.w } +func (w *rw6) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw6) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw6) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw6) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw6) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 8/512: http.ResponseWriter, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw7 rwState + +func (w *rw7) Unwrap() http.ResponseWriter { return w.w } +func (w *rw7) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw7) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw7) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw7) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw7) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw7) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 9/512: http.ResponseWriter, deadliner +type rw8 rwState + +func (w *rw8) Unwrap() http.ResponseWriter { return w.w } +func (w *rw8) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw8) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw8) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw8) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw8) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 10/512: http.ResponseWriter, deadliner, io.StringWriter +type rw9 rwState + +func (w *rw9) Unwrap() http.ResponseWriter { return w.w } +func (w *rw9) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw9) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw9) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw9) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw9) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw9) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 11/512: http.ResponseWriter, deadliner, http.Pusher +type rw10 rwState + +func (w *rw10) Unwrap() http.ResponseWriter { return w.w } +func (w *rw10) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw10) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw10) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw10) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw10) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw10) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 12/512: http.ResponseWriter, deadliner, http.Pusher, io.StringWriter +type rw11 rwState + +func (w *rw11) Unwrap() http.ResponseWriter { return w.w } +func (w *rw11) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw11) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw11) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw11) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw11) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw11) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw11) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 13/512: http.ResponseWriter, deadliner, fullDuplexEnabler +type rw12 rwState + +func (w *rw12) Unwrap() http.ResponseWriter { return w.w } +func (w *rw12) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw12) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw12) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw12) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw12) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw12) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 14/512: http.ResponseWriter, deadliner, fullDuplexEnabler, io.StringWriter +type rw13 rwState + +func (w *rw13) Unwrap() http.ResponseWriter { return w.w } +func (w *rw13) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw13) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw13) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw13) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw13) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw13) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw13) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 15/512: http.ResponseWriter, deadliner, fullDuplexEnabler, http.Pusher +type rw14 rwState + +func (w *rw14) Unwrap() http.ResponseWriter { return w.w } +func (w *rw14) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw14) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw14) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw14) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw14) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw14) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw14) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 16/512: http.ResponseWriter, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw15 rwState + +func (w *rw15) Unwrap() http.ResponseWriter { return w.w } +func (w *rw15) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw15) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw15) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw15) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw15) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw15) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw15) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw15) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 17/512: http.ResponseWriter, io.ReaderFrom +type rw16 rwState + +func (w *rw16) Unwrap() http.ResponseWriter { return w.w } +func (w *rw16) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw16) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw16) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw16) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 18/512: http.ResponseWriter, io.ReaderFrom, io.StringWriter +type rw17 rwState + +func (w *rw17) Unwrap() http.ResponseWriter { return w.w } +func (w *rw17) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw17) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw17) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw17) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw17) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 19/512: http.ResponseWriter, io.ReaderFrom, http.Pusher +type rw18 rwState + +func (w *rw18) Unwrap() http.ResponseWriter { return w.w } +func (w *rw18) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw18) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw18) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw18) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw18) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 20/512: http.ResponseWriter, io.ReaderFrom, http.Pusher, io.StringWriter +type rw19 rwState + +func (w *rw19) Unwrap() http.ResponseWriter { return w.w } +func (w *rw19) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw19) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw19) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw19) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw19) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw19) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 21/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler +type rw20 rwState + +func (w *rw20) Unwrap() http.ResponseWriter { return w.w } +func (w *rw20) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw20) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw20) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw20) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw20) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 22/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw21 rwState + +func (w *rw21) Unwrap() http.ResponseWriter { return w.w } +func (w *rw21) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw21) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw21) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw21) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw21) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw21) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 23/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw22 rwState + +func (w *rw22) Unwrap() http.ResponseWriter { return w.w } +func (w *rw22) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw22) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw22) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw22) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw22) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw22) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 24/512: http.ResponseWriter, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw23 rwState + +func (w *rw23) Unwrap() http.ResponseWriter { return w.w } +func (w *rw23) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw23) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw23) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw23) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw23) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw23) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw23) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 25/512: http.ResponseWriter, io.ReaderFrom, deadliner +type rw24 rwState + +func (w *rw24) Unwrap() http.ResponseWriter { return w.w } +func (w *rw24) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw24) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw24) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw24) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw24) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw24) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 26/512: http.ResponseWriter, io.ReaderFrom, deadliner, io.StringWriter +type rw25 rwState + +func (w *rw25) Unwrap() http.ResponseWriter { return w.w } +func (w *rw25) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw25) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw25) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw25) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw25) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw25) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw25) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 27/512: http.ResponseWriter, io.ReaderFrom, deadliner, http.Pusher +type rw26 rwState + +func (w *rw26) Unwrap() http.ResponseWriter { return w.w } +func (w *rw26) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw26) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw26) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw26) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw26) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw26) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw26) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 28/512: http.ResponseWriter, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw27 rwState + +func (w *rw27) Unwrap() http.ResponseWriter { return w.w } +func (w *rw27) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw27) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw27) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw27) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw27) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw27) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw27) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw27) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 29/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw28 rwState + +func (w *rw28) Unwrap() http.ResponseWriter { return w.w } +func (w *rw28) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw28) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw28) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw28) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw28) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw28) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw28) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 30/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw29 rwState + +func (w *rw29) Unwrap() http.ResponseWriter { return w.w } +func (w *rw29) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw29) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw29) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw29) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw29) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw29) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw29) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw29) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 31/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw30 rwState + +func (w *rw30) Unwrap() http.ResponseWriter { return w.w } +func (w *rw30) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw30) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw30) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw30) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw30) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw30) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw30) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw30) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 32/512: http.ResponseWriter, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw31 rwState + +func (w *rw31) Unwrap() http.ResponseWriter { return w.w } +func (w *rw31) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw31) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw31) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw31) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw31) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw31) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw31) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw31) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw31) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 33/512: http.ResponseWriter, http.Hijacker +type rw32 rwState + +func (w *rw32) Unwrap() http.ResponseWriter { return w.w } +func (w *rw32) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw32) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw32) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw32) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 34/512: http.ResponseWriter, http.Hijacker, io.StringWriter +type rw33 rwState + +func (w *rw33) Unwrap() http.ResponseWriter { return w.w } +func (w *rw33) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw33) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw33) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw33) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw33) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 35/512: http.ResponseWriter, http.Hijacker, http.Pusher +type rw34 rwState + +func (w *rw34) Unwrap() http.ResponseWriter { return w.w } +func (w *rw34) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw34) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw34) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw34) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw34) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 36/512: http.ResponseWriter, http.Hijacker, http.Pusher, io.StringWriter +type rw35 rwState + +func (w *rw35) Unwrap() http.ResponseWriter { return w.w } +func (w *rw35) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw35) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw35) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw35) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw35) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw35) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 37/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler +type rw36 rwState + +func (w *rw36) Unwrap() http.ResponseWriter { return w.w } +func (w *rw36) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw36) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw36) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw36) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw36) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 38/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw37 rwState + +func (w *rw37) Unwrap() http.ResponseWriter { return w.w } +func (w *rw37) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw37) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw37) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw37) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw37) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw37) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 39/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw38 rwState + +func (w *rw38) Unwrap() http.ResponseWriter { return w.w } +func (w *rw38) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw38) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw38) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw38) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw38) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw38) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 40/512: http.ResponseWriter, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw39 rwState + +func (w *rw39) Unwrap() http.ResponseWriter { return w.w } +func (w *rw39) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw39) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw39) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw39) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw39) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw39) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw39) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 41/512: http.ResponseWriter, http.Hijacker, deadliner +type rw40 rwState + +func (w *rw40) Unwrap() http.ResponseWriter { return w.w } +func (w *rw40) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw40) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw40) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw40) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw40) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw40) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 42/512: http.ResponseWriter, http.Hijacker, deadliner, io.StringWriter +type rw41 rwState + +func (w *rw41) Unwrap() http.ResponseWriter { return w.w } +func (w *rw41) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw41) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw41) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw41) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw41) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw41) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw41) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 43/512: http.ResponseWriter, http.Hijacker, deadliner, http.Pusher +type rw42 rwState + +func (w *rw42) Unwrap() http.ResponseWriter { return w.w } +func (w *rw42) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw42) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw42) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw42) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw42) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw42) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw42) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 44/512: http.ResponseWriter, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw43 rwState + +func (w *rw43) Unwrap() http.ResponseWriter { return w.w } +func (w *rw43) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw43) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw43) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw43) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw43) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw43) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw43) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw43) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 45/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler +type rw44 rwState + +func (w *rw44) Unwrap() http.ResponseWriter { return w.w } +func (w *rw44) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw44) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw44) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw44) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw44) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw44) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw44) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 46/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw45 rwState + +func (w *rw45) Unwrap() http.ResponseWriter { return w.w } +func (w *rw45) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw45) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw45) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw45) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw45) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw45) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw45) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw45) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 47/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw46 rwState + +func (w *rw46) Unwrap() http.ResponseWriter { return w.w } +func (w *rw46) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw46) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw46) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw46) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw46) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw46) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw46) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw46) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 48/512: http.ResponseWriter, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw47 rwState + +func (w *rw47) Unwrap() http.ResponseWriter { return w.w } +func (w *rw47) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw47) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw47) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw47) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw47) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw47) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw47) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw47) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw47) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 49/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom +type rw48 rwState + +func (w *rw48) Unwrap() http.ResponseWriter { return w.w } +func (w *rw48) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw48) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw48) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw48) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw48) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 50/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw49 rwState + +func (w *rw49) Unwrap() http.ResponseWriter { return w.w } +func (w *rw49) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw49) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw49) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw49) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw49) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw49) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 51/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, http.Pusher +type rw50 rwState + +func (w *rw50) Unwrap() http.ResponseWriter { return w.w } +func (w *rw50) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw50) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw50) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw50) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw50) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw50) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 52/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw51 rwState + +func (w *rw51) Unwrap() http.ResponseWriter { return w.w } +func (w *rw51) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw51) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw51) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw51) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw51) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw51) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw51) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 53/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw52 rwState + +func (w *rw52) Unwrap() http.ResponseWriter { return w.w } +func (w *rw52) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw52) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw52) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw52) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw52) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw52) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 54/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw53 rwState + +func (w *rw53) Unwrap() http.ResponseWriter { return w.w } +func (w *rw53) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw53) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw53) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw53) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw53) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw53) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw53) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 55/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw54 rwState + +func (w *rw54) Unwrap() http.ResponseWriter { return w.w } +func (w *rw54) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw54) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw54) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw54) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw54) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw54) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw54) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 56/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw55 rwState + +func (w *rw55) Unwrap() http.ResponseWriter { return w.w } +func (w *rw55) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw55) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw55) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw55) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw55) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw55) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw55) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw55) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 57/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner +type rw56 rwState + +func (w *rw56) Unwrap() http.ResponseWriter { return w.w } +func (w *rw56) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw56) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw56) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw56) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw56) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw56) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw56) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 58/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw57 rwState + +func (w *rw57) Unwrap() http.ResponseWriter { return w.w } +func (w *rw57) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw57) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw57) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw57) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw57) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw57) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw57) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw57) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 59/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw58 rwState + +func (w *rw58) Unwrap() http.ResponseWriter { return w.w } +func (w *rw58) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw58) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw58) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw58) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw58) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw58) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw58) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw58) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 60/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw59 rwState + +func (w *rw59) Unwrap() http.ResponseWriter { return w.w } +func (w *rw59) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw59) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw59) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw59) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw59) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw59) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw59) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw59) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw59) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 61/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw60 rwState + +func (w *rw60) Unwrap() http.ResponseWriter { return w.w } +func (w *rw60) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw60) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw60) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw60) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw60) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw60) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw60) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw60) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 62/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw61 rwState + +func (w *rw61) Unwrap() http.ResponseWriter { return w.w } +func (w *rw61) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw61) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw61) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw61) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw61) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw61) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw61) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw61) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw61) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 63/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw62 rwState + +func (w *rw62) Unwrap() http.ResponseWriter { return w.w } +func (w *rw62) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw62) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw62) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw62) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw62) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw62) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw62) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw62) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw62) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 64/512: http.ResponseWriter, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw63 rwState + +func (w *rw63) Unwrap() http.ResponseWriter { return w.w } +func (w *rw63) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw63) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw63) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw63) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw63) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw63) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw63) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw63) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw63) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw63) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 65/512: http.ResponseWriter, http.CloseNotifier +type rw64 rwState + +func (w *rw64) Unwrap() http.ResponseWriter { return w.w } +func (w *rw64) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw64) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw64) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw64) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 66/512: http.ResponseWriter, http.CloseNotifier, io.StringWriter +type rw65 rwState + +func (w *rw65) Unwrap() http.ResponseWriter { return w.w } +func (w *rw65) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw65) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw65) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw65) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw65) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 67/512: http.ResponseWriter, http.CloseNotifier, http.Pusher +type rw66 rwState + +func (w *rw66) Unwrap() http.ResponseWriter { return w.w } +func (w *rw66) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw66) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw66) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw66) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw66) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 68/512: http.ResponseWriter, http.CloseNotifier, http.Pusher, io.StringWriter +type rw67 rwState + +func (w *rw67) Unwrap() http.ResponseWriter { return w.w } +func (w *rw67) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw67) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw67) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw67) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw67) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw67) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 69/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler +type rw68 rwState + +func (w *rw68) Unwrap() http.ResponseWriter { return w.w } +func (w *rw68) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw68) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw68) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw68) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw68) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 70/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw69 rwState + +func (w *rw69) Unwrap() http.ResponseWriter { return w.w } +func (w *rw69) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw69) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw69) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw69) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw69) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw69) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 71/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw70 rwState + +func (w *rw70) Unwrap() http.ResponseWriter { return w.w } +func (w *rw70) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw70) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw70) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw70) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw70) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw70) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 72/512: http.ResponseWriter, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw71 rwState + +func (w *rw71) Unwrap() http.ResponseWriter { return w.w } +func (w *rw71) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw71) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw71) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw71) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw71) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw71) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw71) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 73/512: http.ResponseWriter, http.CloseNotifier, deadliner +type rw72 rwState + +func (w *rw72) Unwrap() http.ResponseWriter { return w.w } +func (w *rw72) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw72) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw72) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw72) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw72) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw72) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 74/512: http.ResponseWriter, http.CloseNotifier, deadliner, io.StringWriter +type rw73 rwState + +func (w *rw73) Unwrap() http.ResponseWriter { return w.w } +func (w *rw73) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw73) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw73) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw73) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw73) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw73) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw73) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 75/512: http.ResponseWriter, http.CloseNotifier, deadliner, http.Pusher +type rw74 rwState + +func (w *rw74) Unwrap() http.ResponseWriter { return w.w } +func (w *rw74) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw74) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw74) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw74) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw74) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw74) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw74) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 76/512: http.ResponseWriter, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw75 rwState + +func (w *rw75) Unwrap() http.ResponseWriter { return w.w } +func (w *rw75) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw75) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw75) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw75) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw75) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw75) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw75) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw75) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 77/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw76 rwState + +func (w *rw76) Unwrap() http.ResponseWriter { return w.w } +func (w *rw76) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw76) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw76) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw76) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw76) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw76) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw76) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 78/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw77 rwState + +func (w *rw77) Unwrap() http.ResponseWriter { return w.w } +func (w *rw77) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw77) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw77) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw77) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw77) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw77) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw77) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw77) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 79/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw78 rwState + +func (w *rw78) Unwrap() http.ResponseWriter { return w.w } +func (w *rw78) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw78) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw78) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw78) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw78) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw78) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw78) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw78) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 80/512: http.ResponseWriter, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw79 rwState + +func (w *rw79) Unwrap() http.ResponseWriter { return w.w } +func (w *rw79) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw79) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw79) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw79) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw79) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw79) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw79) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw79) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw79) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 81/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom +type rw80 rwState + +func (w *rw80) Unwrap() http.ResponseWriter { return w.w } +func (w *rw80) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw80) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw80) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw80) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw80) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 82/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw81 rwState + +func (w *rw81) Unwrap() http.ResponseWriter { return w.w } +func (w *rw81) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw81) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw81) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw81) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw81) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw81) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 83/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw82 rwState + +func (w *rw82) Unwrap() http.ResponseWriter { return w.w } +func (w *rw82) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw82) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw82) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw82) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw82) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw82) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 84/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw83 rwState + +func (w *rw83) Unwrap() http.ResponseWriter { return w.w } +func (w *rw83) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw83) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw83) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw83) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw83) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw83) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw83) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 85/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw84 rwState + +func (w *rw84) Unwrap() http.ResponseWriter { return w.w } +func (w *rw84) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw84) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw84) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw84) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw84) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw84) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 86/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw85 rwState + +func (w *rw85) Unwrap() http.ResponseWriter { return w.w } +func (w *rw85) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw85) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw85) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw85) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw85) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw85) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw85) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 87/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw86 rwState + +func (w *rw86) Unwrap() http.ResponseWriter { return w.w } +func (w *rw86) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw86) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw86) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw86) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw86) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw86) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw86) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 88/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw87 rwState + +func (w *rw87) Unwrap() http.ResponseWriter { return w.w } +func (w *rw87) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw87) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw87) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw87) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw87) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw87) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw87) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw87) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 89/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner +type rw88 rwState + +func (w *rw88) Unwrap() http.ResponseWriter { return w.w } +func (w *rw88) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw88) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw88) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw88) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw88) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw88) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw88) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 90/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw89 rwState + +func (w *rw89) Unwrap() http.ResponseWriter { return w.w } +func (w *rw89) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw89) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw89) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw89) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw89) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw89) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw89) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw89) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 91/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw90 rwState + +func (w *rw90) Unwrap() http.ResponseWriter { return w.w } +func (w *rw90) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw90) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw90) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw90) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw90) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw90) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw90) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw90) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 92/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw91 rwState + +func (w *rw91) Unwrap() http.ResponseWriter { return w.w } +func (w *rw91) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw91) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw91) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw91) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw91) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw91) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw91) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw91) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw91) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 93/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw92 rwState + +func (w *rw92) Unwrap() http.ResponseWriter { return w.w } +func (w *rw92) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw92) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw92) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw92) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw92) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw92) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw92) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw92) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 94/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw93 rwState + +func (w *rw93) Unwrap() http.ResponseWriter { return w.w } +func (w *rw93) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw93) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw93) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw93) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw93) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw93) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw93) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw93) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw93) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 95/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw94 rwState + +func (w *rw94) Unwrap() http.ResponseWriter { return w.w } +func (w *rw94) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw94) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw94) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw94) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw94) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw94) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw94) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw94) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw94) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 96/512: http.ResponseWriter, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw95 rwState + +func (w *rw95) Unwrap() http.ResponseWriter { return w.w } +func (w *rw95) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw95) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw95) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw95) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw95) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw95) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw95) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw95) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw95) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw95) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 97/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker +type rw96 rwState + +func (w *rw96) Unwrap() http.ResponseWriter { return w.w } +func (w *rw96) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw96) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw96) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw96) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw96) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 98/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw97 rwState + +func (w *rw97) Unwrap() http.ResponseWriter { return w.w } +func (w *rw97) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw97) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw97) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw97) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw97) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw97) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 99/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, http.Pusher +type rw98 rwState + +func (w *rw98) Unwrap() http.ResponseWriter { return w.w } +func (w *rw98) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw98) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw98) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw98) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw98) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw98) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 100/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw99 rwState + +func (w *rw99) Unwrap() http.ResponseWriter { return w.w } +func (w *rw99) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw99) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw99) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw99) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw99) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw99) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw99) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 101/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw100 rwState + +func (w *rw100) Unwrap() http.ResponseWriter { return w.w } +func (w *rw100) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw100) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw100) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw100) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw100) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw100) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 102/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw101 rwState + +func (w *rw101) Unwrap() http.ResponseWriter { return w.w } +func (w *rw101) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw101) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw101) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw101) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw101) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw101) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw101) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 103/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw102 rwState + +func (w *rw102) Unwrap() http.ResponseWriter { return w.w } +func (w *rw102) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw102) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw102) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw102) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw102) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw102) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw102) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 104/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw103 rwState + +func (w *rw103) Unwrap() http.ResponseWriter { return w.w } +func (w *rw103) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw103) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw103) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw103) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw103) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw103) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw103) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw103) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 105/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner +type rw104 rwState + +func (w *rw104) Unwrap() http.ResponseWriter { return w.w } +func (w *rw104) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw104) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw104) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw104) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw104) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw104) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw104) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 106/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw105 rwState + +func (w *rw105) Unwrap() http.ResponseWriter { return w.w } +func (w *rw105) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw105) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw105) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw105) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw105) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw105) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw105) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw105) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 107/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw106 rwState + +func (w *rw106) Unwrap() http.ResponseWriter { return w.w } +func (w *rw106) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw106) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw106) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw106) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw106) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw106) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw106) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw106) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 108/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw107 rwState + +func (w *rw107) Unwrap() http.ResponseWriter { return w.w } +func (w *rw107) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw107) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw107) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw107) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw107) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw107) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw107) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw107) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw107) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 109/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw108 rwState + +func (w *rw108) Unwrap() http.ResponseWriter { return w.w } +func (w *rw108) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw108) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw108) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw108) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw108) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw108) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw108) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw108) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 110/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw109 rwState + +func (w *rw109) Unwrap() http.ResponseWriter { return w.w } +func (w *rw109) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw109) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw109) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw109) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw109) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw109) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw109) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw109) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw109) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 111/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw110 rwState + +func (w *rw110) Unwrap() http.ResponseWriter { return w.w } +func (w *rw110) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw110) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw110) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw110) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw110) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw110) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw110) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw110) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw110) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 112/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw111 rwState + +func (w *rw111) Unwrap() http.ResponseWriter { return w.w } +func (w *rw111) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw111) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw111) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw111) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw111) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw111) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw111) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw111) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw111) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw111) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 113/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw112 rwState + +func (w *rw112) Unwrap() http.ResponseWriter { return w.w } +func (w *rw112) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw112) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw112) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw112) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw112) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw112) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 114/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw113 rwState + +func (w *rw113) Unwrap() http.ResponseWriter { return w.w } +func (w *rw113) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw113) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw113) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw113) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw113) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw113) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw113) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 115/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw114 rwState + +func (w *rw114) Unwrap() http.ResponseWriter { return w.w } +func (w *rw114) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw114) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw114) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw114) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw114) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw114) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw114) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 116/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw115 rwState + +func (w *rw115) Unwrap() http.ResponseWriter { return w.w } +func (w *rw115) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw115) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw115) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw115) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw115) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw115) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw115) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw115) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 117/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw116 rwState + +func (w *rw116) Unwrap() http.ResponseWriter { return w.w } +func (w *rw116) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw116) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw116) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw116) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw116) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw116) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw116) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 118/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw117 rwState + +func (w *rw117) Unwrap() http.ResponseWriter { return w.w } +func (w *rw117) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw117) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw117) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw117) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw117) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw117) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw117) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw117) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 119/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw118 rwState + +func (w *rw118) Unwrap() http.ResponseWriter { return w.w } +func (w *rw118) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw118) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw118) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw118) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw118) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw118) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw118) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw118) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 120/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw119 rwState + +func (w *rw119) Unwrap() http.ResponseWriter { return w.w } +func (w *rw119) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw119) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw119) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw119) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw119) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw119) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw119) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw119) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw119) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 121/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw120 rwState + +func (w *rw120) Unwrap() http.ResponseWriter { return w.w } +func (w *rw120) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw120) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw120) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw120) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw120) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw120) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw120) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw120) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 122/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw121 rwState + +func (w *rw121) Unwrap() http.ResponseWriter { return w.w } +func (w *rw121) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw121) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw121) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw121) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw121) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw121) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw121) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw121) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw121) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 123/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw122 rwState + +func (w *rw122) Unwrap() http.ResponseWriter { return w.w } +func (w *rw122) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw122) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw122) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw122) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw122) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw122) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw122) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw122) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw122) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 124/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw123 rwState + +func (w *rw123) Unwrap() http.ResponseWriter { return w.w } +func (w *rw123) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw123) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw123) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw123) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw123) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw123) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw123) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw123) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw123) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw123) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 125/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw124 rwState + +func (w *rw124) Unwrap() http.ResponseWriter { return w.w } +func (w *rw124) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw124) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw124) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw124) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw124) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw124) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw124) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw124) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw124) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 126/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw125 rwState + +func (w *rw125) Unwrap() http.ResponseWriter { return w.w } +func (w *rw125) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw125) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw125) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw125) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw125) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw125) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw125) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw125) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw125) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw125) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 127/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw126 rwState + +func (w *rw126) Unwrap() http.ResponseWriter { return w.w } +func (w *rw126) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw126) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw126) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw126) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw126) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw126) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw126) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw126) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw126) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw126) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 128/512: http.ResponseWriter, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw127 rwState + +func (w *rw127) Unwrap() http.ResponseWriter { return w.w } +func (w *rw127) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw127) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw127) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw127) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw127) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw127) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw127) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw127) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw127) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw127) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw127) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 129/512: http.ResponseWriter, httpFlushError +type rw128 rwState + +func (w *rw128) Unwrap() http.ResponseWriter { return w.w } +func (w *rw128) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw128) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw128) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw128) FlushError() error { + return (*rwState)(w).doFlushError() +} + +// combination 130/512: http.ResponseWriter, httpFlushError, io.StringWriter +type rw129 rwState + +func (w *rw129) Unwrap() http.ResponseWriter { return w.w } +func (w *rw129) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw129) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw129) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw129) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw129) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 131/512: http.ResponseWriter, httpFlushError, http.Pusher +type rw130 rwState + +func (w *rw130) Unwrap() http.ResponseWriter { return w.w } +func (w *rw130) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw130) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw130) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw130) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw130) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 132/512: http.ResponseWriter, httpFlushError, http.Pusher, io.StringWriter +type rw131 rwState + +func (w *rw131) Unwrap() http.ResponseWriter { return w.w } +func (w *rw131) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw131) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw131) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw131) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw131) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw131) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 133/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler +type rw132 rwState + +func (w *rw132) Unwrap() http.ResponseWriter { return w.w } +func (w *rw132) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw132) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw132) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw132) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw132) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 134/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler, io.StringWriter +type rw133 rwState + +func (w *rw133) Unwrap() http.ResponseWriter { return w.w } +func (w *rw133) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw133) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw133) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw133) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw133) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw133) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 135/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler, http.Pusher +type rw134 rwState + +func (w *rw134) Unwrap() http.ResponseWriter { return w.w } +func (w *rw134) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw134) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw134) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw134) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw134) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw134) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 136/512: http.ResponseWriter, httpFlushError, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw135 rwState + +func (w *rw135) Unwrap() http.ResponseWriter { return w.w } +func (w *rw135) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw135) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw135) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw135) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw135) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw135) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw135) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 137/512: http.ResponseWriter, httpFlushError, deadliner +type rw136 rwState + +func (w *rw136) Unwrap() http.ResponseWriter { return w.w } +func (w *rw136) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw136) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw136) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw136) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw136) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw136) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 138/512: http.ResponseWriter, httpFlushError, deadliner, io.StringWriter +type rw137 rwState + +func (w *rw137) Unwrap() http.ResponseWriter { return w.w } +func (w *rw137) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw137) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw137) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw137) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw137) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw137) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw137) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 139/512: http.ResponseWriter, httpFlushError, deadliner, http.Pusher +type rw138 rwState + +func (w *rw138) Unwrap() http.ResponseWriter { return w.w } +func (w *rw138) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw138) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw138) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw138) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw138) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw138) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw138) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 140/512: http.ResponseWriter, httpFlushError, deadliner, http.Pusher, io.StringWriter +type rw139 rwState + +func (w *rw139) Unwrap() http.ResponseWriter { return w.w } +func (w *rw139) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw139) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw139) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw139) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw139) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw139) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw139) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw139) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 141/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler +type rw140 rwState + +func (w *rw140) Unwrap() http.ResponseWriter { return w.w } +func (w *rw140) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw140) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw140) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw140) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw140) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw140) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw140) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 142/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler, io.StringWriter +type rw141 rwState + +func (w *rw141) Unwrap() http.ResponseWriter { return w.w } +func (w *rw141) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw141) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw141) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw141) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw141) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw141) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw141) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw141) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 143/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher +type rw142 rwState + +func (w *rw142) Unwrap() http.ResponseWriter { return w.w } +func (w *rw142) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw142) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw142) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw142) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw142) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw142) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw142) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw142) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 144/512: http.ResponseWriter, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw143 rwState + +func (w *rw143) Unwrap() http.ResponseWriter { return w.w } +func (w *rw143) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw143) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw143) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw143) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw143) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw143) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw143) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw143) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw143) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 145/512: http.ResponseWriter, httpFlushError, io.ReaderFrom +type rw144 rwState + +func (w *rw144) Unwrap() http.ResponseWriter { return w.w } +func (w *rw144) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw144) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw144) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw144) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw144) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 146/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, io.StringWriter +type rw145 rwState + +func (w *rw145) Unwrap() http.ResponseWriter { return w.w } +func (w *rw145) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw145) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw145) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw145) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw145) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw145) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 147/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, http.Pusher +type rw146 rwState + +func (w *rw146) Unwrap() http.ResponseWriter { return w.w } +func (w *rw146) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw146) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw146) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw146) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw146) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw146) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 148/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, http.Pusher, io.StringWriter +type rw147 rwState + +func (w *rw147) Unwrap() http.ResponseWriter { return w.w } +func (w *rw147) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw147) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw147) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw147) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw147) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw147) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw147) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 149/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler +type rw148 rwState + +func (w *rw148) Unwrap() http.ResponseWriter { return w.w } +func (w *rw148) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw148) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw148) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw148) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw148) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw148) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 150/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw149 rwState + +func (w *rw149) Unwrap() http.ResponseWriter { return w.w } +func (w *rw149) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw149) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw149) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw149) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw149) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw149) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw149) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 151/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw150 rwState + +func (w *rw150) Unwrap() http.ResponseWriter { return w.w } +func (w *rw150) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw150) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw150) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw150) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw150) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw150) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw150) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 152/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw151 rwState + +func (w *rw151) Unwrap() http.ResponseWriter { return w.w } +func (w *rw151) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw151) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw151) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw151) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw151) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw151) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw151) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw151) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 153/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner +type rw152 rwState + +func (w *rw152) Unwrap() http.ResponseWriter { return w.w } +func (w *rw152) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw152) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw152) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw152) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw152) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw152) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw152) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 154/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, io.StringWriter +type rw153 rwState + +func (w *rw153) Unwrap() http.ResponseWriter { return w.w } +func (w *rw153) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw153) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw153) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw153) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw153) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw153) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw153) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw153) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 155/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, http.Pusher +type rw154 rwState + +func (w *rw154) Unwrap() http.ResponseWriter { return w.w } +func (w *rw154) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw154) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw154) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw154) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw154) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw154) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw154) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw154) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 156/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw155 rwState + +func (w *rw155) Unwrap() http.ResponseWriter { return w.w } +func (w *rw155) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw155) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw155) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw155) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw155) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw155) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw155) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw155) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw155) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 157/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw156 rwState + +func (w *rw156) Unwrap() http.ResponseWriter { return w.w } +func (w *rw156) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw156) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw156) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw156) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw156) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw156) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw156) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw156) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 158/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw157 rwState + +func (w *rw157) Unwrap() http.ResponseWriter { return w.w } +func (w *rw157) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw157) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw157) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw157) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw157) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw157) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw157) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw157) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw157) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 159/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw158 rwState + +func (w *rw158) Unwrap() http.ResponseWriter { return w.w } +func (w *rw158) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw158) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw158) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw158) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw158) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw158) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw158) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw158) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw158) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 160/512: http.ResponseWriter, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw159 rwState + +func (w *rw159) Unwrap() http.ResponseWriter { return w.w } +func (w *rw159) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw159) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw159) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw159) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw159) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw159) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw159) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw159) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw159) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw159) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 161/512: http.ResponseWriter, httpFlushError, http.Hijacker +type rw160 rwState + +func (w *rw160) Unwrap() http.ResponseWriter { return w.w } +func (w *rw160) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw160) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw160) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw160) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw160) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 162/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.StringWriter +type rw161 rwState + +func (w *rw161) Unwrap() http.ResponseWriter { return w.w } +func (w *rw161) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw161) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw161) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw161) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw161) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw161) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 163/512: http.ResponseWriter, httpFlushError, http.Hijacker, http.Pusher +type rw162 rwState + +func (w *rw162) Unwrap() http.ResponseWriter { return w.w } +func (w *rw162) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw162) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw162) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw162) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw162) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw162) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 164/512: http.ResponseWriter, httpFlushError, http.Hijacker, http.Pusher, io.StringWriter +type rw163 rwState + +func (w *rw163) Unwrap() http.ResponseWriter { return w.w } +func (w *rw163) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw163) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw163) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw163) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw163) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw163) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw163) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 165/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler +type rw164 rwState + +func (w *rw164) Unwrap() http.ResponseWriter { return w.w } +func (w *rw164) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw164) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw164) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw164) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw164) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw164) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 166/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw165 rwState + +func (w *rw165) Unwrap() http.ResponseWriter { return w.w } +func (w *rw165) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw165) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw165) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw165) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw165) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw165) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw165) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 167/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw166 rwState + +func (w *rw166) Unwrap() http.ResponseWriter { return w.w } +func (w *rw166) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw166) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw166) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw166) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw166) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw166) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw166) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 168/512: http.ResponseWriter, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw167 rwState + +func (w *rw167) Unwrap() http.ResponseWriter { return w.w } +func (w *rw167) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw167) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw167) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw167) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw167) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw167) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw167) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw167) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 169/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner +type rw168 rwState + +func (w *rw168) Unwrap() http.ResponseWriter { return w.w } +func (w *rw168) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw168) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw168) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw168) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw168) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw168) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw168) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 170/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, io.StringWriter +type rw169 rwState + +func (w *rw169) Unwrap() http.ResponseWriter { return w.w } +func (w *rw169) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw169) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw169) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw169) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw169) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw169) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw169) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw169) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 171/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, http.Pusher +type rw170 rwState + +func (w *rw170) Unwrap() http.ResponseWriter { return w.w } +func (w *rw170) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw170) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw170) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw170) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw170) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw170) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw170) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw170) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 172/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw171 rwState + +func (w *rw171) Unwrap() http.ResponseWriter { return w.w } +func (w *rw171) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw171) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw171) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw171) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw171) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw171) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw171) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw171) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw171) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 173/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler +type rw172 rwState + +func (w *rw172) Unwrap() http.ResponseWriter { return w.w } +func (w *rw172) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw172) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw172) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw172) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw172) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw172) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw172) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw172) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 174/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw173 rwState + +func (w *rw173) Unwrap() http.ResponseWriter { return w.w } +func (w *rw173) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw173) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw173) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw173) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw173) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw173) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw173) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw173) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw173) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 175/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw174 rwState + +func (w *rw174) Unwrap() http.ResponseWriter { return w.w } +func (w *rw174) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw174) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw174) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw174) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw174) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw174) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw174) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw174) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw174) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 176/512: http.ResponseWriter, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw175 rwState + +func (w *rw175) Unwrap() http.ResponseWriter { return w.w } +func (w *rw175) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw175) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw175) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw175) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw175) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw175) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw175) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw175) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw175) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw175) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 177/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom +type rw176 rwState + +func (w *rw176) Unwrap() http.ResponseWriter { return w.w } +func (w *rw176) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw176) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw176) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw176) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw176) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw176) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 178/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw177 rwState + +func (w *rw177) Unwrap() http.ResponseWriter { return w.w } +func (w *rw177) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw177) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw177) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw177) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw177) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw177) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw177) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 179/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher +type rw178 rwState + +func (w *rw178) Unwrap() http.ResponseWriter { return w.w } +func (w *rw178) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw178) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw178) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw178) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw178) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw178) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw178) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 180/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw179 rwState + +func (w *rw179) Unwrap() http.ResponseWriter { return w.w } +func (w *rw179) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw179) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw179) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw179) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw179) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw179) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw179) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw179) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 181/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw180 rwState + +func (w *rw180) Unwrap() http.ResponseWriter { return w.w } +func (w *rw180) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw180) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw180) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw180) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw180) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw180) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw180) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 182/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw181 rwState + +func (w *rw181) Unwrap() http.ResponseWriter { return w.w } +func (w *rw181) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw181) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw181) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw181) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw181) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw181) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw181) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw181) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 183/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw182 rwState + +func (w *rw182) Unwrap() http.ResponseWriter { return w.w } +func (w *rw182) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw182) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw182) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw182) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw182) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw182) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw182) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw182) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 184/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw183 rwState + +func (w *rw183) Unwrap() http.ResponseWriter { return w.w } +func (w *rw183) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw183) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw183) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw183) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw183) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw183) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw183) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw183) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw183) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 185/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner +type rw184 rwState + +func (w *rw184) Unwrap() http.ResponseWriter { return w.w } +func (w *rw184) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw184) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw184) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw184) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw184) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw184) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw184) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw184) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 186/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw185 rwState + +func (w *rw185) Unwrap() http.ResponseWriter { return w.w } +func (w *rw185) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw185) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw185) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw185) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw185) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw185) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw185) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw185) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw185) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 187/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw186 rwState + +func (w *rw186) Unwrap() http.ResponseWriter { return w.w } +func (w *rw186) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw186) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw186) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw186) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw186) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw186) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw186) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw186) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw186) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 188/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw187 rwState + +func (w *rw187) Unwrap() http.ResponseWriter { return w.w } +func (w *rw187) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw187) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw187) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw187) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw187) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw187) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw187) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw187) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw187) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw187) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 189/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw188 rwState + +func (w *rw188) Unwrap() http.ResponseWriter { return w.w } +func (w *rw188) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw188) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw188) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw188) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw188) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw188) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw188) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw188) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw188) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 190/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw189 rwState + +func (w *rw189) Unwrap() http.ResponseWriter { return w.w } +func (w *rw189) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw189) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw189) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw189) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw189) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw189) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw189) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw189) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw189) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw189) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 191/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw190 rwState + +func (w *rw190) Unwrap() http.ResponseWriter { return w.w } +func (w *rw190) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw190) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw190) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw190) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw190) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw190) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw190) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw190) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw190) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw190) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 192/512: http.ResponseWriter, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw191 rwState + +func (w *rw191) Unwrap() http.ResponseWriter { return w.w } +func (w *rw191) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw191) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw191) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw191) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw191) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw191) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw191) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw191) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw191) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw191) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw191) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 193/512: http.ResponseWriter, httpFlushError, http.CloseNotifier +type rw192 rwState + +func (w *rw192) Unwrap() http.ResponseWriter { return w.w } +func (w *rw192) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw192) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw192) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw192) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw192) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 194/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.StringWriter +type rw193 rwState + +func (w *rw193) Unwrap() http.ResponseWriter { return w.w } +func (w *rw193) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw193) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw193) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw193) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw193) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw193) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 195/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Pusher +type rw194 rwState + +func (w *rw194) Unwrap() http.ResponseWriter { return w.w } +func (w *rw194) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw194) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw194) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw194) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw194) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw194) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 196/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Pusher, io.StringWriter +type rw195 rwState + +func (w *rw195) Unwrap() http.ResponseWriter { return w.w } +func (w *rw195) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw195) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw195) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw195) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw195) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw195) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw195) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 197/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler +type rw196 rwState + +func (w *rw196) Unwrap() http.ResponseWriter { return w.w } +func (w *rw196) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw196) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw196) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw196) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw196) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw196) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 198/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw197 rwState + +func (w *rw197) Unwrap() http.ResponseWriter { return w.w } +func (w *rw197) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw197) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw197) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw197) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw197) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw197) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw197) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 199/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw198 rwState + +func (w *rw198) Unwrap() http.ResponseWriter { return w.w } +func (w *rw198) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw198) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw198) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw198) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw198) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw198) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw198) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 200/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw199 rwState + +func (w *rw199) Unwrap() http.ResponseWriter { return w.w } +func (w *rw199) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw199) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw199) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw199) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw199) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw199) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw199) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw199) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 201/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner +type rw200 rwState + +func (w *rw200) Unwrap() http.ResponseWriter { return w.w } +func (w *rw200) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw200) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw200) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw200) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw200) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw200) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw200) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 202/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, io.StringWriter +type rw201 rwState + +func (w *rw201) Unwrap() http.ResponseWriter { return w.w } +func (w *rw201) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw201) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw201) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw201) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw201) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw201) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw201) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw201) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 203/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, http.Pusher +type rw202 rwState + +func (w *rw202) Unwrap() http.ResponseWriter { return w.w } +func (w *rw202) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw202) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw202) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw202) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw202) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw202) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw202) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw202) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 204/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw203 rwState + +func (w *rw203) Unwrap() http.ResponseWriter { return w.w } +func (w *rw203) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw203) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw203) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw203) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw203) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw203) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw203) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw203) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw203) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 205/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw204 rwState + +func (w *rw204) Unwrap() http.ResponseWriter { return w.w } +func (w *rw204) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw204) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw204) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw204) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw204) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw204) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw204) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw204) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 206/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw205 rwState + +func (w *rw205) Unwrap() http.ResponseWriter { return w.w } +func (w *rw205) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw205) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw205) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw205) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw205) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw205) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw205) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw205) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw205) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 207/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw206 rwState + +func (w *rw206) Unwrap() http.ResponseWriter { return w.w } +func (w *rw206) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw206) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw206) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw206) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw206) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw206) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw206) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw206) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw206) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 208/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw207 rwState + +func (w *rw207) Unwrap() http.ResponseWriter { return w.w } +func (w *rw207) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw207) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw207) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw207) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw207) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw207) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw207) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw207) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw207) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw207) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 209/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom +type rw208 rwState + +func (w *rw208) Unwrap() http.ResponseWriter { return w.w } +func (w *rw208) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw208) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw208) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw208) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw208) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw208) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 210/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw209 rwState + +func (w *rw209) Unwrap() http.ResponseWriter { return w.w } +func (w *rw209) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw209) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw209) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw209) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw209) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw209) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw209) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 211/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw210 rwState + +func (w *rw210) Unwrap() http.ResponseWriter { return w.w } +func (w *rw210) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw210) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw210) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw210) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw210) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw210) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw210) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 212/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw211 rwState + +func (w *rw211) Unwrap() http.ResponseWriter { return w.w } +func (w *rw211) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw211) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw211) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw211) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw211) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw211) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw211) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw211) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 213/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw212 rwState + +func (w *rw212) Unwrap() http.ResponseWriter { return w.w } +func (w *rw212) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw212) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw212) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw212) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw212) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw212) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw212) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 214/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw213 rwState + +func (w *rw213) Unwrap() http.ResponseWriter { return w.w } +func (w *rw213) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw213) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw213) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw213) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw213) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw213) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw213) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw213) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 215/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw214 rwState + +func (w *rw214) Unwrap() http.ResponseWriter { return w.w } +func (w *rw214) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw214) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw214) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw214) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw214) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw214) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw214) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw214) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 216/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw215 rwState + +func (w *rw215) Unwrap() http.ResponseWriter { return w.w } +func (w *rw215) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw215) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw215) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw215) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw215) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw215) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw215) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw215) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw215) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 217/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner +type rw216 rwState + +func (w *rw216) Unwrap() http.ResponseWriter { return w.w } +func (w *rw216) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw216) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw216) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw216) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw216) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw216) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw216) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw216) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 218/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw217 rwState + +func (w *rw217) Unwrap() http.ResponseWriter { return w.w } +func (w *rw217) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw217) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw217) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw217) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw217) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw217) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw217) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw217) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw217) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 219/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw218 rwState + +func (w *rw218) Unwrap() http.ResponseWriter { return w.w } +func (w *rw218) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw218) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw218) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw218) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw218) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw218) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw218) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw218) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw218) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 220/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw219 rwState + +func (w *rw219) Unwrap() http.ResponseWriter { return w.w } +func (w *rw219) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw219) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw219) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw219) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw219) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw219) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw219) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw219) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw219) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw219) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 221/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw220 rwState + +func (w *rw220) Unwrap() http.ResponseWriter { return w.w } +func (w *rw220) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw220) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw220) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw220) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw220) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw220) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw220) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw220) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw220) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 222/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw221 rwState + +func (w *rw221) Unwrap() http.ResponseWriter { return w.w } +func (w *rw221) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw221) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw221) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw221) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw221) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw221) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw221) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw221) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw221) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw221) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 223/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw222 rwState + +func (w *rw222) Unwrap() http.ResponseWriter { return w.w } +func (w *rw222) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw222) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw222) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw222) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw222) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw222) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw222) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw222) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw222) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw222) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 224/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw223 rwState + +func (w *rw223) Unwrap() http.ResponseWriter { return w.w } +func (w *rw223) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw223) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw223) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw223) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw223) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw223) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw223) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw223) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw223) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw223) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw223) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 225/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker +type rw224 rwState + +func (w *rw224) Unwrap() http.ResponseWriter { return w.w } +func (w *rw224) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw224) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw224) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw224) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw224) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw224) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 226/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw225 rwState + +func (w *rw225) Unwrap() http.ResponseWriter { return w.w } +func (w *rw225) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw225) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw225) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw225) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw225) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw225) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw225) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 227/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher +type rw226 rwState + +func (w *rw226) Unwrap() http.ResponseWriter { return w.w } +func (w *rw226) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw226) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw226) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw226) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw226) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw226) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw226) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 228/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw227 rwState + +func (w *rw227) Unwrap() http.ResponseWriter { return w.w } +func (w *rw227) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw227) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw227) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw227) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw227) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw227) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw227) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw227) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 229/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw228 rwState + +func (w *rw228) Unwrap() http.ResponseWriter { return w.w } +func (w *rw228) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw228) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw228) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw228) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw228) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw228) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw228) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 230/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw229 rwState + +func (w *rw229) Unwrap() http.ResponseWriter { return w.w } +func (w *rw229) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw229) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw229) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw229) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw229) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw229) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw229) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw229) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 231/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw230 rwState + +func (w *rw230) Unwrap() http.ResponseWriter { return w.w } +func (w *rw230) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw230) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw230) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw230) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw230) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw230) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw230) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw230) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 232/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw231 rwState + +func (w *rw231) Unwrap() http.ResponseWriter { return w.w } +func (w *rw231) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw231) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw231) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw231) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw231) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw231) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw231) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw231) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw231) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 233/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner +type rw232 rwState + +func (w *rw232) Unwrap() http.ResponseWriter { return w.w } +func (w *rw232) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw232) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw232) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw232) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw232) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw232) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw232) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw232) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 234/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw233 rwState + +func (w *rw233) Unwrap() http.ResponseWriter { return w.w } +func (w *rw233) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw233) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw233) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw233) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw233) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw233) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw233) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw233) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw233) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 235/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw234 rwState + +func (w *rw234) Unwrap() http.ResponseWriter { return w.w } +func (w *rw234) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw234) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw234) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw234) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw234) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw234) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw234) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw234) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw234) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 236/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw235 rwState + +func (w *rw235) Unwrap() http.ResponseWriter { return w.w } +func (w *rw235) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw235) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw235) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw235) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw235) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw235) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw235) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw235) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw235) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw235) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 237/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw236 rwState + +func (w *rw236) Unwrap() http.ResponseWriter { return w.w } +func (w *rw236) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw236) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw236) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw236) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw236) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw236) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw236) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw236) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw236) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 238/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw237 rwState + +func (w *rw237) Unwrap() http.ResponseWriter { return w.w } +func (w *rw237) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw237) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw237) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw237) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw237) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw237) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw237) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw237) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw237) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw237) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 239/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw238 rwState + +func (w *rw238) Unwrap() http.ResponseWriter { return w.w } +func (w *rw238) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw238) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw238) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw238) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw238) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw238) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw238) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw238) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw238) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw238) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 240/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw239 rwState + +func (w *rw239) Unwrap() http.ResponseWriter { return w.w } +func (w *rw239) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw239) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw239) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw239) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw239) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw239) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw239) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw239) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw239) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw239) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw239) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 241/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw240 rwState + +func (w *rw240) Unwrap() http.ResponseWriter { return w.w } +func (w *rw240) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw240) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw240) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw240) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw240) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw240) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw240) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 242/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw241 rwState + +func (w *rw241) Unwrap() http.ResponseWriter { return w.w } +func (w *rw241) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw241) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw241) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw241) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw241) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw241) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw241) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw241) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 243/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw242 rwState + +func (w *rw242) Unwrap() http.ResponseWriter { return w.w } +func (w *rw242) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw242) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw242) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw242) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw242) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw242) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw242) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw242) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 244/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw243 rwState + +func (w *rw243) Unwrap() http.ResponseWriter { return w.w } +func (w *rw243) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw243) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw243) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw243) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw243) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw243) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw243) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw243) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw243) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 245/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw244 rwState + +func (w *rw244) Unwrap() http.ResponseWriter { return w.w } +func (w *rw244) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw244) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw244) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw244) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw244) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw244) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw244) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw244) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 246/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw245 rwState + +func (w *rw245) Unwrap() http.ResponseWriter { return w.w } +func (w *rw245) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw245) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw245) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw245) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw245) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw245) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw245) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw245) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw245) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 247/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw246 rwState + +func (w *rw246) Unwrap() http.ResponseWriter { return w.w } +func (w *rw246) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw246) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw246) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw246) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw246) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw246) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw246) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw246) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw246) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 248/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw247 rwState + +func (w *rw247) Unwrap() http.ResponseWriter { return w.w } +func (w *rw247) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw247) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw247) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw247) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw247) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw247) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw247) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw247) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw247) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw247) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 249/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw248 rwState + +func (w *rw248) Unwrap() http.ResponseWriter { return w.w } +func (w *rw248) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw248) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw248) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw248) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw248) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw248) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw248) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw248) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw248) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 250/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw249 rwState + +func (w *rw249) Unwrap() http.ResponseWriter { return w.w } +func (w *rw249) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw249) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw249) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw249) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw249) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw249) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw249) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw249) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw249) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw249) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 251/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw250 rwState + +func (w *rw250) Unwrap() http.ResponseWriter { return w.w } +func (w *rw250) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw250) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw250) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw250) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw250) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw250) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw250) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw250) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw250) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw250) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 252/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw251 rwState + +func (w *rw251) Unwrap() http.ResponseWriter { return w.w } +func (w *rw251) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw251) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw251) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw251) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw251) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw251) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw251) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw251) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw251) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw251) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw251) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 253/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw252 rwState + +func (w *rw252) Unwrap() http.ResponseWriter { return w.w } +func (w *rw252) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw252) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw252) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw252) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw252) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw252) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw252) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw252) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw252) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw252) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 254/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw253 rwState + +func (w *rw253) Unwrap() http.ResponseWriter { return w.w } +func (w *rw253) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw253) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw253) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw253) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw253) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw253) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw253) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw253) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw253) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw253) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw253) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 255/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw254 rwState + +func (w *rw254) Unwrap() http.ResponseWriter { return w.w } +func (w *rw254) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw254) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw254) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw254) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw254) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw254) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw254) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw254) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw254) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw254) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw254) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 256/512: http.ResponseWriter, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw255 rwState + +func (w *rw255) Unwrap() http.ResponseWriter { return w.w } +func (w *rw255) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw255) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw255) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw255) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw255) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw255) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw255) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw255) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw255) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw255) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw255) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw255) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 257/512: http.ResponseWriter, http.Flusher +type rw256 rwState + +func (w *rw256) Unwrap() http.ResponseWriter { return w.w } +func (w *rw256) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw256) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw256) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw256) Flush() { + (*rwState)(w).doFlush() +} + +// combination 258/512: http.ResponseWriter, http.Flusher, io.StringWriter +type rw257 rwState + +func (w *rw257) Unwrap() http.ResponseWriter { return w.w } +func (w *rw257) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw257) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw257) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw257) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw257) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 259/512: http.ResponseWriter, http.Flusher, http.Pusher +type rw258 rwState + +func (w *rw258) Unwrap() http.ResponseWriter { return w.w } +func (w *rw258) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw258) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw258) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw258) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw258) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 260/512: http.ResponseWriter, http.Flusher, http.Pusher, io.StringWriter +type rw259 rwState + +func (w *rw259) Unwrap() http.ResponseWriter { return w.w } +func (w *rw259) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw259) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw259) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw259) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw259) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw259) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 261/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler +type rw260 rwState + +func (w *rw260) Unwrap() http.ResponseWriter { return w.w } +func (w *rw260) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw260) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw260) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw260) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw260) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 262/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler, io.StringWriter +type rw261 rwState + +func (w *rw261) Unwrap() http.ResponseWriter { return w.w } +func (w *rw261) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw261) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw261) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw261) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw261) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw261) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 263/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler, http.Pusher +type rw262 rwState + +func (w *rw262) Unwrap() http.ResponseWriter { return w.w } +func (w *rw262) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw262) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw262) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw262) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw262) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw262) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 264/512: http.ResponseWriter, http.Flusher, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw263 rwState + +func (w *rw263) Unwrap() http.ResponseWriter { return w.w } +func (w *rw263) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw263) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw263) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw263) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw263) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw263) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw263) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 265/512: http.ResponseWriter, http.Flusher, deadliner +type rw264 rwState + +func (w *rw264) Unwrap() http.ResponseWriter { return w.w } +func (w *rw264) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw264) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw264) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw264) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw264) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw264) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 266/512: http.ResponseWriter, http.Flusher, deadliner, io.StringWriter +type rw265 rwState + +func (w *rw265) Unwrap() http.ResponseWriter { return w.w } +func (w *rw265) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw265) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw265) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw265) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw265) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw265) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw265) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 267/512: http.ResponseWriter, http.Flusher, deadliner, http.Pusher +type rw266 rwState + +func (w *rw266) Unwrap() http.ResponseWriter { return w.w } +func (w *rw266) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw266) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw266) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw266) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw266) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw266) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw266) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 268/512: http.ResponseWriter, http.Flusher, deadliner, http.Pusher, io.StringWriter +type rw267 rwState + +func (w *rw267) Unwrap() http.ResponseWriter { return w.w } +func (w *rw267) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw267) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw267) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw267) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw267) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw267) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw267) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw267) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 269/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler +type rw268 rwState + +func (w *rw268) Unwrap() http.ResponseWriter { return w.w } +func (w *rw268) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw268) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw268) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw268) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw268) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw268) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw268) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 270/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler, io.StringWriter +type rw269 rwState + +func (w *rw269) Unwrap() http.ResponseWriter { return w.w } +func (w *rw269) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw269) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw269) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw269) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw269) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw269) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw269) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw269) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 271/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler, http.Pusher +type rw270 rwState + +func (w *rw270) Unwrap() http.ResponseWriter { return w.w } +func (w *rw270) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw270) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw270) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw270) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw270) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw270) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw270) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw270) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 272/512: http.ResponseWriter, http.Flusher, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw271 rwState + +func (w *rw271) Unwrap() http.ResponseWriter { return w.w } +func (w *rw271) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw271) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw271) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw271) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw271) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw271) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw271) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw271) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw271) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 273/512: http.ResponseWriter, http.Flusher, io.ReaderFrom +type rw272 rwState + +func (w *rw272) Unwrap() http.ResponseWriter { return w.w } +func (w *rw272) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw272) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw272) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw272) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw272) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 274/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, io.StringWriter +type rw273 rwState + +func (w *rw273) Unwrap() http.ResponseWriter { return w.w } +func (w *rw273) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw273) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw273) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw273) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw273) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw273) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 275/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, http.Pusher +type rw274 rwState + +func (w *rw274) Unwrap() http.ResponseWriter { return w.w } +func (w *rw274) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw274) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw274) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw274) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw274) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw274) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 276/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, http.Pusher, io.StringWriter +type rw275 rwState + +func (w *rw275) Unwrap() http.ResponseWriter { return w.w } +func (w *rw275) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw275) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw275) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw275) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw275) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw275) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw275) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 277/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler +type rw276 rwState + +func (w *rw276) Unwrap() http.ResponseWriter { return w.w } +func (w *rw276) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw276) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw276) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw276) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw276) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw276) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 278/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw277 rwState + +func (w *rw277) Unwrap() http.ResponseWriter { return w.w } +func (w *rw277) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw277) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw277) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw277) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw277) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw277) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw277) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 279/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw278 rwState + +func (w *rw278) Unwrap() http.ResponseWriter { return w.w } +func (w *rw278) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw278) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw278) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw278) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw278) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw278) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw278) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 280/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw279 rwState + +func (w *rw279) Unwrap() http.ResponseWriter { return w.w } +func (w *rw279) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw279) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw279) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw279) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw279) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw279) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw279) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw279) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 281/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner +type rw280 rwState + +func (w *rw280) Unwrap() http.ResponseWriter { return w.w } +func (w *rw280) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw280) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw280) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw280) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw280) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw280) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw280) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 282/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, io.StringWriter +type rw281 rwState + +func (w *rw281) Unwrap() http.ResponseWriter { return w.w } +func (w *rw281) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw281) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw281) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw281) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw281) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw281) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw281) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw281) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 283/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, http.Pusher +type rw282 rwState + +func (w *rw282) Unwrap() http.ResponseWriter { return w.w } +func (w *rw282) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw282) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw282) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw282) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw282) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw282) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw282) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw282) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 284/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw283 rwState + +func (w *rw283) Unwrap() http.ResponseWriter { return w.w } +func (w *rw283) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw283) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw283) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw283) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw283) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw283) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw283) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw283) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw283) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 285/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw284 rwState + +func (w *rw284) Unwrap() http.ResponseWriter { return w.w } +func (w *rw284) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw284) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw284) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw284) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw284) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw284) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw284) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw284) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 286/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw285 rwState + +func (w *rw285) Unwrap() http.ResponseWriter { return w.w } +func (w *rw285) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw285) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw285) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw285) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw285) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw285) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw285) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw285) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw285) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 287/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw286 rwState + +func (w *rw286) Unwrap() http.ResponseWriter { return w.w } +func (w *rw286) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw286) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw286) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw286) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw286) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw286) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw286) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw286) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw286) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 288/512: http.ResponseWriter, http.Flusher, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw287 rwState + +func (w *rw287) Unwrap() http.ResponseWriter { return w.w } +func (w *rw287) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw287) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw287) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw287) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw287) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw287) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw287) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw287) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw287) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw287) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 289/512: http.ResponseWriter, http.Flusher, http.Hijacker +type rw288 rwState + +func (w *rw288) Unwrap() http.ResponseWriter { return w.w } +func (w *rw288) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw288) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw288) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw288) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw288) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 290/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.StringWriter +type rw289 rwState + +func (w *rw289) Unwrap() http.ResponseWriter { return w.w } +func (w *rw289) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw289) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw289) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw289) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw289) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw289) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 291/512: http.ResponseWriter, http.Flusher, http.Hijacker, http.Pusher +type rw290 rwState + +func (w *rw290) Unwrap() http.ResponseWriter { return w.w } +func (w *rw290) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw290) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw290) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw290) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw290) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw290) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 292/512: http.ResponseWriter, http.Flusher, http.Hijacker, http.Pusher, io.StringWriter +type rw291 rwState + +func (w *rw291) Unwrap() http.ResponseWriter { return w.w } +func (w *rw291) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw291) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw291) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw291) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw291) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw291) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw291) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 293/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler +type rw292 rwState + +func (w *rw292) Unwrap() http.ResponseWriter { return w.w } +func (w *rw292) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw292) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw292) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw292) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw292) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw292) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 294/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw293 rwState + +func (w *rw293) Unwrap() http.ResponseWriter { return w.w } +func (w *rw293) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw293) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw293) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw293) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw293) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw293) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw293) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 295/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw294 rwState + +func (w *rw294) Unwrap() http.ResponseWriter { return w.w } +func (w *rw294) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw294) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw294) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw294) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw294) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw294) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw294) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 296/512: http.ResponseWriter, http.Flusher, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw295 rwState + +func (w *rw295) Unwrap() http.ResponseWriter { return w.w } +func (w *rw295) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw295) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw295) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw295) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw295) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw295) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw295) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw295) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 297/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner +type rw296 rwState + +func (w *rw296) Unwrap() http.ResponseWriter { return w.w } +func (w *rw296) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw296) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw296) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw296) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw296) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw296) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw296) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 298/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, io.StringWriter +type rw297 rwState + +func (w *rw297) Unwrap() http.ResponseWriter { return w.w } +func (w *rw297) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw297) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw297) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw297) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw297) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw297) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw297) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw297) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 299/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, http.Pusher +type rw298 rwState + +func (w *rw298) Unwrap() http.ResponseWriter { return w.w } +func (w *rw298) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw298) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw298) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw298) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw298) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw298) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw298) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw298) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 300/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw299 rwState + +func (w *rw299) Unwrap() http.ResponseWriter { return w.w } +func (w *rw299) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw299) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw299) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw299) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw299) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw299) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw299) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw299) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw299) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 301/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler +type rw300 rwState + +func (w *rw300) Unwrap() http.ResponseWriter { return w.w } +func (w *rw300) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw300) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw300) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw300) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw300) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw300) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw300) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw300) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 302/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw301 rwState + +func (w *rw301) Unwrap() http.ResponseWriter { return w.w } +func (w *rw301) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw301) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw301) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw301) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw301) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw301) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw301) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw301) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw301) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 303/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw302 rwState + +func (w *rw302) Unwrap() http.ResponseWriter { return w.w } +func (w *rw302) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw302) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw302) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw302) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw302) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw302) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw302) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw302) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw302) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 304/512: http.ResponseWriter, http.Flusher, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw303 rwState + +func (w *rw303) Unwrap() http.ResponseWriter { return w.w } +func (w *rw303) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw303) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw303) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw303) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw303) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw303) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw303) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw303) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw303) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw303) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 305/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom +type rw304 rwState + +func (w *rw304) Unwrap() http.ResponseWriter { return w.w } +func (w *rw304) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw304) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw304) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw304) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw304) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw304) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 306/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw305 rwState + +func (w *rw305) Unwrap() http.ResponseWriter { return w.w } +func (w *rw305) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw305) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw305) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw305) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw305) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw305) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw305) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 307/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, http.Pusher +type rw306 rwState + +func (w *rw306) Unwrap() http.ResponseWriter { return w.w } +func (w *rw306) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw306) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw306) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw306) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw306) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw306) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw306) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 308/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw307 rwState + +func (w *rw307) Unwrap() http.ResponseWriter { return w.w } +func (w *rw307) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw307) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw307) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw307) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw307) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw307) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw307) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw307) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 309/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw308 rwState + +func (w *rw308) Unwrap() http.ResponseWriter { return w.w } +func (w *rw308) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw308) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw308) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw308) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw308) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw308) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw308) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 310/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw309 rwState + +func (w *rw309) Unwrap() http.ResponseWriter { return w.w } +func (w *rw309) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw309) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw309) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw309) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw309) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw309) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw309) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw309) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 311/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw310 rwState + +func (w *rw310) Unwrap() http.ResponseWriter { return w.w } +func (w *rw310) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw310) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw310) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw310) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw310) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw310) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw310) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw310) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 312/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw311 rwState + +func (w *rw311) Unwrap() http.ResponseWriter { return w.w } +func (w *rw311) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw311) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw311) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw311) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw311) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw311) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw311) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw311) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw311) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 313/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner +type rw312 rwState + +func (w *rw312) Unwrap() http.ResponseWriter { return w.w } +func (w *rw312) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw312) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw312) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw312) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw312) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw312) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw312) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw312) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 314/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw313 rwState + +func (w *rw313) Unwrap() http.ResponseWriter { return w.w } +func (w *rw313) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw313) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw313) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw313) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw313) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw313) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw313) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw313) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw313) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 315/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw314 rwState + +func (w *rw314) Unwrap() http.ResponseWriter { return w.w } +func (w *rw314) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw314) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw314) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw314) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw314) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw314) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw314) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw314) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw314) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 316/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw315 rwState + +func (w *rw315) Unwrap() http.ResponseWriter { return w.w } +func (w *rw315) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw315) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw315) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw315) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw315) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw315) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw315) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw315) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw315) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw315) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 317/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw316 rwState + +func (w *rw316) Unwrap() http.ResponseWriter { return w.w } +func (w *rw316) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw316) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw316) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw316) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw316) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw316) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw316) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw316) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw316) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 318/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw317 rwState + +func (w *rw317) Unwrap() http.ResponseWriter { return w.w } +func (w *rw317) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw317) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw317) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw317) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw317) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw317) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw317) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw317) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw317) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw317) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 319/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw318 rwState + +func (w *rw318) Unwrap() http.ResponseWriter { return w.w } +func (w *rw318) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw318) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw318) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw318) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw318) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw318) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw318) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw318) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw318) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw318) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 320/512: http.ResponseWriter, http.Flusher, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw319 rwState + +func (w *rw319) Unwrap() http.ResponseWriter { return w.w } +func (w *rw319) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw319) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw319) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw319) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw319) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw319) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw319) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw319) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw319) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw319) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw319) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 321/512: http.ResponseWriter, http.Flusher, http.CloseNotifier +type rw320 rwState + +func (w *rw320) Unwrap() http.ResponseWriter { return w.w } +func (w *rw320) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw320) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw320) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw320) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw320) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 322/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.StringWriter +type rw321 rwState + +func (w *rw321) Unwrap() http.ResponseWriter { return w.w } +func (w *rw321) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw321) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw321) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw321) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw321) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw321) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 323/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Pusher +type rw322 rwState + +func (w *rw322) Unwrap() http.ResponseWriter { return w.w } +func (w *rw322) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw322) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw322) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw322) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw322) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw322) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 324/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Pusher, io.StringWriter +type rw323 rwState + +func (w *rw323) Unwrap() http.ResponseWriter { return w.w } +func (w *rw323) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw323) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw323) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw323) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw323) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw323) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw323) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 325/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler +type rw324 rwState + +func (w *rw324) Unwrap() http.ResponseWriter { return w.w } +func (w *rw324) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw324) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw324) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw324) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw324) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw324) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 326/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw325 rwState + +func (w *rw325) Unwrap() http.ResponseWriter { return w.w } +func (w *rw325) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw325) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw325) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw325) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw325) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw325) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw325) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 327/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw326 rwState + +func (w *rw326) Unwrap() http.ResponseWriter { return w.w } +func (w *rw326) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw326) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw326) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw326) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw326) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw326) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw326) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 328/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw327 rwState + +func (w *rw327) Unwrap() http.ResponseWriter { return w.w } +func (w *rw327) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw327) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw327) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw327) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw327) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw327) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw327) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw327) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 329/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner +type rw328 rwState + +func (w *rw328) Unwrap() http.ResponseWriter { return w.w } +func (w *rw328) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw328) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw328) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw328) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw328) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw328) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw328) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 330/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, io.StringWriter +type rw329 rwState + +func (w *rw329) Unwrap() http.ResponseWriter { return w.w } +func (w *rw329) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw329) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw329) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw329) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw329) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw329) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw329) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw329) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 331/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, http.Pusher +type rw330 rwState + +func (w *rw330) Unwrap() http.ResponseWriter { return w.w } +func (w *rw330) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw330) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw330) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw330) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw330) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw330) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw330) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw330) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 332/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw331 rwState + +func (w *rw331) Unwrap() http.ResponseWriter { return w.w } +func (w *rw331) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw331) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw331) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw331) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw331) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw331) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw331) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw331) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw331) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 333/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw332 rwState + +func (w *rw332) Unwrap() http.ResponseWriter { return w.w } +func (w *rw332) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw332) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw332) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw332) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw332) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw332) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw332) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw332) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 334/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw333 rwState + +func (w *rw333) Unwrap() http.ResponseWriter { return w.w } +func (w *rw333) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw333) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw333) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw333) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw333) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw333) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw333) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw333) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw333) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 335/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw334 rwState + +func (w *rw334) Unwrap() http.ResponseWriter { return w.w } +func (w *rw334) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw334) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw334) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw334) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw334) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw334) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw334) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw334) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw334) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 336/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw335 rwState + +func (w *rw335) Unwrap() http.ResponseWriter { return w.w } +func (w *rw335) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw335) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw335) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw335) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw335) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw335) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw335) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw335) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw335) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw335) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 337/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom +type rw336 rwState + +func (w *rw336) Unwrap() http.ResponseWriter { return w.w } +func (w *rw336) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw336) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw336) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw336) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw336) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw336) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 338/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw337 rwState + +func (w *rw337) Unwrap() http.ResponseWriter { return w.w } +func (w *rw337) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw337) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw337) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw337) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw337) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw337) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw337) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 339/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw338 rwState + +func (w *rw338) Unwrap() http.ResponseWriter { return w.w } +func (w *rw338) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw338) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw338) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw338) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw338) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw338) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw338) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 340/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw339 rwState + +func (w *rw339) Unwrap() http.ResponseWriter { return w.w } +func (w *rw339) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw339) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw339) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw339) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw339) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw339) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw339) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw339) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 341/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw340 rwState + +func (w *rw340) Unwrap() http.ResponseWriter { return w.w } +func (w *rw340) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw340) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw340) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw340) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw340) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw340) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw340) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 342/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw341 rwState + +func (w *rw341) Unwrap() http.ResponseWriter { return w.w } +func (w *rw341) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw341) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw341) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw341) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw341) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw341) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw341) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw341) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 343/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw342 rwState + +func (w *rw342) Unwrap() http.ResponseWriter { return w.w } +func (w *rw342) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw342) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw342) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw342) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw342) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw342) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw342) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw342) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 344/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw343 rwState + +func (w *rw343) Unwrap() http.ResponseWriter { return w.w } +func (w *rw343) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw343) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw343) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw343) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw343) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw343) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw343) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw343) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw343) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 345/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner +type rw344 rwState + +func (w *rw344) Unwrap() http.ResponseWriter { return w.w } +func (w *rw344) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw344) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw344) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw344) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw344) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw344) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw344) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw344) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 346/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw345 rwState + +func (w *rw345) Unwrap() http.ResponseWriter { return w.w } +func (w *rw345) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw345) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw345) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw345) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw345) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw345) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw345) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw345) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw345) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 347/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw346 rwState + +func (w *rw346) Unwrap() http.ResponseWriter { return w.w } +func (w *rw346) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw346) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw346) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw346) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw346) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw346) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw346) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw346) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw346) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 348/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw347 rwState + +func (w *rw347) Unwrap() http.ResponseWriter { return w.w } +func (w *rw347) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw347) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw347) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw347) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw347) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw347) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw347) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw347) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw347) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw347) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 349/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw348 rwState + +func (w *rw348) Unwrap() http.ResponseWriter { return w.w } +func (w *rw348) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw348) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw348) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw348) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw348) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw348) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw348) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw348) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw348) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 350/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw349 rwState + +func (w *rw349) Unwrap() http.ResponseWriter { return w.w } +func (w *rw349) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw349) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw349) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw349) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw349) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw349) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw349) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw349) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw349) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw349) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 351/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw350 rwState + +func (w *rw350) Unwrap() http.ResponseWriter { return w.w } +func (w *rw350) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw350) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw350) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw350) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw350) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw350) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw350) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw350) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw350) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw350) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 352/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw351 rwState + +func (w *rw351) Unwrap() http.ResponseWriter { return w.w } +func (w *rw351) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw351) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw351) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw351) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw351) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw351) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw351) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw351) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw351) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw351) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw351) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 353/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker +type rw352 rwState + +func (w *rw352) Unwrap() http.ResponseWriter { return w.w } +func (w *rw352) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw352) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw352) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw352) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw352) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw352) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 354/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw353 rwState + +func (w *rw353) Unwrap() http.ResponseWriter { return w.w } +func (w *rw353) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw353) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw353) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw353) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw353) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw353) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw353) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 355/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, http.Pusher +type rw354 rwState + +func (w *rw354) Unwrap() http.ResponseWriter { return w.w } +func (w *rw354) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw354) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw354) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw354) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw354) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw354) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw354) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 356/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw355 rwState + +func (w *rw355) Unwrap() http.ResponseWriter { return w.w } +func (w *rw355) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw355) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw355) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw355) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw355) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw355) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw355) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw355) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 357/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw356 rwState + +func (w *rw356) Unwrap() http.ResponseWriter { return w.w } +func (w *rw356) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw356) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw356) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw356) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw356) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw356) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw356) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 358/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw357 rwState + +func (w *rw357) Unwrap() http.ResponseWriter { return w.w } +func (w *rw357) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw357) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw357) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw357) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw357) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw357) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw357) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw357) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 359/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw358 rwState + +func (w *rw358) Unwrap() http.ResponseWriter { return w.w } +func (w *rw358) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw358) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw358) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw358) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw358) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw358) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw358) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw358) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 360/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw359 rwState + +func (w *rw359) Unwrap() http.ResponseWriter { return w.w } +func (w *rw359) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw359) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw359) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw359) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw359) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw359) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw359) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw359) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw359) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 361/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner +type rw360 rwState + +func (w *rw360) Unwrap() http.ResponseWriter { return w.w } +func (w *rw360) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw360) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw360) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw360) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw360) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw360) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw360) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw360) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 362/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw361 rwState + +func (w *rw361) Unwrap() http.ResponseWriter { return w.w } +func (w *rw361) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw361) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw361) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw361) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw361) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw361) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw361) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw361) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw361) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 363/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw362 rwState + +func (w *rw362) Unwrap() http.ResponseWriter { return w.w } +func (w *rw362) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw362) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw362) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw362) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw362) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw362) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw362) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw362) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw362) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 364/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw363 rwState + +func (w *rw363) Unwrap() http.ResponseWriter { return w.w } +func (w *rw363) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw363) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw363) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw363) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw363) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw363) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw363) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw363) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw363) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw363) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 365/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw364 rwState + +func (w *rw364) Unwrap() http.ResponseWriter { return w.w } +func (w *rw364) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw364) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw364) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw364) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw364) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw364) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw364) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw364) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw364) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 366/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw365 rwState + +func (w *rw365) Unwrap() http.ResponseWriter { return w.w } +func (w *rw365) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw365) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw365) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw365) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw365) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw365) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw365) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw365) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw365) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw365) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 367/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw366 rwState + +func (w *rw366) Unwrap() http.ResponseWriter { return w.w } +func (w *rw366) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw366) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw366) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw366) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw366) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw366) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw366) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw366) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw366) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw366) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 368/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw367 rwState + +func (w *rw367) Unwrap() http.ResponseWriter { return w.w } +func (w *rw367) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw367) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw367) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw367) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw367) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw367) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw367) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw367) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw367) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw367) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw367) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 369/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw368 rwState + +func (w *rw368) Unwrap() http.ResponseWriter { return w.w } +func (w *rw368) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw368) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw368) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw368) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw368) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw368) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw368) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 370/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw369 rwState + +func (w *rw369) Unwrap() http.ResponseWriter { return w.w } +func (w *rw369) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw369) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw369) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw369) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw369) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw369) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw369) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw369) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 371/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw370 rwState + +func (w *rw370) Unwrap() http.ResponseWriter { return w.w } +func (w *rw370) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw370) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw370) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw370) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw370) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw370) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw370) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw370) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 372/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw371 rwState + +func (w *rw371) Unwrap() http.ResponseWriter { return w.w } +func (w *rw371) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw371) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw371) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw371) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw371) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw371) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw371) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw371) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw371) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 373/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw372 rwState + +func (w *rw372) Unwrap() http.ResponseWriter { return w.w } +func (w *rw372) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw372) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw372) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw372) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw372) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw372) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw372) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw372) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 374/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw373 rwState + +func (w *rw373) Unwrap() http.ResponseWriter { return w.w } +func (w *rw373) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw373) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw373) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw373) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw373) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw373) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw373) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw373) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw373) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 375/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw374 rwState + +func (w *rw374) Unwrap() http.ResponseWriter { return w.w } +func (w *rw374) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw374) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw374) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw374) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw374) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw374) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw374) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw374) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw374) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 376/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw375 rwState + +func (w *rw375) Unwrap() http.ResponseWriter { return w.w } +func (w *rw375) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw375) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw375) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw375) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw375) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw375) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw375) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw375) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw375) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw375) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 377/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw376 rwState + +func (w *rw376) Unwrap() http.ResponseWriter { return w.w } +func (w *rw376) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw376) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw376) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw376) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw376) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw376) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw376) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw376) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw376) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 378/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw377 rwState + +func (w *rw377) Unwrap() http.ResponseWriter { return w.w } +func (w *rw377) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw377) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw377) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw377) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw377) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw377) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw377) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw377) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw377) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw377) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 379/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw378 rwState + +func (w *rw378) Unwrap() http.ResponseWriter { return w.w } +func (w *rw378) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw378) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw378) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw378) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw378) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw378) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw378) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw378) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw378) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw378) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 380/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw379 rwState + +func (w *rw379) Unwrap() http.ResponseWriter { return w.w } +func (w *rw379) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw379) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw379) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw379) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw379) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw379) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw379) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw379) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw379) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw379) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw379) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 381/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw380 rwState + +func (w *rw380) Unwrap() http.ResponseWriter { return w.w } +func (w *rw380) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw380) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw380) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw380) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw380) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw380) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw380) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw380) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw380) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw380) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 382/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw381 rwState + +func (w *rw381) Unwrap() http.ResponseWriter { return w.w } +func (w *rw381) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw381) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw381) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw381) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw381) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw381) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw381) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw381) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw381) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw381) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw381) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 383/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw382 rwState + +func (w *rw382) Unwrap() http.ResponseWriter { return w.w } +func (w *rw382) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw382) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw382) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw382) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw382) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw382) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw382) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw382) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw382) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw382) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw382) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 384/512: http.ResponseWriter, http.Flusher, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw383 rwState + +func (w *rw383) Unwrap() http.ResponseWriter { return w.w } +func (w *rw383) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw383) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw383) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw383) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw383) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw383) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw383) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw383) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw383) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw383) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw383) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw383) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 385/512: http.ResponseWriter, http.Flusher, httpFlushError +type rw384 rwState + +func (w *rw384) Unwrap() http.ResponseWriter { return w.w } +func (w *rw384) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw384) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw384) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw384) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw384) FlushError() error { + return (*rwState)(w).doFlushError() +} + +// combination 386/512: http.ResponseWriter, http.Flusher, httpFlushError, io.StringWriter +type rw385 rwState + +func (w *rw385) Unwrap() http.ResponseWriter { return w.w } +func (w *rw385) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw385) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw385) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw385) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw385) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw385) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 387/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Pusher +type rw386 rwState + +func (w *rw386) Unwrap() http.ResponseWriter { return w.w } +func (w *rw386) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw386) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw386) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw386) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw386) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw386) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 388/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Pusher, io.StringWriter +type rw387 rwState + +func (w *rw387) Unwrap() http.ResponseWriter { return w.w } +func (w *rw387) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw387) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw387) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw387) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw387) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw387) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw387) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 389/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler +type rw388 rwState + +func (w *rw388) Unwrap() http.ResponseWriter { return w.w } +func (w *rw388) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw388) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw388) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw388) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw388) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw388) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 390/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler, io.StringWriter +type rw389 rwState + +func (w *rw389) Unwrap() http.ResponseWriter { return w.w } +func (w *rw389) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw389) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw389) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw389) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw389) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw389) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw389) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 391/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler, http.Pusher +type rw390 rwState + +func (w *rw390) Unwrap() http.ResponseWriter { return w.w } +func (w *rw390) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw390) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw390) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw390) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw390) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw390) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw390) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 392/512: http.ResponseWriter, http.Flusher, httpFlushError, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw391 rwState + +func (w *rw391) Unwrap() http.ResponseWriter { return w.w } +func (w *rw391) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw391) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw391) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw391) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw391) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw391) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw391) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw391) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 393/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner +type rw392 rwState + +func (w *rw392) Unwrap() http.ResponseWriter { return w.w } +func (w *rw392) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw392) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw392) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw392) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw392) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw392) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw392) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 394/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, io.StringWriter +type rw393 rwState + +func (w *rw393) Unwrap() http.ResponseWriter { return w.w } +func (w *rw393) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw393) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw393) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw393) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw393) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw393) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw393) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw393) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 395/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, http.Pusher +type rw394 rwState + +func (w *rw394) Unwrap() http.ResponseWriter { return w.w } +func (w *rw394) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw394) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw394) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw394) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw394) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw394) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw394) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw394) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 396/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, http.Pusher, io.StringWriter +type rw395 rwState + +func (w *rw395) Unwrap() http.ResponseWriter { return w.w } +func (w *rw395) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw395) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw395) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw395) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw395) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw395) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw395) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw395) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw395) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 397/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler +type rw396 rwState + +func (w *rw396) Unwrap() http.ResponseWriter { return w.w } +func (w *rw396) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw396) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw396) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw396) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw396) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw396) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw396) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw396) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 398/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler, io.StringWriter +type rw397 rwState + +func (w *rw397) Unwrap() http.ResponseWriter { return w.w } +func (w *rw397) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw397) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw397) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw397) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw397) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw397) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw397) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw397) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw397) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 399/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher +type rw398 rwState + +func (w *rw398) Unwrap() http.ResponseWriter { return w.w } +func (w *rw398) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw398) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw398) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw398) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw398) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw398) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw398) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw398) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw398) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 400/512: http.ResponseWriter, http.Flusher, httpFlushError, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw399 rwState + +func (w *rw399) Unwrap() http.ResponseWriter { return w.w } +func (w *rw399) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw399) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw399) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw399) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw399) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw399) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw399) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw399) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw399) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw399) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 401/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom +type rw400 rwState + +func (w *rw400) Unwrap() http.ResponseWriter { return w.w } +func (w *rw400) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw400) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw400) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw400) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw400) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw400) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 402/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, io.StringWriter +type rw401 rwState + +func (w *rw401) Unwrap() http.ResponseWriter { return w.w } +func (w *rw401) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw401) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw401) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw401) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw401) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw401) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw401) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 403/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, http.Pusher +type rw402 rwState + +func (w *rw402) Unwrap() http.ResponseWriter { return w.w } +func (w *rw402) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw402) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw402) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw402) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw402) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw402) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw402) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 404/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, http.Pusher, io.StringWriter +type rw403 rwState + +func (w *rw403) Unwrap() http.ResponseWriter { return w.w } +func (w *rw403) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw403) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw403) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw403) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw403) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw403) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw403) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw403) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 405/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler +type rw404 rwState + +func (w *rw404) Unwrap() http.ResponseWriter { return w.w } +func (w *rw404) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw404) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw404) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw404) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw404) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw404) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw404) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 406/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw405 rwState + +func (w *rw405) Unwrap() http.ResponseWriter { return w.w } +func (w *rw405) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw405) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw405) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw405) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw405) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw405) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw405) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw405) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 407/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw406 rwState + +func (w *rw406) Unwrap() http.ResponseWriter { return w.w } +func (w *rw406) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw406) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw406) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw406) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw406) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw406) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw406) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw406) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 408/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw407 rwState + +func (w *rw407) Unwrap() http.ResponseWriter { return w.w } +func (w *rw407) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw407) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw407) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw407) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw407) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw407) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw407) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw407) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw407) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 409/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner +type rw408 rwState + +func (w *rw408) Unwrap() http.ResponseWriter { return w.w } +func (w *rw408) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw408) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw408) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw408) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw408) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw408) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw408) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw408) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 410/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, io.StringWriter +type rw409 rwState + +func (w *rw409) Unwrap() http.ResponseWriter { return w.w } +func (w *rw409) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw409) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw409) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw409) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw409) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw409) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw409) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw409) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw409) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 411/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, http.Pusher +type rw410 rwState + +func (w *rw410) Unwrap() http.ResponseWriter { return w.w } +func (w *rw410) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw410) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw410) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw410) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw410) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw410) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw410) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw410) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw410) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 412/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw411 rwState + +func (w *rw411) Unwrap() http.ResponseWriter { return w.w } +func (w *rw411) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw411) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw411) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw411) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw411) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw411) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw411) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw411) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw411) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw411) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 413/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw412 rwState + +func (w *rw412) Unwrap() http.ResponseWriter { return w.w } +func (w *rw412) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw412) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw412) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw412) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw412) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw412) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw412) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw412) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw412) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 414/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw413 rwState + +func (w *rw413) Unwrap() http.ResponseWriter { return w.w } +func (w *rw413) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw413) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw413) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw413) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw413) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw413) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw413) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw413) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw413) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw413) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 415/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw414 rwState + +func (w *rw414) Unwrap() http.ResponseWriter { return w.w } +func (w *rw414) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw414) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw414) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw414) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw414) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw414) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw414) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw414) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw414) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw414) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 416/512: http.ResponseWriter, http.Flusher, httpFlushError, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw415 rwState + +func (w *rw415) Unwrap() http.ResponseWriter { return w.w } +func (w *rw415) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw415) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw415) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw415) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw415) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw415) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw415) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw415) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw415) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw415) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw415) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 417/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker +type rw416 rwState + +func (w *rw416) Unwrap() http.ResponseWriter { return w.w } +func (w *rw416) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw416) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw416) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw416) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw416) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw416) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 418/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.StringWriter +type rw417 rwState + +func (w *rw417) Unwrap() http.ResponseWriter { return w.w } +func (w *rw417) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw417) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw417) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw417) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw417) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw417) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw417) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 419/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, http.Pusher +type rw418 rwState + +func (w *rw418) Unwrap() http.ResponseWriter { return w.w } +func (w *rw418) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw418) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw418) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw418) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw418) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw418) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw418) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 420/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, http.Pusher, io.StringWriter +type rw419 rwState + +func (w *rw419) Unwrap() http.ResponseWriter { return w.w } +func (w *rw419) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw419) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw419) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw419) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw419) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw419) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw419) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw419) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 421/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler +type rw420 rwState + +func (w *rw420) Unwrap() http.ResponseWriter { return w.w } +func (w *rw420) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw420) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw420) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw420) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw420) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw420) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw420) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 422/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw421 rwState + +func (w *rw421) Unwrap() http.ResponseWriter { return w.w } +func (w *rw421) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw421) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw421) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw421) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw421) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw421) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw421) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw421) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 423/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw422 rwState + +func (w *rw422) Unwrap() http.ResponseWriter { return w.w } +func (w *rw422) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw422) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw422) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw422) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw422) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw422) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw422) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw422) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 424/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw423 rwState + +func (w *rw423) Unwrap() http.ResponseWriter { return w.w } +func (w *rw423) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw423) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw423) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw423) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw423) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw423) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw423) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw423) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw423) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 425/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner +type rw424 rwState + +func (w *rw424) Unwrap() http.ResponseWriter { return w.w } +func (w *rw424) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw424) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw424) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw424) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw424) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw424) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw424) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw424) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 426/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, io.StringWriter +type rw425 rwState + +func (w *rw425) Unwrap() http.ResponseWriter { return w.w } +func (w *rw425) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw425) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw425) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw425) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw425) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw425) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw425) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw425) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw425) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 427/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, http.Pusher +type rw426 rwState + +func (w *rw426) Unwrap() http.ResponseWriter { return w.w } +func (w *rw426) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw426) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw426) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw426) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw426) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw426) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw426) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw426) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw426) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 428/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw427 rwState + +func (w *rw427) Unwrap() http.ResponseWriter { return w.w } +func (w *rw427) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw427) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw427) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw427) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw427) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw427) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw427) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw427) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw427) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw427) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 429/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler +type rw428 rwState + +func (w *rw428) Unwrap() http.ResponseWriter { return w.w } +func (w *rw428) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw428) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw428) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw428) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw428) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw428) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw428) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw428) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw428) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 430/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw429 rwState + +func (w *rw429) Unwrap() http.ResponseWriter { return w.w } +func (w *rw429) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw429) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw429) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw429) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw429) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw429) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw429) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw429) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw429) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw429) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 431/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw430 rwState + +func (w *rw430) Unwrap() http.ResponseWriter { return w.w } +func (w *rw430) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw430) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw430) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw430) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw430) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw430) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw430) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw430) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw430) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw430) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 432/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw431 rwState + +func (w *rw431) Unwrap() http.ResponseWriter { return w.w } +func (w *rw431) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw431) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw431) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw431) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw431) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw431) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw431) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw431) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw431) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw431) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw431) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 433/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom +type rw432 rwState + +func (w *rw432) Unwrap() http.ResponseWriter { return w.w } +func (w *rw432) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw432) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw432) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw432) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw432) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw432) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw432) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 434/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw433 rwState + +func (w *rw433) Unwrap() http.ResponseWriter { return w.w } +func (w *rw433) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw433) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw433) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw433) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw433) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw433) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw433) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw433) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 435/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher +type rw434 rwState + +func (w *rw434) Unwrap() http.ResponseWriter { return w.w } +func (w *rw434) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw434) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw434) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw434) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw434) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw434) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw434) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw434) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 436/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw435 rwState + +func (w *rw435) Unwrap() http.ResponseWriter { return w.w } +func (w *rw435) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw435) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw435) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw435) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw435) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw435) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw435) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw435) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw435) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 437/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw436 rwState + +func (w *rw436) Unwrap() http.ResponseWriter { return w.w } +func (w *rw436) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw436) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw436) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw436) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw436) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw436) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw436) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw436) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 438/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw437 rwState + +func (w *rw437) Unwrap() http.ResponseWriter { return w.w } +func (w *rw437) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw437) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw437) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw437) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw437) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw437) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw437) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw437) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw437) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 439/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw438 rwState + +func (w *rw438) Unwrap() http.ResponseWriter { return w.w } +func (w *rw438) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw438) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw438) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw438) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw438) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw438) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw438) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw438) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw438) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 440/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw439 rwState + +func (w *rw439) Unwrap() http.ResponseWriter { return w.w } +func (w *rw439) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw439) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw439) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw439) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw439) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw439) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw439) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw439) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw439) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw439) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 441/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner +type rw440 rwState + +func (w *rw440) Unwrap() http.ResponseWriter { return w.w } +func (w *rw440) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw440) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw440) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw440) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw440) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw440) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw440) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw440) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw440) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 442/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw441 rwState + +func (w *rw441) Unwrap() http.ResponseWriter { return w.w } +func (w *rw441) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw441) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw441) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw441) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw441) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw441) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw441) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw441) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw441) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw441) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 443/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw442 rwState + +func (w *rw442) Unwrap() http.ResponseWriter { return w.w } +func (w *rw442) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw442) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw442) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw442) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw442) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw442) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw442) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw442) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw442) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw442) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 444/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw443 rwState + +func (w *rw443) Unwrap() http.ResponseWriter { return w.w } +func (w *rw443) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw443) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw443) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw443) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw443) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw443) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw443) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw443) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw443) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw443) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw443) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 445/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw444 rwState + +func (w *rw444) Unwrap() http.ResponseWriter { return w.w } +func (w *rw444) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw444) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw444) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw444) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw444) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw444) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw444) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw444) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw444) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw444) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 446/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw445 rwState + +func (w *rw445) Unwrap() http.ResponseWriter { return w.w } +func (w *rw445) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw445) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw445) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw445) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw445) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw445) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw445) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw445) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw445) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw445) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw445) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 447/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw446 rwState + +func (w *rw446) Unwrap() http.ResponseWriter { return w.w } +func (w *rw446) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw446) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw446) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw446) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw446) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw446) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw446) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw446) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw446) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw446) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw446) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 448/512: http.ResponseWriter, http.Flusher, httpFlushError, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw447 rwState + +func (w *rw447) Unwrap() http.ResponseWriter { return w.w } +func (w *rw447) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw447) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw447) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw447) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw447) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw447) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw447) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw447) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw447) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw447) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw447) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw447) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 449/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier +type rw448 rwState + +func (w *rw448) Unwrap() http.ResponseWriter { return w.w } +func (w *rw448) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw448) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw448) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw448) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw448) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw448) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} + +// combination 450/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.StringWriter +type rw449 rwState + +func (w *rw449) Unwrap() http.ResponseWriter { return w.w } +func (w *rw449) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw449) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw449) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw449) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw449) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw449) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw449) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 451/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Pusher +type rw450 rwState + +func (w *rw450) Unwrap() http.ResponseWriter { return w.w } +func (w *rw450) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw450) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw450) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw450) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw450) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw450) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw450) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 452/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Pusher, io.StringWriter +type rw451 rwState + +func (w *rw451) Unwrap() http.ResponseWriter { return w.w } +func (w *rw451) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw451) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw451) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw451) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw451) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw451) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw451) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw451) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 453/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler +type rw452 rwState + +func (w *rw452) Unwrap() http.ResponseWriter { return w.w } +func (w *rw452) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw452) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw452) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw452) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw452) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw452) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw452) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 454/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler, io.StringWriter +type rw453 rwState + +func (w *rw453) Unwrap() http.ResponseWriter { return w.w } +func (w *rw453) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw453) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw453) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw453) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw453) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw453) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw453) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw453) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 455/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher +type rw454 rwState + +func (w *rw454) Unwrap() http.ResponseWriter { return w.w } +func (w *rw454) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw454) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw454) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw454) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw454) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw454) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw454) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw454) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 456/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw455 rwState + +func (w *rw455) Unwrap() http.ResponseWriter { return w.w } +func (w *rw455) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw455) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw455) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw455) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw455) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw455) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw455) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw455) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw455) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 457/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner +type rw456 rwState + +func (w *rw456) Unwrap() http.ResponseWriter { return w.w } +func (w *rw456) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw456) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw456) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw456) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw456) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw456) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw456) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw456) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 458/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, io.StringWriter +type rw457 rwState + +func (w *rw457) Unwrap() http.ResponseWriter { return w.w } +func (w *rw457) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw457) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw457) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw457) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw457) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw457) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw457) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw457) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw457) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 459/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, http.Pusher +type rw458 rwState + +func (w *rw458) Unwrap() http.ResponseWriter { return w.w } +func (w *rw458) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw458) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw458) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw458) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw458) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw458) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw458) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw458) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw458) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 460/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, http.Pusher, io.StringWriter +type rw459 rwState + +func (w *rw459) Unwrap() http.ResponseWriter { return w.w } +func (w *rw459) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw459) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw459) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw459) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw459) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw459) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw459) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw459) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw459) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw459) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 461/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler +type rw460 rwState + +func (w *rw460) Unwrap() http.ResponseWriter { return w.w } +func (w *rw460) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw460) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw460) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw460) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw460) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw460) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw460) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw460) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw460) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 462/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, io.StringWriter +type rw461 rwState + +func (w *rw461) Unwrap() http.ResponseWriter { return w.w } +func (w *rw461) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw461) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw461) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw461) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw461) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw461) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw461) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw461) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw461) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw461) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 463/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher +type rw462 rwState + +func (w *rw462) Unwrap() http.ResponseWriter { return w.w } +func (w *rw462) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw462) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw462) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw462) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw462) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw462) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw462) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw462) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw462) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw462) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 464/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw463 rwState + +func (w *rw463) Unwrap() http.ResponseWriter { return w.w } +func (w *rw463) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw463) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw463) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw463) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw463) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw463) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw463) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw463) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw463) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw463) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw463) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 465/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom +type rw464 rwState + +func (w *rw464) Unwrap() http.ResponseWriter { return w.w } +func (w *rw464) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw464) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw464) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw464) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw464) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw464) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw464) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 466/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, io.StringWriter +type rw465 rwState + +func (w *rw465) Unwrap() http.ResponseWriter { return w.w } +func (w *rw465) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw465) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw465) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw465) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw465) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw465) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw465) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw465) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 467/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher +type rw466 rwState + +func (w *rw466) Unwrap() http.ResponseWriter { return w.w } +func (w *rw466) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw466) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw466) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw466) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw466) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw466) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw466) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw466) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 468/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, http.Pusher, io.StringWriter +type rw467 rwState + +func (w *rw467) Unwrap() http.ResponseWriter { return w.w } +func (w *rw467) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw467) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw467) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw467) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw467) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw467) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw467) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw467) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw467) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 469/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler +type rw468 rwState + +func (w *rw468) Unwrap() http.ResponseWriter { return w.w } +func (w *rw468) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw468) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw468) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw468) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw468) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw468) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw468) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw468) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 470/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw469 rwState + +func (w *rw469) Unwrap() http.ResponseWriter { return w.w } +func (w *rw469) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw469) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw469) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw469) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw469) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw469) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw469) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw469) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw469) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 471/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw470 rwState + +func (w *rw470) Unwrap() http.ResponseWriter { return w.w } +func (w *rw470) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw470) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw470) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw470) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw470) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw470) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw470) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw470) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw470) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 472/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw471 rwState + +func (w *rw471) Unwrap() http.ResponseWriter { return w.w } +func (w *rw471) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw471) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw471) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw471) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw471) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw471) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw471) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw471) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw471) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw471) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 473/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner +type rw472 rwState + +func (w *rw472) Unwrap() http.ResponseWriter { return w.w } +func (w *rw472) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw472) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw472) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw472) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw472) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw472) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw472) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw472) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw472) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 474/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, io.StringWriter +type rw473 rwState + +func (w *rw473) Unwrap() http.ResponseWriter { return w.w } +func (w *rw473) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw473) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw473) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw473) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw473) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw473) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw473) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw473) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw473) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw473) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 475/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher +type rw474 rwState + +func (w *rw474) Unwrap() http.ResponseWriter { return w.w } +func (w *rw474) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw474) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw474) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw474) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw474) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw474) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw474) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw474) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw474) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw474) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 476/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw475 rwState + +func (w *rw475) Unwrap() http.ResponseWriter { return w.w } +func (w *rw475) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw475) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw475) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw475) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw475) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw475) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw475) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw475) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw475) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw475) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw475) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 477/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw476 rwState + +func (w *rw476) Unwrap() http.ResponseWriter { return w.w } +func (w *rw476) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw476) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw476) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw476) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw476) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw476) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw476) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw476) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw476) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw476) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 478/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw477 rwState + +func (w *rw477) Unwrap() http.ResponseWriter { return w.w } +func (w *rw477) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw477) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw477) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw477) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw477) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw477) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw477) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw477) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw477) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw477) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw477) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 479/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw478 rwState + +func (w *rw478) Unwrap() http.ResponseWriter { return w.w } +func (w *rw478) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw478) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw478) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw478) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw478) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw478) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw478) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw478) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw478) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw478) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw478) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 480/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw479 rwState + +func (w *rw479) Unwrap() http.ResponseWriter { return w.w } +func (w *rw479) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw479) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw479) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw479) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw479) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw479) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw479) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw479) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw479) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw479) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw479) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw479) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 481/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker +type rw480 rwState + +func (w *rw480) Unwrap() http.ResponseWriter { return w.w } +func (w *rw480) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw480) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw480) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw480) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw480) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw480) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw480) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} + +// combination 482/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.StringWriter +type rw481 rwState + +func (w *rw481) Unwrap() http.ResponseWriter { return w.w } +func (w *rw481) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw481) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw481) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw481) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw481) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw481) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw481) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw481) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 483/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher +type rw482 rwState + +func (w *rw482) Unwrap() http.ResponseWriter { return w.w } +func (w *rw482) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw482) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw482) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw482) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw482) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw482) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw482) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw482) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 484/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, http.Pusher, io.StringWriter +type rw483 rwState + +func (w *rw483) Unwrap() http.ResponseWriter { return w.w } +func (w *rw483) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw483) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw483) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw483) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw483) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw483) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw483) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw483) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw483) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 485/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler +type rw484 rwState + +func (w *rw484) Unwrap() http.ResponseWriter { return w.w } +func (w *rw484) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw484) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw484) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw484) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw484) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw484) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw484) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw484) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 486/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, io.StringWriter +type rw485 rwState + +func (w *rw485) Unwrap() http.ResponseWriter { return w.w } +func (w *rw485) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw485) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw485) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw485) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw485) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw485) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw485) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw485) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw485) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 487/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher +type rw486 rwState + +func (w *rw486) Unwrap() http.ResponseWriter { return w.w } +func (w *rw486) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw486) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw486) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw486) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw486) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw486) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw486) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw486) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw486) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 488/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw487 rwState + +func (w *rw487) Unwrap() http.ResponseWriter { return w.w } +func (w *rw487) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw487) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw487) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw487) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw487) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw487) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw487) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw487) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw487) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw487) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 489/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner +type rw488 rwState + +func (w *rw488) Unwrap() http.ResponseWriter { return w.w } +func (w *rw488) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw488) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw488) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw488) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw488) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw488) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw488) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw488) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw488) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 490/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, io.StringWriter +type rw489 rwState + +func (w *rw489) Unwrap() http.ResponseWriter { return w.w } +func (w *rw489) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw489) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw489) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw489) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw489) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw489) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw489) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw489) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw489) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw489) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 491/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher +type rw490 rwState + +func (w *rw490) Unwrap() http.ResponseWriter { return w.w } +func (w *rw490) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw490) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw490) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw490) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw490) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw490) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw490) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw490) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw490) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw490) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 492/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, http.Pusher, io.StringWriter +type rw491 rwState + +func (w *rw491) Unwrap() http.ResponseWriter { return w.w } +func (w *rw491) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw491) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw491) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw491) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw491) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw491) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw491) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw491) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw491) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw491) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw491) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 493/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler +type rw492 rwState + +func (w *rw492) Unwrap() http.ResponseWriter { return w.w } +func (w *rw492) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw492) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw492) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw492) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw492) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw492) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw492) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw492) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw492) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw492) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 494/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, io.StringWriter +type rw493 rwState + +func (w *rw493) Unwrap() http.ResponseWriter { return w.w } +func (w *rw493) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw493) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw493) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw493) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw493) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw493) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw493) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw493) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw493) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw493) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw493) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 495/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher +type rw494 rwState + +func (w *rw494) Unwrap() http.ResponseWriter { return w.w } +func (w *rw494) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw494) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw494) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw494) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw494) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw494) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw494) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw494) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw494) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw494) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw494) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 496/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw495 rwState + +func (w *rw495) Unwrap() http.ResponseWriter { return w.w } +func (w *rw495) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw495) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw495) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw495) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw495) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw495) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw495) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw495) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw495) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw495) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw495) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw495) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 497/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom +type rw496 rwState + +func (w *rw496) Unwrap() http.ResponseWriter { return w.w } +func (w *rw496) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw496) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw496) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw496) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw496) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw496) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw496) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw496) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} + +// combination 498/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, io.StringWriter +type rw497 rwState + +func (w *rw497) Unwrap() http.ResponseWriter { return w.w } +func (w *rw497) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw497) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw497) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw497) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw497) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw497) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw497) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw497) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw497) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 499/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher +type rw498 rwState + +func (w *rw498) Unwrap() http.ResponseWriter { return w.w } +func (w *rw498) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw498) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw498) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw498) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw498) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw498) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw498) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw498) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw498) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 500/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, http.Pusher, io.StringWriter +type rw499 rwState + +func (w *rw499) Unwrap() http.ResponseWriter { return w.w } +func (w *rw499) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw499) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw499) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw499) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw499) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw499) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw499) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw499) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw499) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw499) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 501/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler +type rw500 rwState + +func (w *rw500) Unwrap() http.ResponseWriter { return w.w } +func (w *rw500) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw500) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw500) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw500) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw500) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw500) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw500) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw500) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw500) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 502/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, io.StringWriter +type rw501 rwState + +func (w *rw501) Unwrap() http.ResponseWriter { return w.w } +func (w *rw501) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw501) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw501) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw501) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw501) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw501) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw501) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw501) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw501) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw501) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 503/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher +type rw502 rwState + +func (w *rw502) Unwrap() http.ResponseWriter { return w.w } +func (w *rw502) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw502) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw502) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw502) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw502) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw502) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw502) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw502) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw502) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw502) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 504/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw503 rwState + +func (w *rw503) Unwrap() http.ResponseWriter { return w.w } +func (w *rw503) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw503) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw503) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw503) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw503) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw503) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw503) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw503) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw503) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw503) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw503) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 505/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner +type rw504 rwState + +func (w *rw504) Unwrap() http.ResponseWriter { return w.w } +func (w *rw504) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw504) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw504) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw504) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw504) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw504) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw504) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw504) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw504) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw504) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} + +// combination 506/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, io.StringWriter +type rw505 rwState + +func (w *rw505) Unwrap() http.ResponseWriter { return w.w } +func (w *rw505) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw505) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw505) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw505) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw505) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw505) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw505) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw505) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw505) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw505) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw505) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 507/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher +type rw506 rwState + +func (w *rw506) Unwrap() http.ResponseWriter { return w.w } +func (w *rw506) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw506) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw506) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw506) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw506) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw506) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw506) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw506) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw506) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw506) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw506) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 508/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, http.Pusher, io.StringWriter +type rw507 rwState + +func (w *rw507) Unwrap() http.ResponseWriter { return w.w } +func (w *rw507) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw507) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw507) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw507) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw507) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw507) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw507) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw507) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw507) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw507) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw507) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw507) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 509/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler +type rw508 rwState + +func (w *rw508) Unwrap() http.ResponseWriter { return w.w } +func (w *rw508) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw508) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw508) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw508) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw508) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw508) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw508) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw508) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw508) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw508) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw508) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} + +// combination 510/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, io.StringWriter +type rw509 rwState + +func (w *rw509) Unwrap() http.ResponseWriter { return w.w } +func (w *rw509) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw509) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw509) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw509) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw509) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw509) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw509) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw509) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw509) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw509) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw509) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw509) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +// combination 511/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher +type rw510 rwState + +func (w *rw510) Unwrap() http.ResponseWriter { return w.w } +func (w *rw510) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw510) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw510) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw510) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw510) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw510) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw510) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw510) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw510) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw510) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw510) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw510) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} + +// combination 512/512: http.ResponseWriter, http.Flusher, httpFlushError, http.CloseNotifier, http.Hijacker, io.ReaderFrom, deadliner, fullDuplexEnabler, http.Pusher, io.StringWriter +type rw511 rwState + +func (w *rw511) Unwrap() http.ResponseWriter { return w.w } +func (w *rw511) Header() http.Header { + return (*rwState)(w).doHeader() +} +func (w *rw511) WriteHeader(code int) { + (*rwState)(w).doWriteHeader(code) +} +func (w *rw511) Write(b []byte) (int, error) { + return (*rwState)(w).doWrite(b) +} +func (w *rw511) Flush() { + (*rwState)(w).doFlush() +} +func (w *rw511) FlushError() error { + return (*rwState)(w).doFlushError() +} +func (w *rw511) CloseNotify() <-chan bool { + return (*rwState)(w).doCloseNotify() +} +func (w *rw511) Hijack() (net.Conn, *bufio.ReadWriter, error) { + return (*rwState)(w).doHijack() +} +func (w *rw511) ReadFrom(src io.Reader) (int64, error) { + return (*rwState)(w).doReadFrom(src) +} +func (w *rw511) SetReadDeadline(deadline time.Time) error { + return (*rwState)(w).doSetReadDeadline(deadline) +} +func (w *rw511) SetWriteDeadline(deadline time.Time) error { + return (*rwState)(w).doSetWriteDeadline(deadline) +} +func (w *rw511) EnableFullDuplex() error { + return (*rwState)(w).doEnableFullDuplex() +} +func (w *rw511) Push(target string, opts *http.PushOptions) error { + return (*rwState)(w).doPush(target, opts) +} +func (w *rw511) WriteString(s string) (int, error) { + return (*rwState)(w).doWriteString(s) +} + +type Unwrapper interface { + Unwrap() http.ResponseWriter +} + +// Unwrap returns the underlying http.ResponseWriter from within zero or more +// layers of httpsnoop wrappers. +func Unwrap(w http.ResponseWriter) http.ResponseWriter { + if rw, ok := w.(Unwrapper); ok { + // recurse until rw.Unwrap() returns a non-Unwrapper + return Unwrap(rw.Unwrap()) + } + return w +} diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go deleted file mode 100644 index 101cedd..0000000 --- a/vendor/github.com/felixge/httpsnoop/wrap_generated_gteq_1.8.go +++ /dev/null @@ -1,436 +0,0 @@ -// +build go1.8 -// Code generated by "httpsnoop/codegen"; DO NOT EDIT. - -package httpsnoop - -import ( - "bufio" - "io" - "net" - "net/http" -) - -// HeaderFunc is part of the http.ResponseWriter interface. -type HeaderFunc func() http.Header - -// WriteHeaderFunc is part of the http.ResponseWriter interface. -type WriteHeaderFunc func(code int) - -// WriteFunc is part of the http.ResponseWriter interface. -type WriteFunc func(b []byte) (int, error) - -// FlushFunc is part of the http.Flusher interface. -type FlushFunc func() - -// CloseNotifyFunc is part of the http.CloseNotifier interface. -type CloseNotifyFunc func() <-chan bool - -// HijackFunc is part of the http.Hijacker interface. -type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) - -// ReadFromFunc is part of the io.ReaderFrom interface. -type ReadFromFunc func(src io.Reader) (int64, error) - -// PushFunc is part of the http.Pusher interface. -type PushFunc func(target string, opts *http.PushOptions) error - -// Hooks defines a set of method interceptors for methods included in -// http.ResponseWriter as well as some others. You can think of them as -// middleware for the function calls they target. See Wrap for more details. -type Hooks struct { - Header func(HeaderFunc) HeaderFunc - WriteHeader func(WriteHeaderFunc) WriteHeaderFunc - Write func(WriteFunc) WriteFunc - Flush func(FlushFunc) FlushFunc - CloseNotify func(CloseNotifyFunc) CloseNotifyFunc - Hijack func(HijackFunc) HijackFunc - ReadFrom func(ReadFromFunc) ReadFromFunc - Push func(PushFunc) PushFunc -} - -// Wrap returns a wrapped version of w that provides the exact same interface -// as w. Specifically if w implements any combination of: -// -// - http.Flusher -// - http.CloseNotifier -// - http.Hijacker -// - io.ReaderFrom -// - http.Pusher -// -// The wrapped version will implement the exact same combination. If no hooks -// are set, the wrapped version also behaves exactly as w. Hooks targeting -// methods not supported by w are ignored. Any other hooks will intercept the -// method they target and may modify the call's arguments and/or return values. -// The CaptureMetrics implementation serves as a working example for how the -// hooks can be used. -func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { - rw := &rw{w: w, h: hooks} - _, i0 := w.(http.Flusher) - _, i1 := w.(http.CloseNotifier) - _, i2 := w.(http.Hijacker) - _, i3 := w.(io.ReaderFrom) - _, i4 := w.(http.Pusher) - switch { - // combination 1/32 - case !i0 && !i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - }{rw, rw} - // combination 2/32 - case !i0 && !i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Pusher - }{rw, rw, rw} - // combination 3/32 - case !i0 && !i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - }{rw, rw, rw} - // combination 4/32 - case !i0 && !i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw} - // combination 5/32 - case !i0 && !i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - }{rw, rw, rw} - // combination 6/32 - case !i0 && !i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - http.Pusher - }{rw, rw, rw, rw} - // combination 7/32 - case !i0 && !i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 8/32 - case !i0 && !i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 9/32 - case !i0 && i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - }{rw, rw, rw} - // combination 10/32 - case !i0 && i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Pusher - }{rw, rw, rw, rw} - // combination 11/32 - case !i0 && i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 12/32 - case !i0 && i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 13/32 - case !i0 && i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw} - // combination 14/32 - case !i0 && i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 15/32 - case !i0 && i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 16/32 - case !i0 && i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 17/32 - case i0 && !i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - }{rw, rw, rw} - // combination 18/32 - case i0 && !i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Pusher - }{rw, rw, rw, rw} - // combination 19/32 - case i0 && !i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 20/32 - case i0 && !i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 21/32 - case i0 && !i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - }{rw, rw, rw, rw} - // combination 22/32 - case i0 && !i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 23/32 - case i0 && !i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 24/32 - case i0 && !i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 25/32 - case i0 && i1 && !i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - }{rw, rw, rw, rw} - // combination 26/32 - case i0 && i1 && !i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Pusher - }{rw, rw, rw, rw, rw} - // combination 27/32 - case i0 && i1 && !i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 28/32 - case i0 && i1 && !i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 29/32 - case i0 && i1 && i2 && !i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw, rw} - // combination 30/32 - case i0 && i1 && i2 && !i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - http.Pusher - }{rw, rw, rw, rw, rw, rw} - // combination 31/32 - case i0 && i1 && i2 && i3 && !i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw, rw} - // combination 32/32 - case i0 && i1 && i2 && i3 && i4: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - http.Pusher - }{rw, rw, rw, rw, rw, rw, rw} - } - panic("unreachable") -} - -type rw struct { - w http.ResponseWriter - h Hooks -} - -func (w *rw) Unwrap() http.ResponseWriter { - return w.w -} - -func (w *rw) Header() http.Header { - f := w.w.(http.ResponseWriter).Header - if w.h.Header != nil { - f = w.h.Header(f) - } - return f() -} - -func (w *rw) WriteHeader(code int) { - f := w.w.(http.ResponseWriter).WriteHeader - if w.h.WriteHeader != nil { - f = w.h.WriteHeader(f) - } - f(code) -} - -func (w *rw) Write(b []byte) (int, error) { - f := w.w.(http.ResponseWriter).Write - if w.h.Write != nil { - f = w.h.Write(f) - } - return f(b) -} - -func (w *rw) Flush() { - f := w.w.(http.Flusher).Flush - if w.h.Flush != nil { - f = w.h.Flush(f) - } - f() -} - -func (w *rw) CloseNotify() <-chan bool { - f := w.w.(http.CloseNotifier).CloseNotify - if w.h.CloseNotify != nil { - f = w.h.CloseNotify(f) - } - return f() -} - -func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { - f := w.w.(http.Hijacker).Hijack - if w.h.Hijack != nil { - f = w.h.Hijack(f) - } - return f() -} - -func (w *rw) ReadFrom(src io.Reader) (int64, error) { - f := w.w.(io.ReaderFrom).ReadFrom - if w.h.ReadFrom != nil { - f = w.h.ReadFrom(f) - } - return f(src) -} - -func (w *rw) Push(target string, opts *http.PushOptions) error { - f := w.w.(http.Pusher).Push - if w.h.Push != nil { - f = w.h.Push(f) - } - return f(target, opts) -} - -type Unwrapper interface { - Unwrap() http.ResponseWriter -} - -// Unwrap returns the underlying http.ResponseWriter from within zero or more -// layers of httpsnoop wrappers. -func Unwrap(w http.ResponseWriter) http.ResponseWriter { - if rw, ok := w.(Unwrapper); ok { - // recurse until rw.Unwrap() returns a non-Unwrapper - return Unwrap(rw.Unwrap()) - } else { - return w - } -} diff --git a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go b/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go deleted file mode 100644 index e0951df..0000000 --- a/vendor/github.com/felixge/httpsnoop/wrap_generated_lt_1.8.go +++ /dev/null @@ -1,278 +0,0 @@ -// +build !go1.8 -// Code generated by "httpsnoop/codegen"; DO NOT EDIT. - -package httpsnoop - -import ( - "bufio" - "io" - "net" - "net/http" -) - -// HeaderFunc is part of the http.ResponseWriter interface. -type HeaderFunc func() http.Header - -// WriteHeaderFunc is part of the http.ResponseWriter interface. -type WriteHeaderFunc func(code int) - -// WriteFunc is part of the http.ResponseWriter interface. -type WriteFunc func(b []byte) (int, error) - -// FlushFunc is part of the http.Flusher interface. -type FlushFunc func() - -// CloseNotifyFunc is part of the http.CloseNotifier interface. -type CloseNotifyFunc func() <-chan bool - -// HijackFunc is part of the http.Hijacker interface. -type HijackFunc func() (net.Conn, *bufio.ReadWriter, error) - -// ReadFromFunc is part of the io.ReaderFrom interface. -type ReadFromFunc func(src io.Reader) (int64, error) - -// Hooks defines a set of method interceptors for methods included in -// http.ResponseWriter as well as some others. You can think of them as -// middleware for the function calls they target. See Wrap for more details. -type Hooks struct { - Header func(HeaderFunc) HeaderFunc - WriteHeader func(WriteHeaderFunc) WriteHeaderFunc - Write func(WriteFunc) WriteFunc - Flush func(FlushFunc) FlushFunc - CloseNotify func(CloseNotifyFunc) CloseNotifyFunc - Hijack func(HijackFunc) HijackFunc - ReadFrom func(ReadFromFunc) ReadFromFunc -} - -// Wrap returns a wrapped version of w that provides the exact same interface -// as w. Specifically if w implements any combination of: -// -// - http.Flusher -// - http.CloseNotifier -// - http.Hijacker -// - io.ReaderFrom -// -// The wrapped version will implement the exact same combination. If no hooks -// are set, the wrapped version also behaves exactly as w. Hooks targeting -// methods not supported by w are ignored. Any other hooks will intercept the -// method they target and may modify the call's arguments and/or return values. -// The CaptureMetrics implementation serves as a working example for how the -// hooks can be used. -func Wrap(w http.ResponseWriter, hooks Hooks) http.ResponseWriter { - rw := &rw{w: w, h: hooks} - _, i0 := w.(http.Flusher) - _, i1 := w.(http.CloseNotifier) - _, i2 := w.(http.Hijacker) - _, i3 := w.(io.ReaderFrom) - switch { - // combination 1/16 - case !i0 && !i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - }{rw, rw} - // combination 2/16 - case !i0 && !i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - io.ReaderFrom - }{rw, rw, rw} - // combination 3/16 - case !i0 && !i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - }{rw, rw, rw} - // combination 4/16 - case !i0 && !i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 5/16 - case !i0 && i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - }{rw, rw, rw} - // combination 6/16 - case !i0 && i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 7/16 - case !i0 && i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw} - // combination 8/16 - case !i0 && i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 9/16 - case i0 && !i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - }{rw, rw, rw} - // combination 10/16 - case i0 && !i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - io.ReaderFrom - }{rw, rw, rw, rw} - // combination 11/16 - case i0 && !i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - }{rw, rw, rw, rw} - // combination 12/16 - case i0 && !i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 13/16 - case i0 && i1 && !i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - }{rw, rw, rw, rw} - // combination 14/16 - case i0 && i1 && !i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - io.ReaderFrom - }{rw, rw, rw, rw, rw} - // combination 15/16 - case i0 && i1 && i2 && !i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - }{rw, rw, rw, rw, rw} - // combination 16/16 - case i0 && i1 && i2 && i3: - return struct { - Unwrapper - http.ResponseWriter - http.Flusher - http.CloseNotifier - http.Hijacker - io.ReaderFrom - }{rw, rw, rw, rw, rw, rw} - } - panic("unreachable") -} - -type rw struct { - w http.ResponseWriter - h Hooks -} - -func (w *rw) Unwrap() http.ResponseWriter { - return w.w -} - -func (w *rw) Header() http.Header { - f := w.w.(http.ResponseWriter).Header - if w.h.Header != nil { - f = w.h.Header(f) - } - return f() -} - -func (w *rw) WriteHeader(code int) { - f := w.w.(http.ResponseWriter).WriteHeader - if w.h.WriteHeader != nil { - f = w.h.WriteHeader(f) - } - f(code) -} - -func (w *rw) Write(b []byte) (int, error) { - f := w.w.(http.ResponseWriter).Write - if w.h.Write != nil { - f = w.h.Write(f) - } - return f(b) -} - -func (w *rw) Flush() { - f := w.w.(http.Flusher).Flush - if w.h.Flush != nil { - f = w.h.Flush(f) - } - f() -} - -func (w *rw) CloseNotify() <-chan bool { - f := w.w.(http.CloseNotifier).CloseNotify - if w.h.CloseNotify != nil { - f = w.h.CloseNotify(f) - } - return f() -} - -func (w *rw) Hijack() (net.Conn, *bufio.ReadWriter, error) { - f := w.w.(http.Hijacker).Hijack - if w.h.Hijack != nil { - f = w.h.Hijack(f) - } - return f() -} - -func (w *rw) ReadFrom(src io.Reader) (int64, error) { - f := w.w.(io.ReaderFrom).ReadFrom - if w.h.ReadFrom != nil { - f = w.h.ReadFrom(f) - } - return f(src) -} - -type Unwrapper interface { - Unwrap() http.ResponseWriter -} - -// Unwrap returns the underlying http.ResponseWriter from within zero or more -// layers of httpsnoop wrappers. -func Unwrap(w http.ResponseWriter) http.ResponseWriter { - if rw, ok := w.(Unwrapper); ok { - // recurse until rw.Unwrap() returns a non-Unwrapper - return Unwrap(rw.Unwrap()) - } else { - return w - } -} diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go index 41edab0..5f29c11 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -47,9 +47,10 @@ func IsTerminal(fd uintptr) bool { // Check pipe name is used for cygwin/msys2 pty. // Cygwin/MSYS2 PTY has a name like: // \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master +// On Windows 7 a trailing suffix (e.g. "-nat") may be appended. func isCygwinPipeName(name string) bool { token := strings.Split(name, "-") - if len(token) != 5 { + if len(token) < 5 { return false } @@ -76,6 +77,12 @@ func isCygwinPipeName(name string) bool { return false } + for _, t := range token[5:] { + if t == "" { + return false + } + } + return true } diff --git a/vendor/github.com/minio/sio/sio.go b/vendor/github.com/minio/sio/sio.go index 8f379dd..6c3fe98 100644 --- a/vendor/github.com/minio/sio/sio.go +++ b/vendor/github.com/minio/sio/sio.go @@ -21,11 +21,13 @@ import ( "crypto/aes" "crypto/cipher" "crypto/rand" + "encoding/binary" "errors" "fmt" "io" "runtime" + "golang.org/x/crypto/chacha20" "golang.org/x/crypto/chacha20poly1305" "golang.org/x/sys/cpu" ) @@ -38,8 +40,8 @@ const ( ) const ( - // AES_256_GCM specifies the cipher suite AES-GCM with 256 bit keys. - AES_256_GCM byte = iota + // AES_GCM specifies the cipher suite AES-GCM with 128 or 256 bit keys. + AES_GCM byte = iota // CHACHA20_POLY1305 specifies the cipher suite ChaCha20Poly1305 with 256 bit keys. CHACHA20_POLY1305 ) @@ -66,8 +68,6 @@ func detectAESSupport() bool { } const ( - keySize = 32 - headerSize = 16 maxPayloadSize = 1 << 16 tagSize = 16 @@ -77,17 +77,56 @@ const ( maxEncryptedSize = maxDecryptedSize + ((headerSize + tagSize) * 1 << 32) ) -var newAesGcm = func(key []byte) (cipher.AEAD, error) { - aes256, err := aes.NewCipher(key) +var newAES = func(key []byte) (cipher.AEAD, error) { + block, err := aes.NewCipher(key) if err != nil { return nil, err } - return cipher.NewGCM(aes256) + return cipher.NewGCM(block) +} + +var newChaCha20 = func(key []byte) (cipher.AEAD, error) { + // ChaCha20 requires 256 bit keys. Therefore, we expand the + // given 128 bit key into a 256 bit key. However, we don't + // use a simple algebraic key expansion to avoid any strutural + // relation/pattern in the resulting 256 bit key. Even though + // no effective attack against ChaCha20 is known that exploits + // related keys, we don't want to make any additional security + // assumption about ChaCha20. + // Therefore, we use the HChaCha20 KDF to derive a uniformly + // random 256 bit key from a 128 bit key as following: + // + // Input: K_i as 128 bit key + // Output: K_o as 256 bit key + // + // k = K_i | 0...0 # Expand K_i by 16 zero bytes to make it 256 bit long + // n = 0...0 | 1 # Set a 128 bit nonce value n to 1 + // K_o = HChaCha20(k, n) # Derive K_o as output of the HCHaCha20 KDF + // + // This construction ensures that the K_o is 256 bit long and is not strutural related + // to K_i since HChaCha20 is a secure PRF. As long as an attacker has no effective attack + // distinguishing HChaCha20 from randomness, the attacker's best attack is a key space + // search trying to find the right 128 bit key among 2^128 possible candidates - which + // is not feasible. + if len(key) == 128/8 { + var ( + k [32]byte + nonce [16]byte + err error + ) + copy(k[:], key) + binary.BigEndian.PutUint32(nonce[12:], 1) + + if key, err = chacha20.HChaCha20(k[:], nonce[:]); err != nil { + return nil, err + } + } + return chacha20poly1305.New(key) } var supportedCiphers = [...]func([]byte) (cipher.AEAD, error){ - AES_256_GCM: newAesGcm, - CHACHA20_POLY1305: chacha20poly1305.New, + AES_GCM: newAES, + CHACHA20_POLY1305: newChaCha20, } var ( @@ -336,9 +375,9 @@ func DecryptWriter(dst io.Writer, config Config) (io.WriteCloser, error) { func defaultCipherSuites() []byte { if supportsAES { - return []byte{AES_256_GCM, CHACHA20_POLY1305} + return []byte{AES_GCM, CHACHA20_POLY1305} } - return []byte{CHACHA20_POLY1305, AES_256_GCM} + return []byte{CHACHA20_POLY1305, AES_GCM} } func setConfigDefaults(config *Config) error { @@ -348,7 +387,7 @@ func setConfigDefaults(config *Config) error { if config.MaxVersion > Version20 { return errors.New("sio: unknown maximum version") } - if len(config.Key) != keySize { + if len(config.Key) != 128/8 && len(config.Key) != 256/8 { return errors.New("sio: invalid key size") } if len(config.CipherSuites) > 2 { diff --git a/vendor/go.yaml.in/yaml/v4/.gitignore b/vendor/go.yaml.in/yaml/v4/.gitignore index ae2880f..5bdcb9a 100644 --- a/vendor/go.yaml.in/yaml/v4/.gitignore +++ b/vendor/go.yaml.in/yaml/v4/.gitignore @@ -3,8 +3,9 @@ /.cache/ /.claude/ -/CLAUDE.md +/note/ +/worktree/ /yts/testdata/ /go-yaml -/note/ +/*.md /*.yaml diff --git a/vendor/go.yaml.in/yaml/v4/.typos.toml b/vendor/go.yaml.in/yaml/v4/.typos.toml index 59f9331..e0842f9 100644 --- a/vendor/go.yaml.in/yaml/v4/.typos.toml +++ b/vendor/go.yaml.in/yaml/v4/.typos.toml @@ -31,3 +31,6 @@ extend-ignore-re = [ [default.extend-words] caf = "caf" # part of "café" shown as "caf\u00e9" in Unicode escape examples deprecat = "deprecat" # Used as part of a command in a docs/ file +Desolver = "Desolver" # Type name: inverse of Resolver (removes tags) +Desolve = "Desolve" # Function name: inverse of Resolve +desolve = "desolve" # Function name variants diff --git a/vendor/go.yaml.in/yaml/v4/doc.go b/vendor/go.yaml.in/yaml/v4/doc.go index 9e9ac72..3aa872d 100644 --- a/vendor/go.yaml.in/yaml/v4/doc.go +++ b/vendor/go.yaml.in/yaml/v4/doc.go @@ -1,7 +1,5 @@ -// -// Copyright (c) 2025 The go-yaml Project Contributors +// Copyright 2025 The go-yaml Project Contributors // SPDX-License-Identifier: Apache-2.0 -// // Package yaml implements YAML 1.1/1.2 encoding and decoding for Go programs. // @@ -81,14 +79,14 @@ // // Or use version-specific option presets for consistent formatting: // -// yaml.NewDumper(w, yaml.V3) +// yaml.NewDumper(w, yaml.WithV3Defaults()) // // Options can be combined and later options override earlier ones: // // // Start with v3 defaults, then override indent // yaml.NewDumper(w, -// yaml.V3, -// yaml.WithIndent(4), +// yaml.WithV3Defaults(), +// yaml.WithIndent(2), // ) // // Load options from YAML configuration files: diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/README.md b/vendor/go.yaml.in/yaml/v4/internal/libyaml/README.md index 62dbeac..cfcbcc9 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/README.md +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/README.md @@ -23,7 +23,7 @@ The `internal/libyaml` package implements the core YAML processing stages: - **yaml.go** - Core types and constants (Event, Token, enums) - **reader.go** - Input handling and encoding detection - **writer.go** - Output handling -- **yamlprivate.go** - Internal types and helper functions +- **util.go** - Internal types and helper functions ### Test Files @@ -34,10 +34,11 @@ The `internal/libyaml` package implements the core YAML processing stages: - **yaml_test.go** - Utility function tests - **reader_test.go** - Reader tests - **writer_test.go** - Writer tests -- **yamlprivate_test.go** - Character classification tests +- **util_test.go** - Character classification tests - **loader_test.go** - Data loader scalar resolution tests - **yamldatatest_test.go** - YAML test data loading framework -- **yamldatatest_loader.go** - YAML test data loader with scalar type resolution (exported for reuse) +- **yamldatatest_loader.go** - YAML test data loader with scalar type + resolution (exported for reuse) ### Test Data Files (in `testdata/`) @@ -48,7 +49,7 @@ The `internal/libyaml` package implements the core YAML processing stages: - **yaml.yaml** - Utility function test cases - **reader.yaml** - Reader test cases - **writer.yaml** - Writer test cases -- **yamlprivate.yaml** - Character classification test cases +- **util.yaml** - Character classification test cases - **loader.yaml** - Data loader scalar resolution test cases ## Processing Pipeline @@ -126,7 +127,8 @@ The testing framework uses a data-driven approach: 1. **Test data** is stored in YAML files in the `testdata/` directory 2. **Test logic** is implemented in Go files (`*_test.go`) -3. **One-to-one pairing**: Each `testdata/foo.yaml` has a corresponding `foo_test.go` +3. **One-to-one pairing**: Each `testdata/foo.yaml` has a corresponding + `foo_test.go` **Benefits**: - Easy to add new test cases without writing Go code @@ -175,7 +177,7 @@ Each YAML file contains test cases for a specific component: - Output handlers (string, io.Writer) - Error conditions -- **yamlprivate.yaml** - Character classification tests +- **util.yaml** - Character classification tests - Character type predicates (isAlpha, isDigit, isHex, etc.) - Character conversion functions (asDigit, asHex, width) - Unicode handling @@ -188,13 +190,15 @@ Each YAML file contains test cases for a specific component: ### Test Framework Implementation -The test framework is implemented in `yamldatatest_loader.go` and `yamldatatest_test.go`: +The test framework is implemented in `testdata_test.go`: **Core functions**: -- `LoadYAML(data []byte) (interface{}, error)` - Parses YAML using libyaml parser with scalar type resolution (exported) -- `UnmarshalStruct(target interface{}, data map[string]interface{}) error` - Populates structs (exported) -- `LoadTestCases(filename string) ([]TestCase, error)` - Loads and parses test YAML files -- `coerceScalar(value string) interface{}` - Resolves scalar strings to appropriate Go types (int, float64, bool, nil, string) +- `LoadAny(data []byte) (interface{}, error)` - Parses YAML using production + loader with scalar type resolution (exported from loader.go) +- `UnmarshalStruct(target interface{}, data map[string]interface{}) error` - + Populates structs (exported) +- `LoadTestCases(filename string) ([]TestCase, error)` - Loads and parses + test YAML files **Core types**: - `TestCase` struct - Umbrella structure containing fields for all test types @@ -203,8 +207,10 @@ The test framework is implemented in `yamldatatest_loader.go` and `yamldatatest_ **Post-processing**: After loading, the framework processes test data: -- Converts `Want` (interface{}) to `WantEvents`, `WantTokens`, or `WantSpecs` based on test type -- Converts `Want` (interface{}) to `WantContains` (handles both scalar and sequence) +- Converts `Want` (interface{}) to `WantEvents`, `WantTokens`, or `WantSpecs` + based on test type +- Converts `Want` (interface{}) to `WantContains` (handles both scalar and + sequence) - Converts `Checks` to field validation specifications ### Test Types @@ -490,7 +496,8 @@ Test cases use a **type-as-key** format where the test type is the map key: - **yaml** - Input YAML string to test - **want** - Expected result (format varies by test type) - For api-panic: string containing expected panic message substring - - For scan-error/parse-error: boolean (defaults to true if omitted; set to false if no error expected) + - For scan-error/parse-error: boolean (defaults to true if omitted; set to + false if no error expected) - For enum-string: string representing expected String() output - For other types: varies (may be sequence or scalar) - **data** - For emitter tests: list of event specifications to emit @@ -499,11 +506,20 @@ Test cases use a **type-as-key** format where the test type is the map key: - **call** - For API tests: method call [MethodName, arg1, arg2, ...] - **init** - For API panic tests: setup method call before main method - **byte** - For API tests: boolean flag to convert string args to []byte -- **test** - For API tests: list of field validation checks in format `operator: [field, value]` where operator is one of: nil, cap, len, eq, gte, len-gt. -- **test** - For style-accessor tests: array of [Method, STYLE] where Method is the accessor method (e.g., ScalarStyle) and STYLE is the style constant (e.g., DOUBLE_QUOTED_SCALAR_STYLE). -- **enum** - For enum tests: array of [Type, Value] where Type is the enum type (e.g., ScalarStyle) and Value is the constant (e.g., PLAIN_SCALAR_STYLE) - -**Note on scalar type resolution**: Unquoted scalar values in test data are automatically resolved to appropriate Go types (int, float64, bool, nil) by the `LoadYAML` function. Quoted scalars remain as strings. +- **test** - For API tests: list of field validation checks in format + `operator: [field, value]` where operator is one of: nil, cap, len, eq, gte, + len-gt. +- **test** - For style-accessor tests: array of [Method, STYLE] where Method + is the accessor method (e.g., ScalarStyle) and STYLE is the style constant + (e.g., DOUBLE_QUOTED_SCALAR_STYLE). +- **enum** - For enum tests: array of [Type, Value] where Type is the enum + type (e.g., ScalarStyle) and Value is the constant (e.g., + PLAIN_SCALAR_STYLE) + +**Note on scalar type resolution**: Unquoted scalar values in test data are +automatically resolved to appropriate Go types (int, float64, bool, nil) by the +`LoadAny` function. +Quoted scalars remain as strings. ### Running Tests diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/api.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/api.go deleted file mode 100644 index f0807f5..0000000 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/api.go +++ /dev/null @@ -1,733 +0,0 @@ -// Copyright 2006-2010 Kirill Simonov -// Copyright 2011-2019 Canonical Ltd -// Copyright 2025 The go-yaml Project Contributors -// SPDX-License-Identifier: Apache-2.0 AND MIT - -// High-level API helpers for parser and emitter initialization and -// configuration. -// Provides convenience functions for token insertion and stream management. - -package libyaml - -import ( - "io" -) - -func (parser *Parser) insertToken(pos int, token *Token) { - // fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) - - // Check if we can move the queue at the beginning of the buffer. - if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { - if parser.tokens_head != len(parser.tokens) { - copy(parser.tokens, parser.tokens[parser.tokens_head:]) - } - parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head] - parser.tokens_head = 0 - } - parser.tokens = append(parser.tokens, *token) - if pos < 0 { - return - } - copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:]) - parser.tokens[parser.tokens_head+pos] = *token -} - -// NewParser creates a new parser object. -func NewParser() Parser { - return Parser{ - raw_buffer: make([]byte, 0, input_raw_buffer_size), - buffer: make([]byte, 0, input_buffer_size), - } -} - -// Delete a parser object. -func (parser *Parser) Delete() { - *parser = Parser{} -} - -// String read handler. -func yamlStringReadHandler(parser *Parser, buffer []byte) (n int, err error) { - if parser.input_pos == len(parser.input) { - return 0, io.EOF - } - n = copy(buffer, parser.input[parser.input_pos:]) - parser.input_pos += n - return n, nil -} - -// Reader read handler. -func yamlReaderReadHandler(parser *Parser, buffer []byte) (n int, err error) { - return parser.input_reader.Read(buffer) -} - -// SetInputString sets a string input. -func (parser *Parser) SetInputString(input []byte) { - if parser.read_handler != nil { - panic("must set the input source only once") - } - parser.read_handler = yamlStringReadHandler - parser.input = input - parser.input_pos = 0 -} - -// SetInputReader sets a file input. -func (parser *Parser) SetInputReader(r io.Reader) { - if parser.read_handler != nil { - panic("must set the input source only once") - } - parser.read_handler = yamlReaderReadHandler - parser.input_reader = r -} - -// SetEncoding sets the source encoding. -func (parser *Parser) SetEncoding(encoding Encoding) { - if parser.encoding != ANY_ENCODING { - panic("must set the encoding only once") - } - parser.encoding = encoding -} - -// GetPendingComments returns the parser's comment queue for CLI access. -func (parser *Parser) GetPendingComments() []Comment { - return parser.comments -} - -// GetCommentsHead returns the current position in the comment queue. -func (parser *Parser) GetCommentsHead() int { - return parser.comments_head -} - -// NewEmitter creates a new emitter object. -func NewEmitter() Emitter { - return Emitter{ - buffer: make([]byte, output_buffer_size), - states: make([]EmitterState, 0, initial_stack_size), - events: make([]Event, 0, initial_queue_size), - best_width: -1, - } -} - -// Delete an emitter object. -func (emitter *Emitter) Delete() { - *emitter = Emitter{} -} - -// String write handler. -func yamlStringWriteHandler(emitter *Emitter, buffer []byte) error { - *emitter.output_buffer = append(*emitter.output_buffer, buffer...) - return nil -} - -// yamlWriterWriteHandler uses emitter.output_writer to write the -// emitted text. -func yamlWriterWriteHandler(emitter *Emitter, buffer []byte) error { - _, err := emitter.output_writer.Write(buffer) - return err -} - -// SetOutputString sets a string output. -func (emitter *Emitter) SetOutputString(output_buffer *[]byte) { - if emitter.write_handler != nil { - panic("must set the output target only once") - } - emitter.write_handler = yamlStringWriteHandler - emitter.output_buffer = output_buffer -} - -// SetOutputWriter sets a file output. -func (emitter *Emitter) SetOutputWriter(w io.Writer) { - if emitter.write_handler != nil { - panic("must set the output target only once") - } - emitter.write_handler = yamlWriterWriteHandler - emitter.output_writer = w -} - -// SetEncoding sets the output encoding. -func (emitter *Emitter) SetEncoding(encoding Encoding) { - if emitter.encoding != ANY_ENCODING { - panic("must set the output encoding only once") - } - emitter.encoding = encoding -} - -// SetCanonical sets the canonical output style. -func (emitter *Emitter) SetCanonical(canonical bool) { - emitter.canonical = canonical -} - -// SetIndent sets the indentation increment. -func (emitter *Emitter) SetIndent(indent int) { - if indent < 2 || indent > 9 { - indent = 2 - } - emitter.BestIndent = indent -} - -// SetWidth sets the preferred line width. -func (emitter *Emitter) SetWidth(width int) { - if width < 0 { - width = -1 - } - emitter.best_width = width -} - -// SetUnicode sets if unescaped non-ASCII characters are allowed. -func (emitter *Emitter) SetUnicode(unicode bool) { - emitter.unicode = unicode -} - -// SetLineBreak sets the preferred line break character. -func (emitter *Emitter) SetLineBreak(line_break LineBreak) { - emitter.line_break = line_break -} - -///* -// * Destroy a token object. -// */ -// -//YAML_DECLARE(void) -//yaml_token_delete(yaml_token_t *token) -//{ -// assert(token); // Non-NULL token object expected. -// -// switch (token.type) -// { -// case YAML_TAG_DIRECTIVE_TOKEN: -// yaml_free(token.data.tag_directive.handle); -// yaml_free(token.data.tag_directive.prefix); -// break; -// -// case YAML_ALIAS_TOKEN: -// yaml_free(token.data.alias.value); -// break; -// -// case YAML_ANCHOR_TOKEN: -// yaml_free(token.data.anchor.value); -// break; -// -// case YAML_TAG_TOKEN: -// yaml_free(token.data.tag.handle); -// yaml_free(token.data.tag.suffix); -// break; -// -// case YAML_SCALAR_TOKEN: -// yaml_free(token.data.scalar.value); -// break; -// -// default: -// break; -// } -// -// memset(token, 0, sizeof(yaml_token_t)); -//} -// -///* -// * Check if a string is a valid UTF-8 sequence. -// * -// * Check 'reader.c' for more details on UTF-8 encoding. -// */ -// -//static int -//yaml_check_utf8(yaml_char_t *start, size_t length) -//{ -// yaml_char_t *end = start+length; -// yaml_char_t *pointer = start; -// -// while (pointer < end) { -// unsigned char octet; -// unsigned int width; -// unsigned int value; -// size_t k; -// -// octet = pointer[0]; -// width = (octet & 0x80) == 0x00 ? 1 : -// (octet & 0xE0) == 0xC0 ? 2 : -// (octet & 0xF0) == 0xE0 ? 3 : -// (octet & 0xF8) == 0xF0 ? 4 : 0; -// value = (octet & 0x80) == 0x00 ? octet & 0x7F : -// (octet & 0xE0) == 0xC0 ? octet & 0x1F : -// (octet & 0xF0) == 0xE0 ? octet & 0x0F : -// (octet & 0xF8) == 0xF0 ? octet & 0x07 : 0; -// if (!width) return 0; -// if (pointer+width > end) return 0; -// for (k = 1; k < width; k ++) { -// octet = pointer[k]; -// if ((octet & 0xC0) != 0x80) return 0; -// value = (value << 6) + (octet & 0x3F); -// } -// if (!((width == 1) || -// (width == 2 && value >= 0x80) || -// (width == 3 && value >= 0x800) || -// (width == 4 && value >= 0x10000))) return 0; -// -// pointer += width; -// } -// -// return 1; -//} -// - -// NewStreamStartEvent creates a new STREAM-START event. -func NewStreamStartEvent(encoding Encoding) Event { - return Event{ - Type: STREAM_START_EVENT, - encoding: encoding, - } -} - -// NewStreamEndEvent creates a new STREAM-END event. -func NewStreamEndEvent() Event { - return Event{ - Type: STREAM_END_EVENT, - } -} - -// NewDocumentStartEvent creates a new DOCUMENT-START event. -func NewDocumentStartEvent(version_directive *VersionDirective, tag_directives []TagDirective, implicit bool) Event { - return Event{ - Type: DOCUMENT_START_EVENT, - versionDirective: version_directive, - tagDirectives: tag_directives, - Implicit: implicit, - } -} - -// NewDocumentEndEvent creates a new DOCUMENT-END event. -func NewDocumentEndEvent(implicit bool) Event { - return Event{ - Type: DOCUMENT_END_EVENT, - Implicit: implicit, - } -} - -// NewAliasEvent creates a new ALIAS event. -func NewAliasEvent(anchor []byte) Event { - return Event{ - Type: ALIAS_EVENT, - Anchor: anchor, - } -} - -// NewScalarEvent creates a new SCALAR event. -func NewScalarEvent(anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style ScalarStyle) Event { - return Event{ - Type: SCALAR_EVENT, - Anchor: anchor, - Tag: tag, - Value: value, - Implicit: plain_implicit, - quoted_implicit: quoted_implicit, - Style: Style(style), - } -} - -// NewSequenceStartEvent creates a new SEQUENCE-START event. -func NewSequenceStartEvent(anchor, tag []byte, implicit bool, style SequenceStyle) Event { - return Event{ - Type: SEQUENCE_START_EVENT, - Anchor: anchor, - Tag: tag, - Implicit: implicit, - Style: Style(style), - } -} - -// NewSequenceEndEvent creates a new SEQUENCE-END event. -func NewSequenceEndEvent() Event { - return Event{ - Type: SEQUENCE_END_EVENT, - } -} - -// NewMappingStartEvent creates a new MAPPING-START event. -func NewMappingStartEvent(anchor, tag []byte, implicit bool, style MappingStyle) Event { - return Event{ - Type: MAPPING_START_EVENT, - Anchor: anchor, - Tag: tag, - Implicit: implicit, - Style: Style(style), - } -} - -// NewMappingEndEvent creates a new MAPPING-END event. -func NewMappingEndEvent() Event { - return Event{ - Type: MAPPING_END_EVENT, - } -} - -// Delete an event object. -func (e *Event) Delete() { - *e = Event{} -} - -///* -// * Create a document object. -// */ -// -//YAML_DECLARE(int) -//yaml_document_initialize(document *yaml_document_t, -// version_directive *yaml_version_directive_t, -// tag_directives_start *yaml_tag_directive_t, -// tag_directives_end *yaml_tag_directive_t, -// start_implicit int, end_implicit int) -//{ -// struct { -// error yaml_error_type_t -// } context -// struct { -// start *yaml_node_t -// end *yaml_node_t -// top *yaml_node_t -// } nodes = { NULL, NULL, NULL } -// version_directive_copy *yaml_version_directive_t = NULL -// struct { -// start *yaml_tag_directive_t -// end *yaml_tag_directive_t -// top *yaml_tag_directive_t -// } tag_directives_copy = { NULL, NULL, NULL } -// value yaml_tag_directive_t = { NULL, NULL } -// mark yaml_mark_t = { 0, 0, 0 } -// -// assert(document) // Non-NULL document object is expected. -// assert((tag_directives_start && tag_directives_end) || -// (tag_directives_start == tag_directives_end)) -// // Valid tag directives are expected. -// -// if (!STACK_INIT(&context, nodes, INITIAL_STACK_SIZE)) goto error -// -// if (version_directive) { -// version_directive_copy = yaml_malloc(sizeof(yaml_version_directive_t)) -// if (!version_directive_copy) goto error -// version_directive_copy.major = version_directive.major -// version_directive_copy.minor = version_directive.minor -// } -// -// if (tag_directives_start != tag_directives_end) { -// tag_directive *yaml_tag_directive_t -// if (!STACK_INIT(&context, tag_directives_copy, INITIAL_STACK_SIZE)) -// goto error -// for (tag_directive = tag_directives_start -// tag_directive != tag_directives_end; tag_directive ++) { -// assert(tag_directive.handle) -// assert(tag_directive.prefix) -// if (!yaml_check_utf8(tag_directive.handle, -// strlen((char *)tag_directive.handle))) -// goto error -// if (!yaml_check_utf8(tag_directive.prefix, -// strlen((char *)tag_directive.prefix))) -// goto error -// value.handle = yaml_strdup(tag_directive.handle) -// value.prefix = yaml_strdup(tag_directive.prefix) -// if (!value.handle || !value.prefix) goto error -// if (!PUSH(&context, tag_directives_copy, value)) -// goto error -// value.handle = NULL -// value.prefix = NULL -// } -// } -// -// DOCUMENT_INIT(*document, nodes.start, nodes.end, version_directive_copy, -// tag_directives_copy.start, tag_directives_copy.top, -// start_implicit, end_implicit, mark, mark) -// -// return 1 -// -//error: -// STACK_DEL(&context, nodes) -// yaml_free(version_directive_copy) -// while (!STACK_EMPTY(&context, tag_directives_copy)) { -// value yaml_tag_directive_t = POP(&context, tag_directives_copy) -// yaml_free(value.handle) -// yaml_free(value.prefix) -// } -// STACK_DEL(&context, tag_directives_copy) -// yaml_free(value.handle) -// yaml_free(value.prefix) -// -// return 0 -//} -// -///* -// * Destroy a document object. -// */ -// -//YAML_DECLARE(void) -//yaml_document_delete(document *yaml_document_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// tag_directive *yaml_tag_directive_t -// -// context.error = YAML_NO_ERROR // Eliminate a compiler warning. -// -// assert(document) // Non-NULL document object is expected. -// -// while (!STACK_EMPTY(&context, document.nodes)) { -// node yaml_node_t = POP(&context, document.nodes) -// yaml_free(node.tag) -// switch (node.type) { -// case YAML_SCALAR_NODE: -// yaml_free(node.data.scalar.value) -// break -// case YAML_SEQUENCE_NODE: -// STACK_DEL(&context, node.data.sequence.items) -// break -// case YAML_MAPPING_NODE: -// STACK_DEL(&context, node.data.mapping.pairs) -// break -// default: -// assert(0) // Should not happen. -// } -// } -// STACK_DEL(&context, document.nodes) -// -// yaml_free(document.version_directive) -// for (tag_directive = document.tag_directives.start -// tag_directive != document.tag_directives.end -// tag_directive++) { -// yaml_free(tag_directive.handle) -// yaml_free(tag_directive.prefix) -// } -// yaml_free(document.tag_directives.start) -// -// memset(document, 0, sizeof(yaml_document_t)) -//} -// -///** -// * Get a document node. -// */ -// -//YAML_DECLARE(yaml_node_t *) -//yaml_document_get_node(document *yaml_document_t, index int) -//{ -// assert(document) // Non-NULL document object is expected. -// -// if (index > 0 && document.nodes.start + index <= document.nodes.top) { -// return document.nodes.start + index - 1 -// } -// return NULL -//} -// -///** -// * Get the root object. -// */ -// -//YAML_DECLARE(yaml_node_t *) -//yaml_document_get_root_node(document *yaml_document_t) -//{ -// assert(document) // Non-NULL document object is expected. -// -// if (document.nodes.top != document.nodes.start) { -// return document.nodes.start -// } -// return NULL -//} -// -///* -// * Add a scalar node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_scalar(document *yaml_document_t, -// tag *yaml_char_t, value *yaml_char_t, length int, -// style yaml_scalar_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// value_copy *yaml_char_t = NULL -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// assert(value) // Non-NULL value is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_SCALAR_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (length < 0) { -// length = strlen((char *)value) -// } -// -// if (!yaml_check_utf8(value, length)) goto error -// value_copy = yaml_malloc(length+1) -// if (!value_copy) goto error -// memcpy(value_copy, value, length) -// value_copy[length] = '\0' -// -// SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// yaml_free(tag_copy) -// yaml_free(value_copy) -// -// return 0 -//} -// -///* -// * Add a sequence node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_sequence(document *yaml_document_t, -// tag *yaml_char_t, style yaml_sequence_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// struct { -// start *yaml_node_item_t -// end *yaml_node_item_t -// top *yaml_node_item_t -// } items = { NULL, NULL, NULL } -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_SEQUENCE_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (!STACK_INIT(&context, items, INITIAL_STACK_SIZE)) goto error -// -// SEQUENCE_NODE_INIT(node, tag_copy, items.start, items.end, -// style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// STACK_DEL(&context, items) -// yaml_free(tag_copy) -// -// return 0 -//} -// -///* -// * Add a mapping node to a document. -// */ -// -//YAML_DECLARE(int) -//yaml_document_add_mapping(document *yaml_document_t, -// tag *yaml_char_t, style yaml_mapping_style_t) -//{ -// struct { -// error yaml_error_type_t -// } context -// mark yaml_mark_t = { 0, 0, 0 } -// tag_copy *yaml_char_t = NULL -// struct { -// start *yaml_node_pair_t -// end *yaml_node_pair_t -// top *yaml_node_pair_t -// } pairs = { NULL, NULL, NULL } -// node yaml_node_t -// -// assert(document) // Non-NULL document object is expected. -// -// if (!tag) { -// tag = (yaml_char_t *)YAML_DEFAULT_MAPPING_TAG -// } -// -// if (!yaml_check_utf8(tag, strlen((char *)tag))) goto error -// tag_copy = yaml_strdup(tag) -// if (!tag_copy) goto error -// -// if (!STACK_INIT(&context, pairs, INITIAL_STACK_SIZE)) goto error -// -// MAPPING_NODE_INIT(node, tag_copy, pairs.start, pairs.end, -// style, mark, mark) -// if (!PUSH(&context, document.nodes, node)) goto error -// -// return document.nodes.top - document.nodes.start -// -//error: -// STACK_DEL(&context, pairs) -// yaml_free(tag_copy) -// -// return 0 -//} -// -///* -// * Append an item to a sequence node. -// */ -// -//YAML_DECLARE(int) -//yaml_document_append_sequence_item(document *yaml_document_t, -// sequence int, item int) -//{ -// struct { -// error yaml_error_type_t -// } context -// -// assert(document) // Non-NULL document is required. -// assert(sequence > 0 -// && document.nodes.start + sequence <= document.nodes.top) -// // Valid sequence id is required. -// assert(document.nodes.start[sequence-1].type == YAML_SEQUENCE_NODE) -// // A sequence node is required. -// assert(item > 0 && document.nodes.start + item <= document.nodes.top) -// // Valid item id is required. -// -// if (!PUSH(&context, -// document.nodes.start[sequence-1].data.sequence.items, item)) -// return 0 -// -// return 1 -//} -// -///* -// * Append a pair of a key and a value to a mapping node. -// */ -// -//YAML_DECLARE(int) -//yaml_document_append_mapping_pair(document *yaml_document_t, -// mapping int, key int, value int) -//{ -// struct { -// error yaml_error_type_t -// } context -// -// pair yaml_node_pair_t -// -// assert(document) // Non-NULL document is required. -// assert(mapping > 0 -// && document.nodes.start + mapping <= document.nodes.top) -// // Valid mapping id is required. -// assert(document.nodes.start[mapping-1].type == YAML_MAPPING_NODE) -// // A mapping node is required. -// assert(key > 0 && document.nodes.start + key <= document.nodes.top) -// // Valid key id is required. -// assert(value > 0 && document.nodes.start + value <= document.nodes.top) -// // Valid value id is required. -// -// pair.key = key -// pair.value = value -// -// if (!PUSH(&context, -// document.nodes.start[mapping-1].data.mapping.pairs, pair)) -// return 0 -// -// return 1 -//} -// -// diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/composer.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/composer.go index 57dd7f1..59d64cb 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/composer.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/composer.go @@ -24,112 +24,48 @@ type Composer struct { returnStream bool // flag to return stream node next atStreamEnd bool // at stream end encoding Encoding // stream encoding from STREAM_START + opts *Options // options for loading } // NewComposer creates a new composer from a byte slice. -func NewComposer(b []byte) *Composer { +func NewComposer(b []byte, opts *Options) *Composer { p := Composer{ Parser: NewParser(), + opts: opts, } if len(b) == 0 { b = []byte{'\n'} } p.Parser.SetInputString(b) + if opts != nil { + p.Parser.depthCheck = opts.DepthCheck + } return &p } -// NewComposerFromReader creates a new composer from an io.Reader. -func NewComposerFromReader(r io.Reader) *Composer { +// NewComposerFromReader creates a new composer from an [io.Reader]. +func NewComposerFromReader(r io.Reader, opts *Options) *Composer { p := Composer{ Parser: NewParser(), + opts: opts, } p.Parser.SetInputReader(r) - return &p -} - -func (c *Composer) init() { - if c.doneInit { - return - } - c.anchors = make(map[string]*Node) - // Peek to get the encoding from STREAM_START_EVENT - if c.peek() == STREAM_START_EVENT { - c.encoding = c.event.GetEncoding() - } - c.expect(STREAM_START_EVENT) - c.doneInit = true - - // If stream nodes are enabled, prepare to return the first stream node - if c.streamNodes { - c.returnStream = true - } -} - -func (c *Composer) Destroy() { - if c.event.Type != NO_EVENT { - c.event.Delete() - } - c.Parser.Delete() -} - -// SetStreamNodes enables or disables stream node emission. -func (c *Composer) SetStreamNodes(enable bool) { - c.streamNodes = enable -} - -// expect consumes an event from the event stream and -// checks that it's of the expected type. -func (c *Composer) expect(e EventType) { - if c.event.Type == NO_EVENT { - if err := c.Parser.Parse(&c.event); err != nil { - c.fail(err) - } - } - if c.event.Type == STREAM_END_EVENT { - failf("attempted to go past the end of stream; corrupted value?") - } - if c.event.Type != e { - c.fail(fmt.Errorf("expected %s event but got %s", e, c.event.Type)) - } - c.event.Delete() - c.event.Type = NO_EVENT -} - -// peek peeks at the next event in the event stream, -// puts the results into c.event and returns the event type. -func (c *Composer) peek() EventType { - if c.event.Type != NO_EVENT { - return c.event.Type - } - // It's curious choice from the underlying API to generally return a - // positive result on success, but on this case return true in an error - // scenario. This was the source of bugs in the past (issue #666). - if err := c.Parser.Parse(&c.event); err != nil { - c.fail(err) - } - return c.event.Type -} - -func (c *Composer) fail(err error) { - Fail(err) -} - -func (c *Composer) anchor(n *Node, anchor []byte) { - if anchor != nil { - n.Anchor = string(anchor) - c.anchors[n.Anchor] = n + if opts != nil { + p.Parser.depthCheck = opts.DepthCheck } + return &p } -// Parse parses the next YAML node from the event stream. -func (c *Composer) Parse() *Node { +// Compose composes the next YAML node from the event stream. +func (c *Composer) Compose() *Node { c.init() // Handle stream nodes if enabled if c.streamNodes { // Check for stream end first if c.peek() == STREAM_END_EVENT { - // If we haven't returned the final stream node yet, return it now + // If we haven't returned the final stream node yet, + // return it now if !c.atStreamEnd { c.atStreamEnd = true return c.createStreamNode() @@ -138,7 +74,8 @@ func (c *Composer) Parse() *Node { return nil } - // Check if we should return a stream node before the next document + // Check if we should return a stream node before the next + // document if c.returnStream { c.returnStream = false n := c.createStreamNode() @@ -160,7 +97,8 @@ func (c *Composer) Parse() *Node { case DOCUMENT_START_EVENT: return c.document() case STREAM_END_EVENT: - // Happens when attempting to decode an empty buffer (when not using stream nodes). + // Happens when attempting to decode an empty buffer (when not + // using stream nodes). return nil case TAIL_COMMENT_EVENT: panic("internal error: unexpected tail comment event (please report)") @@ -169,18 +107,17 @@ func (c *Composer) Parse() *Node { } } -func (c *Composer) node(kind Kind, defaultTag, tag, value string) *Node { +// node creates a new node with the given kind, tag, and value, and attaches +// position and comment information from the current event. +func (c *Composer) node(kind Kind, tag, value string) *Node { var style Style if tag != "" && tag != "!" { // Normalize tag to short form (e.g., tag:yaml.org,2002:str -> !!str) tag = shortTag(tag) style = TaggedStyle - } else if defaultTag != "" { - tag = defaultTag - } else if kind == ScalarNode { - // Delegate to resolver to determine tag from value - tag, _ = resolve("", value) } + // Note: Nodes without explicit tags are left with empty tags. + // Tag defaulting happens in a separate stage via Resolver. n := &Node{ Kind: kind, Tag: tag, @@ -188,8 +125,8 @@ func (c *Composer) node(kind Kind, defaultTag, tag, value string) *Node { Style: style, } if !c.Textless { - n.Line = c.event.StartMark.Line + 1 - n.Column = c.event.StartMark.Column + 1 + n.Line = c.event.StartMark.Line + n.Column = c.event.StartMark.Column n.HeadComment = string(c.event.HeadComment) n.LineComment = string(c.event.LineComment) n.FootComment = string(c.event.FootComment) @@ -197,14 +134,10 @@ func (c *Composer) node(kind Kind, defaultTag, tag, value string) *Node { return n } -func (c *Composer) parseChild(parent *Node) *Node { - child := c.Parse() - parent.Content = append(parent.Content, child) - return child -} - +// document composes a document node by parsing its content between +// DOCUMENT_START and DOCUMENT_END events. func (c *Composer) document() *Node { - n := c.node(DocumentNode, "", "", "") + n := c.node(DocumentNode, "", "") c.doc = n c.expect(DOCUMENT_START_EVENT) c.parseChild(n) @@ -221,56 +154,40 @@ func (c *Composer) document() *Node { return n } +// createStreamNode creates a stream node with encoding information. func (c *Composer) createStreamNode() *Node { n := &Node{ - Kind: StreamNode, - Encoding: c.encoding, + Kind: StreamNode, + Stream: &Stream{Encoding: c.encoding}, } if !c.Textless && c.event.Type != NO_EVENT { - n.Line = c.event.StartMark.Line + 1 - n.Column = c.event.StartMark.Column + 1 - } - return n -} - -// captureDirectives captures version and tag directives from upcoming DOCUMENT_START. -func (c *Composer) captureDirectives(n *Node) { - if c.peek() == DOCUMENT_START_EVENT { - if vd := c.event.GetVersionDirective(); vd != nil { - n.Version = &StreamVersionDirective{ - Major: vd.Major(), - Minor: vd.Minor(), - } - } - if tds := c.event.GetTagDirectives(); len(tds) > 0 { - n.TagDirectives = make([]StreamTagDirective, len(tds)) - for i, td := range tds { - n.TagDirectives[i] = StreamTagDirective{ - Handle: td.GetHandle(), - Prefix: td.GetPrefix(), - } - } + n.Line = c.event.StartMark.Line + n.Column = c.event.StartMark.Column + if c.event.Type == STREAM_END_EVENT { + n.HeadComment = string(c.event.HeadComment) + n.LineComment = string(c.event.LineComment) + n.FootComment = string(c.event.FootComment) } } + return n } +// alias composes an alias node by resolving the referenced anchor. func (c *Composer) alias() *Node { - n := c.node(AliasNode, "", "", string(c.event.Anchor)) + n := c.node(AliasNode, "", string(c.event.Anchor)) n.Alias = c.anchors[n.Value] if n.Alias == nil { msg := fmt.Sprintf("unknown anchor '%s' referenced", n.Value) - Fail(&ParserError{ - Message: msg, - Mark: Mark{ - Line: n.Line, - Column: n.Column, - }, - }) + Fail(formatComposerError(msg, Mark{ + Line: n.Line, + Column: n.Column, + })) } c.expect(ALIAS_EVENT) return n } +// scalar composes a scalar node with value, tag, and style information. func (c *Composer) scalar() *Node { parsedStyle := c.event.ScalarStyle() var nodeStyle Style @@ -286,19 +203,17 @@ func (c *Composer) scalar() *Node { } nodeValue := string(c.event.Value) nodeTag := string(c.event.Tag) - var defaultTag string - if nodeStyle != 0 { - defaultTag = strTag - } - n := c.node(ScalarNode, defaultTag, nodeTag, nodeValue) + n := c.node(ScalarNode, nodeTag, nodeValue) n.Style |= nodeStyle c.anchor(n, c.event.Anchor) c.expect(SCALAR_EVENT) return n } +// sequence composes a sequence node by parsing elements between +// SEQUENCE_START and SEQUENCE_END events. func (c *Composer) sequence() *Node { - n := c.node(SequenceNode, seqTag, string(c.event.Tag), "") + n := c.node(SequenceNode, string(c.event.Tag), "") if c.event.SequenceStyle()&FLOW_SEQUENCE_STYLE != 0 { n.Style |= FlowStyle } @@ -313,8 +228,10 @@ func (c *Composer) sequence() *Node { return n } +// mapping composes a mapping node by parsing key-value pairs between +// MAPPING_START and MAPPING_END events, handling foot comments appropriately. func (c *Composer) mapping() *Node { - n := c.node(MappingNode, mapTag, string(c.event.Tag), "") + n := c.node(MappingNode, string(c.event.Tag), "") block := true if c.event.MappingStyle()&FLOW_MAPPING_STYLE != 0 { block = false @@ -353,10 +270,149 @@ func (c *Composer) mapping() *Node { return n } +// init initializes the composer by setting up the anchor map and consuming +// the STREAM_START event. +func (c *Composer) init() { + if c.doneInit { + return + } + c.anchors = make(map[string]*Node) + // Peek to get the encoding from STREAM_START_EVENT + if c.peek() == STREAM_START_EVENT { + c.encoding = c.event.GetEncoding() + } + c.expect(STREAM_START_EVENT) + c.doneInit = true + + // If stream nodes are enabled, prepare to return the first stream node + if c.streamNodes { + c.returnStream = true + } +} + +// Destroy cleans up the composer by deleting any pending event and the +// underlying parser. +func (c *Composer) Destroy() { + if c.event.Type != NO_EVENT { + c.event.Delete() + } + c.Parser.Delete() +} + +// SetStreamNodes enables or disables stream node emission. +func (c *Composer) SetStreamNodes(enable bool) { + c.streamNodes = enable +} + +// expect consumes an event from the event stream and +// checks that it's of the expected type. +func (c *Composer) expect(e EventType) { + if c.event.Type == NO_EVENT { + if err := c.Parser.Parse(&c.event); err != nil { + c.fail(err) + } + } + if c.event.Type == STREAM_END_EVENT { + Fail(formatComposerError( + "attempted to go past the end of stream; corrupted value?", + Mark{Line: c.event.StartMark.Line, Column: c.event.StartMark.Column}, + )) + } + if c.event.Type != e { + Fail(formatComposerError( + fmt.Sprintf("expected %s event but got %s", e, c.event.Type), + Mark{Line: c.event.StartMark.Line, Column: c.event.StartMark.Column}, + )) + } + c.event.Delete() + c.event.Type = NO_EVENT +} + +// peek peeks at the next event in the event stream, +// puts the results into c.event and returns the event type. +func (c *Composer) peek() EventType { + if c.event.Type != NO_EVENT { + return c.event.Type + } + // It's curious choice from the underlying API to generally return a + // positive result on success, but on this case return true in an error + // scenario. This was the source of bugs in the past (issue #666). + if err := c.Parser.Parse(&c.event); err != nil { + c.fail(err) + } + return c.event.Type +} + +// fail panics with the given error. +func (c *Composer) fail(err error) { + Fail(err) +} + +// anchor sets the anchor name on a node and records it in the anchor map. +func (c *Composer) anchor(n *Node, anchor []byte) { + if anchor != nil { + n.Anchor = string(anchor) + c.anchors[n.Anchor] = n + } +} + +// parseChild composes the next node and adds it as a child to the parent. +func (c *Composer) parseChild(parent *Node) *Node { + child := c.Compose() + parent.Content = append(parent.Content, child) + return child +} + +// captureDirectives captures version and tag directives from upcoming +// DOCUMENT_START. +// The node n must have Stream initialized (as created by createStreamNode). +func (c *Composer) captureDirectives(n *Node) { + if c.peek() == DOCUMENT_START_EVENT { + if vd := c.event.GetVersionDirective(); vd != nil { + n.Stream.Version = &StreamVersionDirective{ + Major: vd.Major(), + Minor: vd.Minor(), + } + } + if tds := c.event.GetTagDirectives(); len(tds) > 0 { + n.Stream.TagDirectives = make([]StreamTagDirective, len(tds)) + for i, td := range tds { + n.Stream.TagDirectives[i] = StreamTagDirective{ + Handle: td.GetHandle(), + Prefix: td.GetPrefix(), + } + } + } + } +} + +// Fail panics with a YAMLError wrapping the given error. func Fail(err error) { panic(&YAMLError{err}) } +// failf panics with a YAMLError containing a formatted error message. func failf(format string, args ...any) { panic(&YAMLError{fmt.Errorf("yaml: "+format, args...)}) } + +// formatComposerError creates a LoadError for composer-stage errors. +func formatComposerError(message string, mark Mark) *LoadError { + return &LoadError{ + Stage: ComposerStage, + Mark: mark, + Message: message, + } +} + +// formatComposerErrorContext creates a LoadError with both context and +// problem information for composer-stage errors. +func formatComposerErrorContext(context string, contextMark Mark, message string, mark Mark) *LoadError { + return &LoadError{ + Stage: ComposerStage, + ContextMark: contextMark, + ContextMsg: context, + Mark: mark, + Message: message, + } +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/constructor.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/constructor.go index 66f209a..1d96e91 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/constructor.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/constructor.go @@ -10,303 +10,40 @@ package libyaml import ( "encoding" "encoding/base64" - "errors" "fmt" "math" "reflect" - "strings" - "sync" "time" ) // -------------------------------------------------------------------------- -// Interfaces and types needed by constructor +// Types and Interfaces -// constructor interface may be implemented by types to customize their -// behavior when being constructed from a YAML document. -type constructor interface { - UnmarshalYAML(value *Node) error -} - -type obsoleteConstructor interface { +// legacyConstructor is the old-style unmarshaler interface. +// It's kept for backwards compatibility. +type legacyConstructor interface { UnmarshalYAML(construct func(any) error) error } -// Marshaler interface may be implemented by types to customize their -// behavior when being marshaled into a YAML document. -type Marshaler interface { - MarshalYAML() (any, error) -} - -// IsZeroer is used to check whether an object is zero to determine whether -// it should be omitted when marshaling with the ,omitempty flag. One notable -// implementation is time.Time. -type IsZeroer interface { - IsZero() bool -} - -// handleErr recovers from panics caused by yaml errors -func handleErr(err *error) { - if v := recover(); v != nil { - if e, ok := v.(*YAMLError); ok { - *err = e.Err - } else { - panic(v) - } - } -} - -// -------------------------------------------------------------------------- -// Struct field information - -type structInfo struct { - FieldsMap map[string]fieldInfo - FieldsList []fieldInfo - - // InlineMap is the number of the field in the struct that - // contains an ,inline map, or -1 if there's none. - InlineMap int - - // InlineConstructors holds indexes to inlined fields that - // contain constructor values. - InlineConstructors [][]int -} - -type fieldInfo struct { - Key string - Num int - OmitEmpty bool - Flow bool - // Id holds the unique field identifier, so we can cheaply - // check for field duplicates without maintaining an extra map. - Id int - - // Inline holds the field index if the field is part of an inlined struct. - Inline []int -} - -var ( - structMap = make(map[reflect.Type]*structInfo) - fieldMapMutex sync.RWMutex - constructorType reflect.Type -) - -func init() { - var v constructor - constructorType = reflect.ValueOf(&v).Elem().Type() -} - -// hasConstructYAMLMethod checks if a type has an UnmarshalYAML method -// that looks like it implements yaml.Unmarshaler (from root package). -// This is needed because we can't directly check for the interface type -// since it's in a different package that we can't import. -func hasConstructYAMLMethod(t reflect.Type) bool { - method, found := t.MethodByName("UnmarshalYAML") - if !found { - return false - } - - // Check signature: func(*T) UnmarshalYAML(*Node) error - mtype := method.Type - if mtype.NumIn() != 2 || mtype.NumOut() != 1 { - return false - } - - // First param is receiver (already checked by MethodByName) - // Second param should be a pointer to a Node-like struct - paramType := mtype.In(1) - if paramType.Kind() != reflect.Ptr { - return false - } - - elemType := paramType.Elem() - if elemType.Kind() != reflect.Struct || elemType.Name() != "Node" { - return false - } - - // Return type should be error - retType := mtype.Out(0) - if retType.Kind() != reflect.Interface || retType.Name() != "error" { - return false - } - - return true -} - -func getStructInfo(st reflect.Type) (*structInfo, error) { - fieldMapMutex.RLock() - sinfo, found := structMap[st] - fieldMapMutex.RUnlock() - if found { - return sinfo, nil - } - - n := st.NumField() - fieldsMap := make(map[string]fieldInfo) - fieldsList := make([]fieldInfo, 0, n) - inlineMap := -1 - inlineConstructors := [][]int(nil) - for i := 0; i != n; i++ { - field := st.Field(i) - if field.PkgPath != "" && !field.Anonymous { - continue // Private field - } - - info := fieldInfo{Num: i} - - tag := field.Tag.Get("yaml") - if tag == "" && !strings.Contains(string(field.Tag), ":") { - tag = string(field.Tag) - } - if tag == "-" { - continue - } - - inline := false - fields := strings.Split(tag, ",") - if len(fields) > 1 { - for _, flag := range fields[1:] { - switch flag { - case "omitempty": - info.OmitEmpty = true - case "flow": - info.Flow = true - case "inline": - inline = true - default: - return nil, fmt.Errorf("unsupported flag %q in tag %q of type %s", flag, tag, st) - } - } - tag = fields[0] - } - - if inline { - switch field.Type.Kind() { - case reflect.Map: - if inlineMap >= 0 { - return nil, errors.New("multiple ,inline maps in struct " + st.String()) - } - if field.Type.Key() != reflect.TypeOf("") { - return nil, errors.New("option ,inline needs a map with string keys in struct " + st.String()) - } - inlineMap = info.Num - case reflect.Struct, reflect.Pointer: - ftype := field.Type - for ftype.Kind() == reflect.Pointer { - ftype = ftype.Elem() - } - if ftype.Kind() != reflect.Struct { - return nil, errors.New("option ,inline may only be used on a struct or map field") - } - // Check for both libyaml.constructor and yaml.Unmarshaler (by method name) - if reflect.PointerTo(ftype).Implements(constructorType) || hasConstructYAMLMethod(reflect.PointerTo(ftype)) { - inlineConstructors = append(inlineConstructors, []int{i}) - } else { - sinfo, err := getStructInfo(ftype) - if err != nil { - return nil, err - } - for _, index := range sinfo.InlineConstructors { - inlineConstructors = append(inlineConstructors, append([]int{i}, index...)) - } - for _, finfo := range sinfo.FieldsList { - if _, found := fieldsMap[finfo.Key]; found { - msg := "duplicated key '" + finfo.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - if finfo.Inline == nil { - finfo.Inline = []int{i, finfo.Num} - } else { - finfo.Inline = append([]int{i}, finfo.Inline...) - } - finfo.Id = len(fieldsList) - fieldsMap[finfo.Key] = finfo - fieldsList = append(fieldsList, finfo) - } - } - default: - return nil, errors.New("option ,inline may only be used on a struct or map field") - } - continue - } - - if tag != "" { - info.Key = tag - } else { - info.Key = strings.ToLower(field.Name) - } - - if _, found = fieldsMap[info.Key]; found { - msg := "duplicated key '" + info.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - - info.Id = len(fieldsList) - fieldsList = append(fieldsList, info) - fieldsMap[info.Key] = info - } - - sinfo = &structInfo{ - FieldsMap: fieldsMap, - FieldsList: fieldsList, - InlineMap: inlineMap, - InlineConstructors: inlineConstructors, - } - - fieldMapMutex.Lock() - structMap[st] = sinfo - fieldMapMutex.Unlock() - return sinfo, nil +// constructorAdapter is an interface that wraps the root package's Unmarshaler +// interface. +// This allows the constructor to call constructors that expect *yaml.Node +// instead of *libyaml.Node. +type constructorAdapter interface { + CallRootConstructor(n *Node) error } -// isZero reports whether v represents the zero value for its type. -// If v implements the IsZeroer interface, IsZero() is called. -// Otherwise, zero is determined by checking type-specific conditions. -// This is used to determine omitempty behavior when marshaling. -func isZero(v reflect.Value) bool { - kind := v.Kind() - if z, ok := v.Interface().(IsZeroer); ok { - if (kind == reflect.Pointer || kind == reflect.Interface) && v.IsNil() { - return true - } - return z.IsZero() - } - switch kind { - case reflect.String: - return len(v.String()) == 0 - case reflect.Interface, reflect.Pointer: - return v.IsNil() - case reflect.Slice: - return v.Len() == 0 - case reflect.Map: - return v.Len() == 0 - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Bool: - return !v.Bool() - case reflect.Struct: - vt := v.Type() - for i := v.NumField() - 1; i >= 0; i-- { - if vt.Field(i).PkgPath != "" { - continue // Private field - } - if !isZero(v.Field(i)) { - return false - } - } - return true - } - return false -} +// ScalarConstructFunc is the signature for tag-specific scalar constructor +// functions. +// Each function handles construction of a specific YAML tag to various Go +// types. +type ScalarConstructFunc func(c *Constructor, n *Node, resolved any, out reflect.Value) bool +// Constructor state type Constructor struct { doc *Node aliases map[*Node]bool - TypeErrors []*ConstructError + TypeErrors []*LoadError stringMapType reflect.Type generalMapType reflect.Type @@ -316,18 +53,13 @@ type Constructor struct { constructCount int aliasCount int aliasDepth int + aliasCheck func(aliasCount, constructCount int) error mergedFields map[any]bool } -var ( - nodeType = reflect.TypeOf(Node{}) - durationType = reflect.TypeOf(time.Duration(0)) - stringMapType = reflect.TypeOf(map[string]any{}) - generalMapType = reflect.TypeOf(map[any]any{}) - ifaceType = generalMapType.Elem() -) - +// NewConstructor creates a new Constructor initialized with the provided +// options. func NewConstructor(opts *Options) *Constructor { return &Constructor{ stringMapType: stringMapType, @@ -335,434 +67,143 @@ func NewConstructor(opts *Options) *Constructor { KnownFields: opts.KnownFields, UniqueKeys: opts.UniqueKeys, aliases: make(map[*Node]bool), + aliasCheck: opts.AliasCheck, } } -// Construct decodes YAML input into the provided output value. -// The out parameter must be a pointer to the value to decode into. -// Returns a [LoadErrors] if type mismatches occur during decoding. -func Construct(in []byte, out any, opts *Options) error { - d := NewConstructor(opts) - p := NewComposer(in) - defer p.Destroy() - node := p.Parse() - if node != nil { - v := reflect.ValueOf(out) - if v.Kind() == reflect.Pointer && !v.IsNil() { - v = v.Elem() - } - d.Construct(node, v) - } - if len(d.TypeErrors) > 0 { - return &LoadErrors{Errors: d.TypeErrors} - } - return nil -} - -func (c *Constructor) tagError(n *Node, tag string, out reflect.Value) { - if n.Tag != "" { - tag = n.Tag - } - value := n.Value - if tag != seqTag && tag != mapTag { - if len(value) > 10 { - value = " `" + value[:7] + "...`" - } else { - value = " `" + value + "`" - } - } - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: fmt.Errorf("cannot construct %s%s into %s", shortTag(tag), value, out.Type()), - Line: n.Line, - Column: n.Column, - }) -} - -func (c *Constructor) callConstructor(n *Node, u constructor) (good bool) { - err := u.UnmarshalYAML(n) - switch e := err.(type) { - case nil: - return true - case *LoadErrors: - c.TypeErrors = append(c.TypeErrors, e.Errors...) - return false - default: - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: err, - Line: n.Line, - Column: n.Column, - }) - return false - } -} - -func (c *Constructor) callObsoleteConstructor(n *Node, u obsoleteConstructor) (good bool) { - terrlen := len(c.TypeErrors) - err := u.UnmarshalYAML(func(v any) (err error) { - defer handleErr(&err) - c.Construct(n, reflect.ValueOf(v)) - if len(c.TypeErrors) > terrlen { - issues := c.TypeErrors[terrlen:] - c.TypeErrors = c.TypeErrors[:terrlen] - return &LoadErrors{issues} - } - return nil - }) - switch e := err.(type) { - case nil: - return true - case *LoadErrors: - c.TypeErrors = append(c.TypeErrors, e.Errors...) - return false - default: - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: err, - Line: n.Line, - Column: n.Column, - }) - return false - } -} - -func isTextUnmarshaler(out reflect.Value) bool { - // Dereference pointers to check the underlying type, - // similar to how prepare() handles Constructor checks. - for out.Kind() == reflect.Pointer { - if out.IsNil() { - // Create a new instance to check the type - out = reflect.New(out.Type().Elem()).Elem() - } else { - out = out.Elem() - } - } - if out.CanAddr() { - _, ok := out.Addr().Interface().(encoding.TextUnmarshaler) - return ok - } - return false -} - -// prepare initializes and dereferences pointers and calls UnmarshalYAML -// if a value is found to implement it. -// It returns the initialized and dereferenced out value, whether -// construction was already done by UnmarshalYAML, and if so whether -// its types constructed appropriately. -// -// If n holds a null value, prepare returns before doing anything. -func (c *Constructor) prepare(n *Node, out reflect.Value) (newout reflect.Value, constructed, good bool) { - if n.ShortTag() == nullTag { - return out, false, false - } - again := true - for again { - again = false - if out.Kind() == reflect.Pointer { - if out.IsNil() { - out.Set(reflect.New(out.Type().Elem())) - } - out = out.Elem() - again = true - } - if out.CanAddr() { - // Try yaml.Unmarshaler (from root package) first - if called, good := c.tryCallYAMLConstructor(n, out); called { - return out, true, good - } - - outi := out.Addr().Interface() - // Check for libyaml.constructor - if u, ok := outi.(constructor); ok { - good = c.callConstructor(n, u) - return out, true, good - } - if u, ok := outi.(obsoleteConstructor); ok { - good = c.callObsoleteConstructor(n, u) - return out, true, good - } - } - } - return out, false, false -} - -func (c *Constructor) fieldByIndex(n *Node, v reflect.Value, index []int) (field reflect.Value) { - if n.ShortTag() == nullTag { - return reflect.Value{} - } - for _, num := range index { - for { - if v.Kind() == reflect.Pointer { - if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) - } - v = v.Elem() - continue - } - break - } - v = v.Field(num) - } - return v -} - -const ( - // 400,000 decode operations is ~500kb of dense object declarations, or - // ~5kb of dense object declarations with 10000% alias expansion - alias_ratio_range_low = 400000 - - // 4,000,000 decode operations is ~5MB of dense object declarations, or - // ~4.5MB of dense object declarations with 10% alias expansion - alias_ratio_range_high = 4000000 - - // alias_ratio_range is the range over which we scale allowed alias ratios - alias_ratio_range = float64(alias_ratio_range_high - alias_ratio_range_low) -) - -func allowedAliasRatio(constructCount int) float64 { - switch { - case constructCount <= alias_ratio_range_low: - // allow 99% to come from alias expansion for small-to-medium documents - return 0.99 - case constructCount >= alias_ratio_range_high: - // allow 10% to come from alias expansion for very large documents - return 0.10 - default: - // scale smoothly from 99% down to 10% over the range. - // this maps to 396,000 - 400,000 allowed alias-driven decodes over the range. - // 400,000 decode operations is ~100MB of allocations in worst-case scenarios (single-item maps). - return 0.99 - 0.89*(float64(constructCount-alias_ratio_range_low)/alias_ratio_range) - } -} - -// constructorAdapter is an interface that wraps the root package's Unmarshaler interface. -// This allows the constructor to call constructors that expect *yaml.Node instead of *libyaml.Node. -type constructorAdapter interface { - CallRootConstructor(n *Node) error -} - -// tryCallYAMLConstructor checks if the value has an UnmarshalYAML method that takes -// a *yaml.Node (from the root package) and calls it if found. -// This handles the case where user types implement yaml.Unmarshaler instead of libyaml.constructor. -func (c *Constructor) tryCallYAMLConstructor(n *Node, out reflect.Value) (called bool, good bool) { - if !out.CanAddr() { - return false, false - } - - addr := out.Addr() - // Check for UnmarshalYAML method - method := addr.MethodByName("UnmarshalYAML") - if !method.IsValid() { - return false, false - } - - // Check method signature: func(*yaml.Node) error - mtype := method.Type() - if mtype.NumIn() != 1 || mtype.NumOut() != 1 { - return false, false - } - - // Check if parameter is a pointer to a Node-like struct - paramType := mtype.In(0) - if paramType.Kind() != reflect.Ptr { - return false, false - } - - elemType := paramType.Elem() - if elemType.Kind() != reflect.Struct { - return false, false - } - - // Check if it's the same underlying type as our Node - // Both yaml.Node and libyaml.Node have the same structure - if elemType.Name() != "Node" { - return false, false - } - - // Call the method with a converted node - // Since yaml.Node and libyaml.Node have the same structure, - // we can convert using unsafe pointer cast - nodeValue := reflect.NewAt(elemType, reflect.ValueOf(n).UnsafePointer()) - - results := method.Call([]reflect.Value{nodeValue}) - err := results[0].Interface() - - if err == nil { - return true, true - } - - switch e := err.(type) { - case *LoadErrors: - c.TypeErrors = append(c.TypeErrors, e.Errors...) - return true, false - default: - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: e.(error), - Line: n.Line, - Column: n.Column, - }) - return true, false - } -} +// -------------------------------------------------------------------------- +// Main Entry Point +// Construct converts a YAML node into the Go value represented by out. +// It dispatches to the appropriate handler based on the node kind and +// handles alias expansion, custom unmarshalers, and type resolution. +// Returns true if the construction was successful. func (c *Constructor) Construct(n *Node, out reflect.Value) (good bool) { c.constructCount++ if c.aliasDepth > 0 { c.aliasCount++ } - if c.aliasCount > 100 && c.constructCount > 1000 && float64(c.aliasCount)/float64(c.constructCount) > allowedAliasRatio(c.constructCount) { - failf("document contains excessive aliasing") + if c.aliasCheck != nil { + if err := c.aliasCheck(c.aliasCount, c.constructCount); err != nil { + Fail(formatConstructorError(err, Mark{Line: n.Line, Column: n.Column})) + } } if out.Type() == nodeType { out.Set(reflect.ValueOf(n).Elem()) return true } - // When out type implements [encoding.TextUnmarshaler], ensure the node is - // a scalar. Otherwise, for example, constructing a YAML mapping into - // a struct having no exported fields, but implementing TextUnmarshaler - // would silently succeed, but do nothing. - // - // Note that this matches the behavior of both encoding/json and encoding/json/v2. - if n.Kind != ScalarNode && isTextUnmarshaler(out) { - err := fmt.Errorf("cannot construct %s into %s (TextUnmarshaler)", shortTag(n.Tag), out.Type()) - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: err, - Line: n.Line, - Column: n.Column, - }) - return false - } switch n.Kind { case DocumentNode: return c.document(n, out) - case AliasNode: - return c.alias(n, out) - } - out, constructed, good := c.prepare(n, out) - if constructed { - return good - } - switch n.Kind { - case ScalarNode: - good = c.scalar(n, out) - case MappingNode: - good = c.mapping(n, out) - case SequenceNode: - good = c.sequence(n, out) - case 0: - if n.IsZero() { - return c.null(out) - } - fallthrough - default: - failf("cannot construct node with unknown kind %d", n.Kind) - } - return good -} - -func (c *Constructor) document(n *Node, out reflect.Value) (good bool) { - if len(n.Content) == 1 { - c.doc = n - c.Construct(n.Content[0], out) - return true - } - return false -} - -func (c *Constructor) alias(n *Node, out reflect.Value) (good bool) { - if c.aliases[n] { - // TODO this could actually be allowed in some circumstances. - failf("anchor '%s' value contains itself", n.Value) - } - c.aliases[n] = true - c.aliasDepth++ - good = c.Construct(n.Alias, out) - c.aliasDepth-- - delete(c.aliases, n) - return good -} - -func (c *Constructor) null(out reflect.Value) bool { - if out.CanAddr() { - switch out.Kind() { - case reflect.Interface, reflect.Pointer, reflect.Map, reflect.Slice: - out.Set(reflect.Zero(out.Type())) - return true - } - } - return false -} - -func (c *Constructor) scalar(n *Node, out reflect.Value) bool { - var tag string - var resolved any - if n.indicatedString() { - tag = strTag - resolved = n.Value - } else { - tag, resolved = resolve(n.Tag, n.Value) - if tag == binaryTag { - data, err := base64.StdEncoding.DecodeString(resolved.(string)) - if err != nil { - failf("!!binary value contains invalid base64 data") - } - resolved = string(data) - } + case AliasNode: + return c.alias(n, out) } - if resolved == nil { - return c.null(out) + + out, constructed, good := c.prepare(n, out) + if constructed { + return good } - if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { - // We've resolved to exactly the type we want, so use that. - out.Set(resolvedv) - return true + + // When out type implements [encoding.TextUnmarshaler], ensure the node + // is a scalar. Otherwise, for example, constructing a YAML mapping + // into a struct having no exported fields, but implementing + // TextUnmarshaler would silently succeed, but do nothing. + // + // Note that this matches the behavior of both encoding/json and + // encoding/json/v2. + if n.Kind != ScalarNode && isTextUnmarshaler(out) { + err := fmt.Errorf("cannot construct %s into %s (TextUnmarshaler)", shortTag(n.Tag), out.Type()) + c.TypeErrors = append(c.TypeErrors, + formatConstructorError(err, Mark{Line: n.Line, Column: n.Column})) + return false } - // Perhaps we can use the value as a TextUnmarshaler to - // set its value. - if out.CanAddr() { - u, ok := out.Addr().Interface().(encoding.TextUnmarshaler) - if ok { - var text []byte - if tag == binaryTag { - text = []byte(resolved.(string)) - } else { - // We let any value be constructed into TextUnmarshaler. - // That might be more lax than we'd like, but the - // TextUnmarshaler itself should bowl out any dubious values. - text = []byte(n.Value) - } - err := u.UnmarshalText(text) - if err != nil { - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: err, - Line: n.Line, - Column: n.Column, - }) - return false - } - return true + + switch n.Kind { + case ScalarNode: + good = c.scalar(n, out) + case MappingNode: + good = c.mapping(n, out) + case SequenceNode: + good = c.sequence(n, out) + case 0: + if n.IsZero() { + return c.null(out) } + fallthrough + default: + Fail(formatConstructorError( + fmt.Errorf("cannot construct node with unknown kind: '%d'", n.Kind), + Mark{Line: n.Line, Column: n.Column}, + )) } + return good +} + +// -------------------------------------------------------------------------- +// Package-level Variables and Constants +var ( + nodeType = reflect.TypeOf(Node{}) + durationType = reflect.TypeOf(time.Duration(0)) + stringMapType = reflect.TypeOf(map[string]any{}) + generalMapType = reflect.TypeOf(map[any]any{}) + ifaceType = generalMapType.Elem() +) + +// scalarConstructors maps YAML scalar tags to their constructor functions. +var scalarConstructors = map[string]ScalarConstructFunc{ + strTag: (*Constructor).constructStr, + intTag: (*Constructor).constructInt, + boolTag: (*Constructor).constructBool, + floatTag: (*Constructor).constructFloat, + nullTag: (*Constructor).constructNull, + timestampTag: (*Constructor).constructTimestamp, + binaryTag: (*Constructor).constructBinary, + mergeTag: (*Constructor).constructMerge, +} + +// -------------------------------------------------------------------------- +// Scalar tag constructors + +// constructStr constructs a !!str tagged value into various Go types. +func (c *Constructor) constructStr(n *Node, resolved any, out reflect.Value) bool { switch out.Kind() { case reflect.String: - if tag == binaryTag { - out.SetString(resolved.(string)) - return true - } out.SetString(n.Value) return true - case reflect.Slice: - // allow decoding !!binary-tagged value into []byte specifically - if out.Type().Elem().Kind() == reflect.Uint8 { - if tag == binaryTag { - out.SetBytes([]byte(resolved.(string))) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + // Handle time.Duration parsing from strings like "3s", "1m", + // etc. + if out.Type() == durationType { + d, err := time.ParseDuration(n.Value) + if err == nil { + out.SetInt(int64(d)) return true } } + case reflect.Bool: + // YAML 1.1 compatibility: allow string values like "y", "on", + // "Off" as bools + switch n.Value { + case "y", "Y", "yes", "Yes", "YES", "on", "On", "ON": + out.SetBool(true) + return true + case "n", "N", "no", "No", "NO", "off", "Off", "OFF": + out.SetBool(false) + return true + } case reflect.Interface: out.Set(reflect.ValueOf(resolved)) return true + } + c.tagError(n, strTag, out) + return false +} + +// constructInt constructs a !!int tagged value into various Go types. +func (c *Constructor) constructInt(n *Node, resolved any, out reflect.Value) bool { + switch out.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - // This used to work in v2, but it's very unfriendly. isDuration := out.Type() == durationType switch resolved := resolved.(type) { @@ -790,7 +231,8 @@ func (c *Constructor) scalar(n *Node, out reflect.Value) bool { case float64: if !isDuration && resolved >= math.MinInt64 && resolved <= math.MaxInt64 { intVal := int64(resolved) - // Verify conversion is lossless (handles floating-point precision) + // Verify conversion is lossless (handles + // floating-point precision) if float64(intVal) == resolved && !out.OverflowInt(intVal) { out.SetInt(intVal) return true @@ -825,21 +267,52 @@ func (c *Constructor) scalar(n *Node, out reflect.Value) bool { case float64: if resolved >= 0 && resolved <= math.MaxUint64 { uintVal := uint64(resolved) - // Verify conversion is lossless (handles floating-point precision) + // Verify conversion is lossless (handles + // floating-point precision) if float64(uintVal) == resolved && !out.OverflowUint(uintVal) { out.SetUint(uintVal) return true } } } + case reflect.Float32, reflect.Float64: + // Allow int to float conversion + switch resolved := resolved.(type) { + case int: + out.SetFloat(float64(resolved)) + return true + case int64: + out.SetFloat(float64(resolved)) + return true + case uint64: + out.SetFloat(float64(resolved)) + return true + } + case reflect.String: + // Allow int to string conversion + out.SetString(n.Value) + return true + case reflect.Interface: + out.Set(reflect.ValueOf(resolved)) + return true + } + c.tagError(n, intTag, out) + return false +} + +// constructBool constructs a !!bool tagged value into various Go types. +func (c *Constructor) constructBool(n *Node, resolved any, out reflect.Value) bool { + switch out.Kind() { case reflect.Bool: switch resolved := resolved.(type) { case bool: out.SetBool(resolved) return true case string: - // This offers some compatibility with the 1.1 spec (https://yaml.org/type/bool.html). - // It only works if explicitly attempting to construct into a typed bool value. + // This offers some compatibility with the 1.1 spec + // (https://yaml.org/type/bool.html). + // It only works if explicitly attempting to construct + // into a typed bool value. switch resolved { case "y", "Y", "yes", "Yes", "YES", "on", "On", "ON": out.SetBool(true) @@ -849,6 +322,21 @@ func (c *Constructor) scalar(n *Node, out reflect.Value) bool { return true } } + case reflect.String: + // Allow bool to be constructed as string (e.g., true -> "true") + out.SetString(n.Value) + return true + case reflect.Interface: + out.Set(reflect.ValueOf(resolved)) + return true + } + c.tagError(n, boolTag, out) + return false +} + +// constructFloat constructs a !!float tagged value into various Go types. +func (c *Constructor) constructFloat(n *Node, resolved any, out reflect.Value) bool { + switch out.Kind() { case reflect.Float32, reflect.Float64: switch resolved := resolved.(type) { case int: @@ -864,25 +352,198 @@ func (c *Constructor) scalar(n *Node, out reflect.Value) bool { out.SetFloat(resolved) return true } + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + // Allow float to int conversion if lossless + if fval, ok := resolved.(float64); ok { + if fval >= math.MinInt64 && fval <= math.MaxInt64 { + intVal := int64(fval) + if float64(intVal) == fval && !out.OverflowInt(intVal) { + out.SetInt(intVal) + return true + } + } + } + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + // Allow float to uint conversion if lossless + if fval, ok := resolved.(float64); ok { + if fval >= 0 && fval <= math.MaxUint64 { + uintVal := uint64(fval) + if float64(uintVal) == fval && !out.OverflowUint(uintVal) { + out.SetUint(uintVal) + return true + } + } + } + case reflect.String: + out.SetString(n.Value) + return true + case reflect.Interface: + out.Set(reflect.ValueOf(resolved)) + return true + } + c.tagError(n, floatTag, out) + return false +} + +// constructTimestamp constructs a !!timestamp tagged value into various Go +// types. +func (c *Constructor) constructTimestamp(n *Node, resolved any, out reflect.Value) bool { + switch out.Kind() { case reflect.Struct: if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { out.Set(resolvedv) return true } - case reflect.Pointer: - panic("yaml internal error: please report the issue") + case reflect.Interface: + out.Set(reflect.ValueOf(resolved)) + return true } - c.tagError(n, tag, out) + c.tagError(n, timestampTag, out) return false } -func settableValueOf(i any) reflect.Value { - v := reflect.ValueOf(i) - sv := reflect.New(v.Type()).Elem() - sv.Set(v) - return sv +// constructBinary constructs a !!binary tagged value into various Go types. +func (c *Constructor) constructBinary(n *Node, resolved any, out reflect.Value) bool { + switch out.Kind() { + case reflect.String: + out.SetString(resolved.(string)) + return true + case reflect.Slice: + // allow decoding !!binary-tagged value into []byte specifically + if out.Type().Elem().Kind() == reflect.Uint8 { + out.SetBytes([]byte(resolved.(string))) + return true + } + case reflect.Interface: + out.Set(reflect.ValueOf(resolved)) + return true + } + c.tagError(n, binaryTag, out) + return false +} + +// constructNull constructs a !!null tagged value into various Go types. +func (c *Constructor) constructNull(n *Node, resolved any, out reflect.Value) bool { + return c.null(out) +} + +// constructMerge handles !!merge tagged keys. +// Merge keys are directives, not values, so construction always fails. +// They are handled specially by the mapping() function. +func (c *Constructor) constructMerge(n *Node, resolved any, out reflect.Value) bool { + return false +} + +// -------------------------------------------------------------------------- +// Node Kind Handlers + +// document constructs a DocumentNode by processing its single content node. +func (c *Constructor) document(n *Node, out reflect.Value) (good bool) { + if len(n.Content) == 1 { + c.doc = n + c.Construct(n.Content[0], out) + return true + } + return false +} + +// alias constructs an AliasNode by following the alias reference and +// tracking alias depth to detect circular references. +func (c *Constructor) alias(n *Node, out reflect.Value) (good bool) { + if c.aliases[n] { + // TODO this could actually be allowed in some circumstances. + Fail(formatComposerError( + fmt.Sprintf("anchor '%s' value contains itself", n.Value), + Mark{Line: n.Line, Column: n.Column}, + )) + } + c.aliases[n] = true + c.aliasDepth++ + good = c.Construct(n.Alias, out) + c.aliasDepth-- + delete(c.aliases, n) + return good +} + +// scalar constructs a ScalarNode by resolving its tag and value, then +// dispatching to the appropriate tag-specific constructor or using +// TextUnmarshaler if available. +func (c *Constructor) scalar(n *Node, out reflect.Value) bool { + // Resolve the tag and value + var tag string + var resolved any + if n.indicatedString() { + tag = strTag + resolved = n.Value + } else { + tag, resolved = resolve(n.Tag, n.Value) + if tag == binaryTag { + data, err := base64.StdEncoding.DecodeString(resolved.(string)) + if err != nil { + Fail(formatConstructorError( + fmt.Errorf("!!binary value contains invalid base64 data"), + Mark{Line: n.Line, Column: n.Column}, + )) + } + resolved = string(data) + } + } + + // Handle null + if resolved == nil { + return c.null(out) + } + + // Fast path: exact type match + if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { + out.Set(resolvedv) + return true + } + + // Handle TextUnmarshaler interface + if out.CanAddr() { + u, ok := out.Addr().Interface().(encoding.TextUnmarshaler) + if ok { + var text []byte + if tag == binaryTag { + text = []byte(resolved.(string)) + } else { + text = []byte(n.Value) + } + err := u.UnmarshalText(text) + if err != nil { + c.TypeErrors = append(c.TypeErrors, formatConstructorError(err, Mark{Line: n.Line, Column: n.Column})) + return false + } + return true + } + } + + // Dispatch to tag-specific constructor + if constructor, ok := scalarConstructors[tag]; ok { + return constructor(c, n, resolved, out) + } + + // Unknown tag - try some fallback behaviors + switch out.Kind() { + case reflect.Interface: + // For interface{} targets, accept any resolved value + out.Set(reflect.ValueOf(resolved)) + return true + case reflect.Struct: + // For struct targets with matching types, try direct assignment + if resolvedv := reflect.ValueOf(resolved); out.Type() == resolvedv.Type() { + out.Set(resolvedv) + return true + } + } + + // No constructor and no fallback worked + c.tagError(n, tag, out) + return false } +// sequence constructs a SequenceNode into a Go slice, array, or interface. func (c *Constructor) sequence(n *Node, out reflect.Value) (good bool) { l := len(n.Content) @@ -892,7 +553,10 @@ func (c *Constructor) sequence(n *Node, out reflect.Value) (good bool) { out.Set(reflect.MakeSlice(out.Type(), l, l)) case reflect.Array: if l != out.Len() { - failf("invalid array: want %d elements but got %d", out.Len(), l) + Fail(formatConstructorError( + fmt.Errorf("invalid array: want %d elements but got %d", out.Len(), l), + Mark{Line: n.Line, Column: n.Column}, + )) } case reflect.Interface: // No type hints. Will have to use a generic sequence. @@ -921,6 +585,9 @@ func (c *Constructor) sequence(n *Node, out reflect.Value) (good bool) { return true } +// mapping constructs a MappingNode into a Go map, struct, or interface. +// It handles key uniqueness checking, merge keys, and type-appropriate +// map construction (string-keyed vs general). func (c *Constructor) mapping(n *Node, out reflect.Value) (good bool) { l := len(n.Content) if c.UniqueKeys { @@ -930,11 +597,10 @@ func (c *Constructor) mapping(n *Node, out reflect.Value) (good bool) { for j := i + 2; j < l; j += 2 { nj := n.Content[j] if ni.Kind == nj.Kind && ni.Value == nj.Value { - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: fmt.Errorf("mapping key %#v already defined at line %d", nj.Value, ni.Line), - Line: nj.Line, - Column: nj.Column, - }) + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + fmt.Errorf("mapping key %#v already defined at line %d", nj.Value, ni.Line), + Mark{Line: nj.Line, Column: nj.Column}, + )) } } } @@ -993,17 +659,20 @@ func (c *Constructor) mapping(n *Node, out reflect.Value) (good bool) { if c.Construct(n.Content[i], k) { if mergedFields != nil { ki := k.Interface() - if c.getPossiblyUnhashableKey(mergedFields, ki) { + if c.getPossiblyUnhashableKey(mergedFields, ki, n.Content[i]) { continue } - c.setPossiblyUnhashableKey(mergedFields, ki, true) + c.setPossiblyUnhashableKey(mergedFields, ki, true, n.Content[i]) } kkind := k.Kind() if kkind == reflect.Interface { kkind = k.Elem().Kind() } if kkind == reflect.Map || kkind == reflect.Slice { - failf("cannot use '%#v' as a map key; try decoding into yaml.Node", k.Interface()) + Fail(formatConstructorError( + fmt.Errorf("cannot use '%#v' as a map key; try decoding into yaml.Node", k.Interface()), + Mark{Line: n.Content[i].Line, Column: n.Content[i].Column}, + )) } e := reflect.New(et).Elem() if c.Construct(n.Content[i+1], e) || n.Content[i+1].ShortTag() == nullTag && (mapIsNew || !out.MapIndex(k).IsValid()) { @@ -1022,20 +691,12 @@ func (c *Constructor) mapping(n *Node, out reflect.Value) (good bool) { return true } -func isStringMap(n *Node) bool { - if n.Kind != MappingNode { - return false - } - l := len(n.Content) - for i := 0; i < l; i += 2 { - shortTag := n.Content[i].ShortTag() - if shortTag != strTag && shortTag != mergeTag { - return false - } - } - return true -} - +// -------------------------------------------------------------------------- +// Mapping/Struct Support + +// mappingStruct constructs a MappingNode into a struct value. +// It handles field matching by name, inline fields, inline maps, merge keys, +// and enforces known fields and unique keys when configured. func (c *Constructor) mappingStruct(n *Node, out reflect.Value) (good bool) { sinfo, err := getStructInfo(out.Type()) if err != nil { @@ -1082,11 +743,10 @@ func (c *Constructor) mappingStruct(n *Node, out reflect.Value) (good bool) { if info, ok := sinfo.FieldsMap[sname]; ok { if c.UniqueKeys { if doneFields[info.Id] { - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: fmt.Errorf("field %s already set in type %s", name.String(), out.Type()), - Line: ni.Line, - Column: ni.Column, - }) + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + fmt.Errorf("field %s already set in type %s", name.String(), out.Type()), + Mark{Line: ni.Line, Column: ni.Column}, + )) continue } doneFields[info.Id] = true @@ -1106,11 +766,10 @@ func (c *Constructor) mappingStruct(n *Node, out reflect.Value) (good bool) { c.Construct(n.Content[i+1], value) inlineMap.SetMapIndex(name, value) } else if c.KnownFields { - c.TypeErrors = append(c.TypeErrors, &ConstructError{ - Err: fmt.Errorf("field %s not found in type %s", name.String(), out.Type()), - Line: ni.Line, - Column: ni.Column, - }) + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + fmt.Errorf("field %s not found in type %s", name.String(), out.Type()), + Mark{Line: ni.Line, Column: ni.Column}, + )) } } @@ -1121,28 +780,10 @@ func (c *Constructor) mappingStruct(n *Node, out reflect.Value) (good bool) { return true } -func failWantMap() { - failf("map merge requires map or sequence of maps as the value") -} - -func (c *Constructor) setPossiblyUnhashableKey(m map[any]bool, key any, value bool) { - defer func() { - if err := recover(); err != nil { - failf("%v", err) - } - }() - m[key] = value -} - -func (c *Constructor) getPossiblyUnhashableKey(m map[any]bool, key any) bool { - defer func() { - if err := recover(); err != nil { - failf("%v", err) - } - }() - return m[key] -} - +// merge processes a merge key (<<) by constructing the merge value into out. +// The merge value can be a single mapping, an alias to a mapping, or a +// sequence of mappings. +// Fields from the parent mapping take precedence over merged fields. func (c *Constructor) merge(parent *Node, merge *Node, out reflect.Value) { mergedFields := c.mergedFields if mergedFields == nil { @@ -1150,7 +791,7 @@ func (c *Constructor) merge(parent *Node, merge *Node, out reflect.Value) { for i := 0; i < len(parent.Content); i += 2 { k := reflect.New(ifaceType).Elem() if c.Construct(parent.Content[i], k) { - c.setPossiblyUnhashableKey(c.mergedFields, k.Interface(), true) + c.setPossiblyUnhashableKey(c.mergedFields, k.Interface(), true, parent.Content[i]) } } } @@ -1160,7 +801,7 @@ func (c *Constructor) merge(parent *Node, merge *Node, out reflect.Value) { c.Construct(merge, out) case AliasNode: if merge.Alias != nil && merge.Alias.Kind != MappingNode { - failWantMap() + failWantMap(merge.Alias) } c.Construct(merge, out) case SequenceNode: @@ -1168,20 +809,344 @@ func (c *Constructor) merge(parent *Node, merge *Node, out reflect.Value) { ni := merge.Content[i] if ni.Kind == AliasNode { if ni.Alias != nil && ni.Alias.Kind != MappingNode { - failWantMap() + failWantMap(ni.Alias) } } else if ni.Kind != MappingNode { - failWantMap() + failWantMap(ni) } c.Construct(ni, out) } default: - failWantMap() + failWantMap(merge) } c.mergedFields = mergedFields } +// isStringMap checks if a MappingNode has only string or merge keys. +// This determines whether to use map[string]any or map[any]any when +// constructing into an interface{}. +func isStringMap(n *Node) bool { + if n.Kind != MappingNode { + return false + } + l := len(n.Content) + for i := 0; i < l; i += 2 { + shortTag := n.Content[i].ShortTag() + if shortTag != strTag && shortTag != mergeTag { + return false + } + } + return true +} + +// isMerge checks if a node is a merge key (!!merge tag). func isMerge(n *Node) bool { return n.Kind == ScalarNode && shortTag(n.Tag) == mergeTag } + +// failWantMap panics with an error message for invalid merge key values. +func failWantMap(n *Node) { + Fail(formatConstructorError( + fmt.Errorf("map merge requires map or sequence of maps as the value"), + Mark{Line: n.Line, Column: n.Column}, + )) +} + +// -------------------------------------------------------------------------- +// Utility Methods + +// prepare initializes and dereferences pointers and calls UnmarshalYAML +// if a value is found to implement it. +// It returns the initialized and dereferenced out value, whether +// construction was already done by UnmarshalYAML, and if so whether +// its types constructed appropriately. +// +// If n holds a null value, prepare returns before doing anything. +func (c *Constructor) prepare(n *Node, out reflect.Value) (newout reflect.Value, constructed, good bool) { + if n.ShortTag() == nullTag { + return out, false, false + } + again := true + for again { + again = false + if out.Kind() == reflect.Pointer { + if out.IsNil() { + out.Set(reflect.New(out.Type().Elem())) + } + out = out.Elem() + again = true + } + if out.CanAddr() { + // Try yaml.Unmarshaler (from root package) first + if called, good := c.tryCallYAMLConstructor(n, out); called { + return out, true, good + } + + outi := out.Addr().Interface() + // Check for libyaml.constructor + if u, ok := outi.(constructor); ok { + good = c.callConstructor(n, u) + return out, true, good + } + if u, ok := outi.(legacyConstructor); ok { + good = c.callLegacyConstructor(n, u) + return out, true, good + } + } + } + return out, false, false +} + +// fieldByIndex returns the struct field at the given index path, initializing +// any nil pointers along the way. +func (c *Constructor) fieldByIndex(n *Node, v reflect.Value, index []int) (field reflect.Value) { + if n.ShortTag() == nullTag { + return reflect.Value{} + } + for _, num := range index { + for { + if v.Kind() == reflect.Pointer { + if v.IsNil() { + v.Set(reflect.New(v.Type().Elem())) + } + v = v.Elem() + continue + } + break + } + v = v.Field(num) + } + return v +} + +// tryCallYAMLConstructor checks if the value has an UnmarshalYAML method that +// takes a *Node from an allowlisted v3 yaml package and calls it if found. +// This handles backward compatibility with types that implement the v3 +// yaml.Unmarshaler interface instead of the native libyaml.constructor. +func (c *Constructor) tryCallYAMLConstructor(n *Node, out reflect.Value) (called bool, good bool) { + if !out.CanAddr() { + return false, false + } + + addr := out.Addr() + // Check for UnmarshalYAML method + method := addr.MethodByName("UnmarshalYAML") + if !method.IsValid() { + return false, false + } + + // Check method signature: func(*yaml.Node) error + mtype := method.Type() + if mtype.NumIn() != 1 || mtype.NumOut() != 1 { + return false, false + } + + // Check if parameter is a pointer to a Node-like struct + paramType := mtype.In(0) + if paramType.Kind() != reflect.Ptr { + return false, false + } + + elemType := paramType.Elem() + if elemType.Kind() != reflect.Struct { + return false, false + } + + // Only accept *Node from allowlisted v3 yaml packages whose Node type + // is assumed to have a compatible memory layout with libyaml.Node. + // The unsafe pointer cast below is only safe for these packages. + if elemType.Name() != "Node" || !isYAMLNodePkg(elemType.PkgPath()) { + return false, false + } + + // Return type must be error + retType := mtype.Out(0) + if retType.Kind() != reflect.Interface || retType.Name() != "error" { + return false, false + } + + // Call the method with a converted node. + // The allowlisted v3 packages define their own Node type that is + // assumed to have a compatible memory layout with libyaml.Node. + nodeValue := reflect.NewAt(elemType, reflect.ValueOf(n).UnsafePointer()) + + results := method.Call([]reflect.Value{nodeValue}) + err := results[0].Interface() + + if err == nil { + return true, true + } + + switch e := err.(type) { + case *LoadErrors: + c.TypeErrors = append(c.TypeErrors, e.Errors...) + return true, false + default: + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + err.(error), + Mark{Line: n.Line, Column: n.Column}, + )) + return true, false + } +} + +// callConstructor invokes the UnmarshalYAML method on a value implementing +// the constructor interface, handling errors appropriately. +func (c *Constructor) callConstructor(n *Node, u constructor) (good bool) { + err := u.UnmarshalYAML(n) + switch e := err.(type) { + case nil: + return true + case *LoadErrors: + c.TypeErrors = append(c.TypeErrors, e.Errors...) + return false + default: + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + err, + Mark{Line: n.Line, Column: n.Column}, + )) + return false + } +} + +// callLegacyConstructor invokes the UnmarshalYAML method on a value +// implementing the old-style legacyConstructor interface. +func (c *Constructor) callLegacyConstructor(n *Node, u legacyConstructor) (good bool) { + terrlen := len(c.TypeErrors) + err := u.UnmarshalYAML(func(v any) (err error) { + defer handleErr(&err) + c.Construct(n, reflect.ValueOf(v)) + if len(c.TypeErrors) > terrlen { + issues := c.TypeErrors[terrlen:] + c.TypeErrors = c.TypeErrors[:terrlen] + return &LoadErrors{issues} + } + return nil + }) + switch e := err.(type) { + case nil: + return true + case *LoadErrors: + c.TypeErrors = append(c.TypeErrors, e.Errors...) + return false + default: + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + err, + Mark{Line: n.Line, Column: n.Column}, + )) + return false + } +} + +// tagError records a type construction error indicating that a node with a +// given tag cannot be constructed into the target type. +func (c *Constructor) tagError(n *Node, tag string, out reflect.Value) { + if n.Tag != "" { + tag = n.Tag + } + value := n.Value + if tag != seqTag && tag != mapTag { + if len(value) > 10 { + value = " `" + value[:7] + "...`" + } else { + value = " `" + value + "`" + } + } + c.TypeErrors = append(c.TypeErrors, formatConstructorError( + fmt.Errorf("cannot construct %s%s into %s", shortTag(tag), value, out.Type()), + Mark{Line: n.Line, Column: n.Column}, + )) +} + +// null constructs a null value by setting the target to its zero value. +// Only works for nillable types (interface, pointer, map, slice). +func (c *Constructor) null(out reflect.Value) bool { + if out.CanAddr() { + switch out.Kind() { + case reflect.Interface, reflect.Pointer, reflect.Map, reflect.Slice: + out.Set(reflect.Zero(out.Type())) + return true + } + } + return false +} + +// isTextUnmarshaler checks if a value implements [encoding.TextUnmarshaler]. +// It dereferences pointers to check the underlying type. +func isTextUnmarshaler(out reflect.Value) bool { + // Dereference pointers to check the underlying type, + // similar to how prepare() handles Constructor checks. + for out.Kind() == reflect.Pointer { + if out.IsNil() { + // Create a new instance to check the type + out = reflect.New(out.Type().Elem()).Elem() + } else { + out = out.Elem() + } + } + if out.CanAddr() { + _, ok := out.Addr().Interface().(encoding.TextUnmarshaler) + return ok + } + return false +} + +// settableValueOf returns a settable [reflect.Value] for the given value. +func settableValueOf(i any) reflect.Value { + v := reflect.ValueOf(i) + sv := reflect.New(v.Type()).Elem() + sv.Set(v) + return sv +} + +// setPossiblyUnhashableKey sets a map key, recovering from panics if the key +// type is unhashable. +func (c *Constructor) setPossiblyUnhashableKey(m map[any]bool, key any, value bool, n *Node) { + defer func() { + if err := recover(); err != nil { + Fail(formatConstructorError( + fmt.Errorf("%v", err), + Mark{Line: n.Line, Column: n.Column}, + )) + } + }() + m[key] = value +} + +// getPossiblyUnhashableKey gets a map key value, recovering from panics if +// the key type is unhashable. +func (c *Constructor) getPossiblyUnhashableKey(m map[any]bool, key any, n *Node) bool { + defer func() { + if err := recover(); err != nil { + Fail(formatConstructorError( + fmt.Errorf("%v", err), + Mark{Line: n.Line, Column: n.Column}, + )) + } + }() + return m[key] +} + +// formatConstructorError creates a LoadError for constructor-stage errors. +func formatConstructorError(err error, mark Mark) *LoadError { + return &LoadError{ + Stage: ConstructorStage, + Mark: mark, + Message: err.Error(), + err: err, + } +} + +// formatConstructorErrorContext creates a LoadError with both context and +// problem information for constructor-stage errors. +func formatConstructorErrorContext(context string, contextMark Mark, err error, mark Mark) *LoadError { + return &LoadError{ + Stage: ConstructorStage, + ContextMark: contextMark, + ContextMsg: context, + Mark: mark, + Message: err.Error(), + err: err, + } +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/desolver.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/desolver.go new file mode 100644 index 0000000..9f406ee --- /dev/null +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/desolver.go @@ -0,0 +1,152 @@ +// Copyright 2025 The go-yaml Project Contributors +// SPDX-License-Identifier: Apache-2.0 + +// Desolver stage: Removes inferable tags from YAML nodes. +// This is the inverse of the Resolver - it walks a tagged node tree and +// removes tags that can be inferred during parsing, producing cleaner YAML +// output without unnecessary type annotations. + +package libyaml + +// Desolver handles tag removal for YAML nodes during serialization. +// It removes tags that would be automatically resolved to the same type +// during parsing, making the output cleaner and more readable. +type Desolver struct { + opts *Options +} + +// NewDesolver creates a new Desolver with the given options. +func NewDesolver(opts *Options) *Desolver { + return &Desolver{opts: opts} +} + +// Desolve walks the node tree and removes tags that can be inferred. +// This is the inverse of Resolver - it takes a fully-tagged node tree +// (from Representer) and removes unnecessary tags to produce clean output. +// +// For scalar nodes: if the value would resolve to the same tag when parsed, +// the tag is removed. For strings that would resolve differently, the tag is +// removed and quoting style is set to preserve the string type. +// +// For collection nodes (maps/sequences): default tags (!!map, !!seq) are +// removed since they're implied by the structure. +func (d *Desolver) Desolve(n *Node) { + if n == nil { + return + } + + switch n.Kind { + case ScalarNode: + d.desolveScalar(n) + case DocumentNode, SequenceNode, MappingNode: + d.desolveCollection(n) + // Recursively desolve children + for _, child := range n.Content { + d.Desolve(child) + } + case AliasNode: + // Alias nodes don't have tags to remove + } +} + +// desolveScalar removes tags from scalar nodes when they can be inferred. +func (d *Desolver) desolveScalar(n *Node) { + // If explicitly tagged by user (TaggedStyle), keep it + if n.Style&TaggedStyle != 0 { + return + } + + // Empty tag means it's already untagged - nothing to do + if n.Tag == "" { + return + } + + stag := shortTag(n.Tag) + + // Check if this is a standard scalar tag that we can potentially remove + isStandardTag := false + switch stag { + case nullTag, boolTag, strTag, intTag, floatTag, timestampTag: + isStandardTag = true + case binaryTag: + // Binary scalars are not implicitly resolvable - never remove. + return + case mergeTag: + // Elide the implicit !!merge tag when the value is the canonical + // merge key marker. The TaggedStyle early-return above already + // preserves !!merge when it was explicit in the source. + if n.Value == "<<" { + n.Tag = "" + } + return + default: + // Custom tag - preserve it + return + } + + // Only process standard tags from here + if !isStandardTag { + return + } + + // What tag would this value resolve to? + rtag, _ := resolve("", n.Value) + + // If resolved tag matches current tag, we can elide the tag + if rtag == stag { + // Tag can be inferred - remove it + n.Tag = "" + } else if stag == strTag { + // This is a string type, but would resolve to something else. + // Remove the tag and force quoting to preserve string type. + n.Tag = "" + // If not already quoted, set quote style based on content + if n.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) == 0 { + // Determine quote style based on options or default to single quotes + if d.opts != nil { + // Convert ScalarStyle to Style + switch d.opts.QuotePreference.ScalarStyle() { + case DOUBLE_QUOTED_SCALAR_STYLE: + n.Style |= DoubleQuotedStyle + default: + n.Style |= SingleQuotedStyle + } + } else { + n.Style |= SingleQuotedStyle + } + } + } else if stag == floatTag || stag == intTag { + // For numeric type mismatches (like float64(1) → "1" with !!float tag): + // Elide the tag and let YAML resolve naturally. + // Without the tag, "1" resolves as !!int, which may change the type, + // but that's acceptable for cleaner output (and matches old behavior). + n.Tag = "" + } + // For other standard tags with mismatches, keep the tag to preserve type +} + +// desolveCollection removes default tags from collection nodes. +func (d *Desolver) desolveCollection(n *Node) { + // If explicitly tagged by user, keep it + if n.Style&TaggedStyle != 0 { + return + } + + stag := shortTag(n.Tag) + switch n.Kind { + case MappingNode: + // !!map is the default for mappings - remove it + if stag == mapTag { + n.Tag = "" + } + case SequenceNode: + // !!seq is the default for sequences - remove it + if stag == seqTag { + n.Tag = "" + } + case DocumentNode: + // Documents don't have tags in YAML output + n.Tag = "" + } + // For other tags, keep them - they're explicit type information +} diff --git a/vendor/go.yaml.in/yaml/v4/dumper.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/dumper.go similarity index 61% rename from vendor/go.yaml.in/yaml/v4/dumper.go rename to vendor/go.yaml.in/yaml/v4/internal/libyaml/dumper.go index 3182892..b65e81d 100644 --- a/vendor/go.yaml.in/yaml/v4/dumper.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/dumper.go @@ -7,17 +7,42 @@ // - Dump: Encode value(s) to YAML (use WithAll for multi-doc) // - NewDumper: Create a streaming dumper to io.Writer -package yaml +package libyaml import ( "bytes" - "errors" "io" "reflect" - - "go.yaml.in/yaml/v4/internal/libyaml" ) +// A Dumper writes YAML values to an output stream with configurable options. +// It uses a 3-stage pipeline mirroring the Loader: +// 1. Representer: Go values → Tagged Node tree +// 2. Desolver: Remove inferable tags +// 3. Serializer: Node tree → Events → YAML +type Dumper struct { + representer *Representer + desolver *Desolver + serializer *Serializer + options *Options +} + +// NewDumper returns a new Dumper that writes to w with the given options. +// +// The Dumper should be closed after use to flush all data to w. +func NewDumper(w io.Writer, opts ...Option) (*Dumper, error) { + o, err := ApplyOptions(opts...) + if err != nil { + return nil, err + } + return &Dumper{ + representer: NewRepresenter(o), // No writer - builds nodes + desolver: NewDesolver(o), + serializer: NewSerializer(w, o), // Writer here - emits YAML + options: o, + }, nil +} + // Dump encodes a value to YAML with the given options. // // By default, Dump encodes a single value as a single YAML document. @@ -34,13 +59,13 @@ import ( func Dump(in any, opts ...Option) (out []byte, err error) { defer handleErr(&err) - o, err := libyaml.ApplyOptions(opts...) + o, err := ApplyOptions(opts...) if err != nil { return nil, err } var buf bytes.Buffer - d, err := NewDumper(&buf, func(opts *libyaml.Options) error { + d, err := NewDumper(&buf, func(opts *Options) error { *opts = *o // Copy options return nil }) @@ -52,9 +77,10 @@ func Dump(in any, opts ...Option) (out []byte, err error) { // Multi-document mode: in must be a slice inVal := reflect.ValueOf(in) if inVal.Kind() != reflect.Slice { - return nil, &LoadErrors{Errors: []*libyaml.ConstructError{{ - Err: errors.New("yaml: WithAllDocuments requires a slice input"), - }}} + return nil, &DumpError{ + Stage: RepresenterStage, + Message: "WithAllDocuments requires a slice input", + } } // Dump each element as a separate document @@ -76,26 +102,6 @@ func Dump(in any, opts ...Option) (out []byte, err error) { return buf.Bytes(), nil } -// A Dumper writes YAML values to an output stream with configurable options. -type Dumper struct { - encoder *libyaml.Representer - opts *libyaml.Options -} - -// NewDumper returns a new Dumper that writes to w with the given options. -// -// The Dumper should be closed after use to flush all data to w. -func NewDumper(w io.Writer, opts ...Option) (*Dumper, error) { - o, err := libyaml.ApplyOptions(opts...) - if err != nil { - return nil, err - } - return &Dumper{ - encoder: libyaml.NewRepresenter(w, o), - opts: o, - }, nil -} - // Dump writes the YAML encoding of v to the stream. // // If multiple values are dumped to the stream, the second and subsequent @@ -105,7 +111,16 @@ func NewDumper(w io.Writer, opts ...Option) (*Dumper, error) { // values to YAML. func (d *Dumper) Dump(v any) (err error) { defer handleErr(&err) - d.encoder.MarshalDoc("", reflect.ValueOf(v)) + + // Stage 1: Represent - Go values → Tagged Node tree + node := d.representer.Represent("", reflect.ValueOf(v)) + + // Stage 2: Desolve - Remove inferable tags + d.desolver.Desolve(node) + + // Stage 3: Serialize - Node tree → Events → YAML + d.serializer.Serialize(node) + return nil } @@ -113,6 +128,22 @@ func (d *Dumper) Dump(v any) (err error) { // It does not write a stream terminating string "...". func (d *Dumper) Close() (err error) { defer handleErr(&err) - d.encoder.Finish() + d.serializer.Finish() return nil } + +// SetIndent changes the indentation used when encoding. +// This is used by the legacy Encoder.SetIndent() method. +func (d *Dumper) SetIndent(spaces int) { + if spaces < 0 { + failDumpf(SerializerStage, "cannot indent to a negative number of spaces") + } + // Set on serializer's emitter + d.serializer.Emitter.BestIndent = spaces +} + +// SetCompactSeqIndent controls whether '- ' is considered part of the indentation. +// This is used by the legacy Encoder methods. +func (d *Dumper) SetCompactSeqIndent(compact bool) { + d.serializer.Emitter.CompactSequenceIndent = compact +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/emitter.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/emitter.go index 7ea83e8..e603a19 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/emitter.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/emitter.go @@ -11,120 +11,158 @@ package libyaml import ( "bytes" "fmt" + "io" ) -// Flush the buffer if needed. -func (emitter *Emitter) flushIfNeeded() error { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - return emitter.flush() - } - return nil -} +// WriteHandler is called when the [Emitter] needs to flush the accumulated +// characters to the output. The handler should write @a size bytes of the +// @a buffer to the output. +// +// @param[in,out] data A pointer to an application data specified by +// yamlEmitter.setOutput(). +// @param[in] buffer The buffer with bytes to be written. +// @param[in] size The size of the buffer. +// +// @returns On success, the handler should return @c 1. If the handler failed, +// the returned value should be @c 0. +type WriteHandler func(emitter *Emitter, buffer []byte) error + +// EmitterState represents the current state of the emitter. +type EmitterState int + +// The emitter states. +const ( + // Expect STREAM-START. + EMIT_STREAM_START_STATE EmitterState = iota + + EMIT_FIRST_DOCUMENT_START_STATE // Expect the first DOCUMENT-START or STREAM-END. + EMIT_DOCUMENT_START_STATE // Expect DOCUMENT-START or STREAM-END. + EMIT_DOCUMENT_CONTENT_STATE // Expect the content of a document. + EMIT_DOCUMENT_END_STATE // Expect DOCUMENT-END. + EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a flow sequence. + EMIT_FLOW_SEQUENCE_TRAIL_ITEM_STATE // Expect the next item of a flow sequence, with the comma already written out + EMIT_FLOW_SEQUENCE_ITEM_STATE // Expect an item of a flow sequence. + EMIT_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. + EMIT_FLOW_MAPPING_TRAIL_KEY_STATE // Expect the next key of a flow mapping, with the comma already written out + EMIT_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. + EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a flow mapping. + EMIT_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. + EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a block sequence. + EMIT_BLOCK_SEQUENCE_ITEM_STATE // Expect an item of a block sequence. + EMIT_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. + EMIT_BLOCK_MAPPING_KEY_STATE // Expect the key of a block mapping. + EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping. + EMIT_BLOCK_MAPPING_VALUE_STATE // Expect a value of a block mapping. + EMIT_END_STATE // Expect nothing. +) -// Put a character to the output buffer. -func (emitter *Emitter) put(value byte) error { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - if err := emitter.flush(); err != nil { - return err - } - } - emitter.buffer[emitter.buffer_pos] = value - emitter.buffer_pos++ - emitter.column++ - return nil -} +// Emitter holds all information about the current state of the emitter. +type Emitter struct { + // Writer stuff -// Put a line break to the output buffer. -func (emitter *Emitter) putLineBreak() error { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - if err := emitter.flush(); err != nil { - return err - } - } - switch emitter.line_break { - case CR_BREAK: - emitter.buffer[emitter.buffer_pos] = '\r' - emitter.buffer_pos += 1 - case LN_BREAK: - emitter.buffer[emitter.buffer_pos] = '\n' - emitter.buffer_pos += 1 - case CRLN_BREAK: - emitter.buffer[emitter.buffer_pos+0] = '\r' - emitter.buffer[emitter.buffer_pos+1] = '\n' - emitter.buffer_pos += 2 - default: - panic("unknown line break setting") - } - if emitter.column == 0 { - emitter.space_above = true + write_handler WriteHandler // Write handler. + + output_buffer *[]byte // String output data. + output_writer io.Writer // File output data. + + buffer []byte // The working buffer. + buffer_pos int // The current position of the buffer. + + encoding Encoding // The stream encoding. + + // Emitter stuff + + canonical bool // If the output is in the canonical style? + BestIndent int // The number of indentation spaces. + best_width int // The preferred width of the output lines. + unicode bool // Allow unescaped non-ASCII characters? + line_break LineBreak // The preferred line break. + quotePreference QuoteStyle // Preferred quote style when quoting is required. + + state EmitterState // The current emitter state. + states []EmitterState // The stack of states. + + events []Event // The event queue. + events_head int // The head of the event queue. + + indents []int // The stack of indentation levels. + + tag_directives []TagDirective // The list of tag directives. + + indent int // The current indentation level. + + CompactSequenceIndent bool // Is '- ' is considered part of the indentation for sequence elements? + + flow_level int // The current flow level. + + root_context bool // Is it the document root context? + sequence_context bool // Is it a sequence context? + mapping_context bool // Is it a mapping context? + simple_key_context bool // Is it a simple mapping key context? + + line int // The current line. + column int // The current column. + whitespace bool // If the last character was a whitespace? + indention bool // If the last character was an indentation character (' ', '-', '?', ':')? + OpenEnded bool // If an explicit document end is required? + + space_above bool // Is there's an empty line above? + foot_indent int // The indent used to write the foot comment above, or -1 if none. + + // Anchor analysis. + anchor_data struct { + anchor []byte // The anchor value. + alias bool // Is it an alias? } - emitter.column = 0 - emitter.line++ - // [Go] Do this here and below and drop from everywhere else (see commented lines). - emitter.indention = true - return nil -} -// Copy a character from a string into buffer. -func (emitter *Emitter) write(s []byte, i *int) error { - if emitter.buffer_pos+5 >= len(emitter.buffer) { - if err := emitter.flush(); err != nil { - return err - } + // Tag analysis. + tag_data struct { + handle []byte // The tag handle. + suffix []byte // The tag suffix. } - p := emitter.buffer_pos - w := width(s[*i]) - switch w { - case 4: - emitter.buffer[p+3] = s[*i+3] - fallthrough - case 3: - emitter.buffer[p+2] = s[*i+2] - fallthrough - case 2: - emitter.buffer[p+1] = s[*i+1] - fallthrough - case 1: - emitter.buffer[p+0] = s[*i+0] - default: - panic("unknown character width") + + // Scalar analysis. + scalar_data struct { + value []byte // The scalar value. + multiline bool // Does the scalar contain line breaks? + flow_plain_allowed bool // Can the scalar be expressed in the flow plain style? + block_plain_allowed bool // Can the scalar be expressed in the block plain style? + single_quoted_allowed bool // Can the scalar be expressed in the single quoted style? + block_allowed bool // Can the scalar be expressed in the literal or folded styles? + style ScalarStyle // The output style. } - emitter.column++ - emitter.buffer_pos += w - *i += w - return nil -} -// Write a whole string into buffer. -func (emitter *Emitter) writeAll(s []byte) error { - for i := 0; i < len(s); { - if err := emitter.write(s, &i); err != nil { - return err - } + // Comments + HeadComment []byte + LineComment []byte + FootComment []byte + TailComment []byte + + key_line_comment []byte + + // Representer stuff + + opened bool // If the stream was already opened? + closed bool // If the stream was already closed? + + // The information associated with the document nodes. + anchors *struct { + references int // The number of references. + anchor int // The anchor id. + serialized bool // If the node has been emitted? } - return nil + + last_anchor_id int // The last assigned anchor id. } -// Copy a line break character from a string into buffer. -func (emitter *Emitter) writeLineBreak(s []byte, i *int) error { - if s[*i] == '\n' { - if err := emitter.putLineBreak(); err != nil { - return err - } - *i++ - } else { - if err := emitter.write(s, i); err != nil { - return err - } - if emitter.column == 0 { - emitter.space_above = true - } - emitter.column = 0 - emitter.line++ - // [Go] Do this here and above and drop from everywhere else (see commented lines). - emitter.indention = true +// NewEmitter creates a new emitter object. +func NewEmitter() Emitter { + return Emitter{ + buffer: make([]byte, output_buffer_size), + states: make([]EmitterState, 0, initial_stack_size), + events: make([]Event, 0, initial_queue_size), + best_width: -1, } - return nil } // Emit an event. @@ -144,97 +182,79 @@ func (emitter *Emitter) Emit(event *Event) error { return nil } -// Check if we need to accumulate more events before emitting. -// -// We accumulate extra -// - 1 event for DOCUMENT-START -// - 2 events for SEQUENCE-START -// - 3 events for MAPPING-START -func (emitter *Emitter) needMoreEvents() bool { - if emitter.events_head == len(emitter.events) { - return true - } - var accumulate int - switch emitter.events[emitter.events_head].Type { - case DOCUMENT_START_EVENT: - accumulate = 1 - case SEQUENCE_START_EVENT: - accumulate = 2 - case MAPPING_START_EVENT: - accumulate = 3 - default: - return false - } - if len(emitter.events)-emitter.events_head > accumulate { - return false +// Delete an emitter object. +func (emitter *Emitter) Delete() { + *emitter = Emitter{} +} + +// String write handler. +func yamlStringWriteHandler(emitter *Emitter, buffer []byte) error { + *emitter.output_buffer = append(*emitter.output_buffer, buffer...) + return nil +} + +// yamlWriterWriteHandler uses emitter.output_writer to write the +// emitted text. +func yamlWriterWriteHandler(emitter *Emitter, buffer []byte) error { + _, err := emitter.output_writer.Write(buffer) + return err +} + +// SetOutputString sets a string output. +func (emitter *Emitter) SetOutputString(output_buffer *[]byte) { + if emitter.write_handler != nil { + panic("must set the output target only once") } - var level int - for i := emitter.events_head; i < len(emitter.events); i++ { - switch emitter.events[i].Type { - case STREAM_START_EVENT, DOCUMENT_START_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT: - level++ - case STREAM_END_EVENT, DOCUMENT_END_EVENT, SEQUENCE_END_EVENT, MAPPING_END_EVENT: - level-- - } - if level == 0 { - return false - } + emitter.write_handler = yamlStringWriteHandler + emitter.output_buffer = output_buffer +} + +// SetOutputWriter sets a file output. +func (emitter *Emitter) SetOutputWriter(w io.Writer) { + if emitter.write_handler != nil { + panic("must set the output target only once") } - return true + emitter.write_handler = yamlWriterWriteHandler + emitter.output_writer = w } -// Append a directive to the directives stack. -func (emitter *Emitter) appendTagDirective(value *TagDirective, allow_duplicates bool) error { - for i := 0; i < len(emitter.tag_directives); i++ { - if bytes.Equal(value.handle, emitter.tag_directives[i].handle) { - if allow_duplicates { - return nil - } - return EmitterError{ - Message: "duplicate %TAG directive", - } - } +// SetEncoding sets the output encoding. +func (emitter *Emitter) SetEncoding(encoding Encoding) { + if emitter.encoding != ANY_ENCODING { + panic("must set the output encoding only once") } + emitter.encoding = encoding +} - // [Go] Do we actually need to copy this given garbage collection - // and the lack of deallocating destructors? - tag_copy := TagDirective{ - handle: make([]byte, len(value.handle)), - prefix: make([]byte, len(value.prefix)), +// SetCanonical sets the canonical output style. +func (emitter *Emitter) SetCanonical(canonical bool) { + emitter.canonical = canonical +} + +// SetIndent sets the indentation increment. +func (emitter *Emitter) SetIndent(indent int) { + if indent < 2 || indent > 9 { + indent = 2 } - copy(tag_copy.handle, value.handle) - copy(tag_copy.prefix, value.prefix) - emitter.tag_directives = append(emitter.tag_directives, tag_copy) - return nil + emitter.BestIndent = indent } -// Increase the indentation level. -func (emitter *Emitter) increaseIndentCompact(flow, indentless bool, compact_seq bool) error { - emitter.indents = append(emitter.indents, emitter.indent) - if emitter.indent < 0 { - if flow { - emitter.indent = emitter.BestIndent - } else { - emitter.indent = 0 - } - } else if !indentless { - // [Go] This was changed so that indentations are more regular. - if emitter.states[len(emitter.states)-1] == EMIT_BLOCK_SEQUENCE_ITEM_STATE { - // The first indent inside a sequence will just skip the "- " indicator. - emitter.indent += 2 - } else { - // Everything else aligns to the chosen indentation. - emitter.indent = emitter.BestIndent * ((emitter.indent + emitter.BestIndent) / emitter.BestIndent) - if compact_seq { - // The value compact_seq passed in is almost always set to `false` when this function is called, - // except when we are dealing with sequence nodes. So this gets triggered to subtract 2 only when we - // are increasing the indent to account for sequence nodes, which will be correct because we need to - // subtract 2 to account for the - at the beginning of the sequence node. - emitter.indent = emitter.indent - 2 - } - } +// SetWidth sets the preferred line width. +func (emitter *Emitter) SetWidth(width int) { + if width < 0 { + width = -1 } - return nil + emitter.best_width = width +} + +// SetUnicode sets if unescaped non-ASCII characters are allowed. +func (emitter *Emitter) SetUnicode(unicode bool) { + emitter.unicode = unicode +} + +// SetLineBreak sets the preferred line break character. +func (emitter *Emitter) SetLineBreak(line_break LineBreak) { + emitter.line_break = line_break } // State dispatcher. @@ -306,6 +326,45 @@ func (emitter *Emitter) stateMachine(event *Event) error { panic("invalid emitter state") } +// Check if we need to accumulate more events before emitting. +// +// We accumulate extra +// - 1 event for DOCUMENT-START +// - 2 events for SEQUENCE-START +// - 3 events for MAPPING-START +func (emitter *Emitter) needMoreEvents() bool { + if emitter.events_head == len(emitter.events) { + return true + } + var accumulate int + switch emitter.events[emitter.events_head].Type { + case DOCUMENT_START_EVENT: + accumulate = 1 + case SEQUENCE_START_EVENT: + accumulate = 2 + case MAPPING_START_EVENT: + accumulate = 3 + default: + return false + } + if len(emitter.events)-emitter.events_head > accumulate { + return false + } + var level int + for i := emitter.events_head; i < len(emitter.events); i++ { + switch emitter.events[i].Type { + case STREAM_START_EVENT, DOCUMENT_START_EVENT, SEQUENCE_START_EVENT, MAPPING_START_EVENT: + level++ + case STREAM_END_EVENT, DOCUMENT_END_EVENT, SEQUENCE_END_EVENT, MAPPING_END_EVENT: + level-- + } + if level == 0 { + return false + } + } + return true +} + // Expect STREAM-START. func (emitter *Emitter) emitStreamStart(event *Event) error { if event.Type != STREAM_START_EVENT { @@ -473,18 +532,6 @@ func (emitter *Emitter) emitDocumentStart(event *Event, first bool) error { } } -// emitter preserves the original signature and delegates to -// increaseIndentCompact without compact-sequence indentation -func (emitter *Emitter) increaseIndent(flow, indentless bool) error { - return emitter.increaseIndentCompact(flow, indentless, false) -} - -// processLineComment preserves the original signature and delegates to -// processLineCommentLinebreak passing false for linebreak -func (emitter *Emitter) processLineComment() error { - return emitter.processLineCommentLinebreak(false) -} - // Expect the root node. func (emitter *Emitter) emitDocumentContent(event *Event) error { emitter.states = append(emitter.states, EMIT_DOCUMENT_END_STATE) @@ -633,7 +680,9 @@ func (emitter *Emitter) emitFlowMappingKey(event *Event, first, trail bool) erro } if event.Type == MAPPING_END_EVENT { - if (emitter.canonical || len(emitter.HeadComment)+len(emitter.FootComment)+len(emitter.TailComment) > 0) && !first && !trail { + if (emitter.canonical || + len(emitter.HeadComment)+len(emitter.FootComment)+len(emitter.TailComment) > 0) && + !first && !trail { if err := emitter.writeIndicator([]byte{','}, false, false, false); err != nil { return err } @@ -737,13 +786,17 @@ func (emitter *Emitter) emitFlowMappingValue(event *Event, simple bool) error { // Expect a block item node. func (emitter *Emitter) emitBlockSequenceItem(event *Event, first bool) error { if first { - // emitter.mapping context tells us if we are currently in a mapping context. - // emitter.column tells us which column we are in the yaml output. 0 is the first char of the column. - // emitter.indentation tells us if the last character was an indentation character. - // emitter.compact_sequence_indent tells us if '- ' is considered part of the indentation for sequence elements. - // So, `seq` means that we are in a mapping context, and we are either at the first char of the column or - // the last character was not an indentation character, and we consider '- ' part of the indentation - // for sequence elements. + // emitter.mapping context tells us if we are currently in a + // mapping context. emitter.column tells us which column we + // are in the yaml output. 0 is the first char of the column. + // emitter.indentation tells us if the last character was an + // indentation character. + // emitter.compact_sequence_indent tells us if '- ' is + // considered part of the indentation for sequence elements. + // So, `seq` means that we are in a mapping context, and we are + // either at the first char of the column or the last character + // was not an indentation character, and we consider '- ' part + // of the indentation for sequence elements. seq := emitter.mapping_context && (emitter.column == 0 || !emitter.indention) && emitter.CompactSequenceIndent if err := emitter.increaseIndentCompact(false, false, seq); err != nil { @@ -841,19 +894,23 @@ func (emitter *Emitter) emitBlockMappingValue(event *Event, simple bool) error { } } if len(emitter.key_line_comment) > 0 { - // [Go] Line comments are generally associated with the value, but when there's - // no value on the same line as a mapping key they end up attached to the - // key itself. + // [Go] Line comments are generally associated with the value, + // but when there's no value on the same line as a mapping key + // they end up attached to the key itself. if event.Type == SCALAR_EVENT { if len(emitter.LineComment) == 0 { - // A scalar is coming and it has no line comments by itself yet, - // so just let it handle the line comment as usual. If it has a - // line comment, we can't have both so the one from the key is lost. + // A scalar is coming and it has no line + // comments by itself yet, so just let it + // handle the line comment as usual. If it has + // a line comment, we can't have both so the + // one from the key is lost. emitter.LineComment = emitter.key_line_comment emitter.key_line_comment = nil } - } else if event.SequenceStyle() != FLOW_SEQUENCE_STYLE && (event.Type == MAPPING_START_EVENT || event.Type == SEQUENCE_START_EVENT) { - // An indented block follows, so write the comment right now. + } else if event.SequenceStyle() != FLOW_SEQUENCE_STYLE && + (event.Type == MAPPING_START_EVENT || event.Type == SEQUENCE_START_EVENT) { + // An indented block follows, so write the comment + // right now. emitter.LineComment, emitter.key_line_comment = emitter.key_line_comment, emitter.LineComment if err := emitter.processLineComment(); err != nil { return err @@ -874,10 +931,6 @@ func (emitter *Emitter) emitBlockMappingValue(event *Event, simple bool) error { return nil } -func (emitter *Emitter) silentNilEvent(event *Event) bool { - return event.Type == SCALAR_EVENT && event.Implicit && !emitter.canonical && len(emitter.scalar_data.value) == 0 -} - // Expect a node. func (emitter *Emitter) emitNode(event *Event, root bool, sequence bool, mapping bool, simple_key bool, @@ -913,15 +966,6 @@ func (emitter *Emitter) emitAlias(event *Event) error { return nil } -// requiredQuoteStyle returns the appropriate quote style based on the -// emitter's quotePreference setting. -func (emitter *Emitter) requiredQuoteStyle() ScalarStyle { - if emitter.quotePreference == QuoteDouble { - return DOUBLE_QUOTED_SCALAR_STYLE - } - return SINGLE_QUOTED_SCALAR_STYLE -} - // Expect SCALAR. func (emitter *Emitter) emitScalar(event *Event) error { if err := emitter.selectScalarStyle(event); err != nil { @@ -954,7 +998,8 @@ func (emitter *Emitter) emitSequenceStart(event *Event) error { if err := emitter.processTag(); err != nil { return err } - if emitter.flow_level > 0 || emitter.canonical || event.SequenceStyle() == FLOW_SEQUENCE_STYLE || + if emitter.flow_level > 0 || emitter.canonical || + event.SequenceStyle() == FLOW_SEQUENCE_STYLE || emitter.checkEmptySequence() { emitter.state = EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE } else { @@ -971,7 +1016,8 @@ func (emitter *Emitter) emitMappingStart(event *Event) error { if err := emitter.processTag(); err != nil { return err } - if emitter.flow_level > 0 || emitter.canonical || event.MappingStyle() == FLOW_MAPPING_STYLE || + if emitter.flow_level > 0 || emitter.canonical || + event.MappingStyle() == FLOW_MAPPING_STYLE || emitter.checkEmptyMapping() { emitter.state = EMIT_FLOW_MAPPING_FIRST_KEY_STATE } else { @@ -1018,73 +1064,23 @@ func (emitter *Emitter) checkSimpleKey() bool { len(emitter.tag_data.suffix) + len(emitter.scalar_data.value) case SEQUENCE_START_EVENT: - if !emitter.checkEmptySequence() { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - case MAPPING_START_EVENT: - if !emitter.checkEmptyMapping() { - return false - } - length += len(emitter.anchor_data.anchor) + - len(emitter.tag_data.handle) + - len(emitter.tag_data.suffix) - default: - return false - } - return length <= 128 -} - -// Determine an acceptable scalar style. -func (emitter *Emitter) selectScalarStyle(event *Event) error { - no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 - if no_tag && !event.Implicit && !event.quoted_implicit { - return EmitterError{ - Message: "neither tag nor implicit flags are specified", - } - } - - style := event.ScalarStyle() - if style == ANY_SCALAR_STYLE { - style = PLAIN_SCALAR_STYLE - } - if emitter.canonical { - style = DOUBLE_QUOTED_SCALAR_STYLE - } - if emitter.simple_key_context && emitter.scalar_data.multiline { - style = DOUBLE_QUOTED_SCALAR_STYLE - } - - if style == PLAIN_SCALAR_STYLE { - if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed || - emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed { - style = emitter.requiredQuoteStyle() - } - if len(emitter.scalar_data.value) == 0 && (emitter.flow_level > 0 || emitter.simple_key_context) { - style = emitter.requiredQuoteStyle() - } - if no_tag && !event.Implicit { - style = emitter.requiredQuoteStyle() - } - } - if style == SINGLE_QUOTED_SCALAR_STYLE { - if !emitter.scalar_data.single_quoted_allowed { - style = DOUBLE_QUOTED_SCALAR_STYLE + if !emitter.checkEmptySequence() { + return false } - } - if style == LITERAL_SCALAR_STYLE || style == FOLDED_SCALAR_STYLE { - if !emitter.scalar_data.block_allowed || emitter.flow_level > 0 || emitter.simple_key_context { - style = DOUBLE_QUOTED_SCALAR_STYLE + length += len(emitter.anchor_data.anchor) + + len(emitter.tag_data.handle) + + len(emitter.tag_data.suffix) + case MAPPING_START_EVENT: + if !emitter.checkEmptyMapping() { + return false } + length += len(emitter.anchor_data.anchor) + + len(emitter.tag_data.handle) + + len(emitter.tag_data.suffix) + default: + return false } - - if no_tag && !event.quoted_implicit && style != PLAIN_SCALAR_STYLE { - emitter.tag_data.handle = []byte{'!'} - } - emitter.scalar_data.style = style - return nil + return length <= 128 } // Write an anchor. @@ -1181,7 +1177,13 @@ func (emitter *Emitter) processHeadComment() error { return nil } -// Write an line comment. +// processLineComment preserves the original signature and delegates to +// processLineCommentLinebreak passing false for linebreak +func (emitter *Emitter) processLineComment() error { + return emitter.processLineCommentLinebreak(false) +} + +// Write a line comment. func (emitter *Emitter) processLineCommentLinebreak(linebreak bool) error { if len(emitter.LineComment) == 0 { // The next 3 lines are needed to resolve an issue with leading newlines @@ -1347,7 +1349,9 @@ func (emitter *Emitter) analyzeScalar(value []byte) error { return nil } - if len(value) >= 3 && ((value[0] == '-' && value[1] == '-' && value[2] == '-') || (value[0] == '.' && value[1] == '.' && value[2] == '.')) { + if len(value) >= 3 && + ((value[0] == '-' && value[1] == '-' && value[2] == '-') || + (value[0] == '.' && value[1] == '.' && value[2] == '.')) { block_indicators = true flow_indicators = true } @@ -1359,7 +1363,8 @@ func (emitter *Emitter) analyzeScalar(value []byte) error { if i == 0 { switch value[i] { - case '#', ',', '[', ']', '{', '}', '&', '*', '!', '|', '>', '\'', '"', '%', '@', '`': + case '#', ',', '[', ']', '{', '}', '&', '*', '!', + '|', '>', '\'', '"', '%', '@', '`': flow_indicators = true block_indicators = true case '?', ':': @@ -1425,7 +1430,8 @@ func (emitter *Emitter) analyzeScalar(value []byte) error { previous_break = false } - // [Go]: Why 'z'? Couldn't be the end of the string as that's the loop condition. + // [Go]: Why 'z'? Couldn't be the end of the string as that's + // the loop condition. preceded_by_whitespace = isBlankOrZero(value, i) } @@ -1500,7 +1506,8 @@ func (emitter *Emitter) analyzeEvent(event *Event) error { return err } } - if len(event.Tag) > 0 && (emitter.canonical || (!event.Implicit && !event.quoted_implicit)) { + if len(event.Tag) > 0 && (emitter.canonical || + (!event.Implicit && !event.quoted_implicit)) { if err := emitter.analyzeTag(event.Tag); err != nil { return err } @@ -1536,6 +1543,58 @@ func (emitter *Emitter) analyzeEvent(event *Event) error { return nil } +// Determine an acceptable scalar style. +func (emitter *Emitter) selectScalarStyle(event *Event) error { + no_tag := len(emitter.tag_data.handle) == 0 && len(emitter.tag_data.suffix) == 0 + if no_tag && !event.Implicit && !event.quoted_implicit { + return EmitterError{ + Message: "neither tag nor implicit flags are specified", + } + } + + style := event.ScalarStyle() + if style == ANY_SCALAR_STYLE { + style = PLAIN_SCALAR_STYLE + } + if emitter.canonical { + style = DOUBLE_QUOTED_SCALAR_STYLE + } + if emitter.simple_key_context && emitter.scalar_data.multiline { + style = DOUBLE_QUOTED_SCALAR_STYLE + } + + if style == PLAIN_SCALAR_STYLE { + if emitter.flow_level > 0 && !emitter.scalar_data.flow_plain_allowed || + emitter.flow_level == 0 && !emitter.scalar_data.block_plain_allowed { + style = emitter.requiredQuoteStyle() + } + if len(emitter.scalar_data.value) == 0 && + (emitter.flow_level > 0 || emitter.simple_key_context) { + style = emitter.requiredQuoteStyle() + } + if no_tag && !event.Implicit { + style = emitter.requiredQuoteStyle() + } + } + if style == SINGLE_QUOTED_SCALAR_STYLE { + if !emitter.scalar_data.single_quoted_allowed { + style = DOUBLE_QUOTED_SCALAR_STYLE + } + } + if style == LITERAL_SCALAR_STYLE || style == FOLDED_SCALAR_STYLE { + if !emitter.scalar_data.block_allowed || + emitter.flow_level > 0 || emitter.simple_key_context { + style = DOUBLE_QUOTED_SCALAR_STYLE + } + } + + if no_tag && !event.quoted_implicit && style != PLAIN_SCALAR_STYLE { + emitter.tag_data.handle = []byte{'!'} + } + emitter.scalar_data.style = style + return nil +} + // Write the BOM character. func (emitter *Emitter) writeBom() error { if err := emitter.flushIfNeeded(); err != nil { @@ -1549,12 +1608,14 @@ func (emitter *Emitter) writeBom() error { return nil } +// writeIndent writes the appropriate indentation to the output. func (emitter *Emitter) writeIndent() error { indent := emitter.indent if indent < 0 { indent = 0 } - if !emitter.indention || emitter.column > indent || (emitter.column == indent && !emitter.whitespace) { + if !emitter.indention || emitter.column > indent || + (emitter.column == indent && !emitter.whitespace) { if err := emitter.putLineBreak(); err != nil { return err } @@ -1575,6 +1636,7 @@ func (emitter *Emitter) writeIndent() error { return nil } +// writeIndicator writes a YAML indicator (like ':', '-', '?') to the output. func (emitter *Emitter) writeIndicator(indicator []byte, need_whitespace, is_whitespace, is_indention bool) error { if need_whitespace && !emitter.whitespace { if err := emitter.put(' '); err != nil { @@ -1590,6 +1652,7 @@ func (emitter *Emitter) writeIndicator(indicator []byte, need_whitespace, is_whi return nil } +// writeAnchor writes an anchor name to the output. func (emitter *Emitter) writeAnchor(value []byte) error { if err := emitter.writeAll(value); err != nil { return err @@ -1599,6 +1662,7 @@ func (emitter *Emitter) writeAnchor(value []byte) error { return nil } +// writeTagHandle writes a tag handle to the output. func (emitter *Emitter) writeTagHandle(value []byte) error { if !emitter.whitespace { if err := emitter.put(' '); err != nil { @@ -1613,6 +1677,8 @@ func (emitter *Emitter) writeTagHandle(value []byte) error { return nil } +// writeTagContent writes a tag URI to the output, URL-encoding special +// characters as needed. func (emitter *Emitter) writeTagContent(value []byte, need_whitespace bool) error { if need_whitespace && !emitter.whitespace { if err := emitter.put(' '); err != nil { @@ -1622,7 +1688,8 @@ func (emitter *Emitter) writeTagContent(value []byte, need_whitespace bool) erro for i := 0; i < len(value); { var must_write bool switch value[i] { - case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '_', '.', '~', '*', '\'', '(', ')', '[', ']': + case ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', + '_', '.', '~', '*', '\'', '(', ')', '[', ']': must_write = true default: must_write = isAlpha(value, i) @@ -1667,6 +1734,8 @@ func (emitter *Emitter) writeTagContent(value []byte, need_whitespace bool) erro return nil } +// writePlainScalar writes a plain (unquoted) scalar to the output, handling +// line breaks and wrapping as needed. func (emitter *Emitter) writePlainScalar(value []byte, allow_breaks bool) error { if len(value) > 0 && !emitter.whitespace { if err := emitter.put(' '); err != nil { @@ -1678,7 +1747,9 @@ func (emitter *Emitter) writePlainScalar(value []byte, allow_breaks bool) error breaks := false for i := 0; i < len(value); { if isSpace(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && !isSpace(value, i+1) { + if allow_breaks && !spaces && + emitter.column > emitter.best_width && + !isSpace(value, i+1) { if err := emitter.writeIndent(); err != nil { return err } @@ -1725,6 +1796,8 @@ func (emitter *Emitter) writePlainScalar(value []byte, allow_breaks bool) error return nil } +// writeSingleQuotedScalar writes a single-quoted scalar to the output, +// escaping single quotes and handling line breaks. func (emitter *Emitter) writeSingleQuotedScalar(value []byte, allow_breaks bool) error { if err := emitter.writeIndicator([]byte{'\''}, true, false, false); err != nil { return err @@ -1734,7 +1807,9 @@ func (emitter *Emitter) writeSingleQuotedScalar(value []byte, allow_breaks bool) breaks := false for i := 0; i < len(value); { if isSpace(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 && !isSpace(value, i+1) { + if allow_breaks && !spaces && + emitter.column > emitter.best_width && + i > 0 && i < len(value)-1 && !isSpace(value, i+1) { if err := emitter.writeIndent(); err != nil { return err } @@ -1782,6 +1857,8 @@ func (emitter *Emitter) writeSingleQuotedScalar(value []byte, allow_breaks bool) return nil } +// writeDoubleQuotedScalar writes a double-quoted scalar to the output, +// escaping special characters and handling Unicode. func (emitter *Emitter) writeDoubleQuotedScalar(value []byte, allow_breaks bool) error { spaces := false if err := emitter.writeIndicator([]byte{'"'}, true, false, false); err != nil { @@ -1874,7 +1951,9 @@ func (emitter *Emitter) writeDoubleQuotedScalar(value []byte, allow_breaks bool) } spaces = false } else if isSpace(value, i) { - if allow_breaks && !spaces && emitter.column > emitter.best_width && i > 0 && i < len(value)-1 { + if allow_breaks && !spaces && + emitter.column > emitter.best_width && + i > 0 && i < len(value)-1 { if err := emitter.writeIndent(); err != nil { return err } @@ -1903,10 +1982,13 @@ func (emitter *Emitter) writeDoubleQuotedScalar(value []byte, allow_breaks bool) return nil } +// writeBlockScalarHints writes the indentation and chomping indicators for +// block scalars. func (emitter *Emitter) writeBlockScalarHints(value []byte) error { if isSpace(value, 0) { // https://github.com/yaml/go-yaml/issues/65 - // isLineBreak(value, 0) removed as the linebreak will only write the indentation value. + // isLineBreak(value, 0) removed as the linebreak will only + // write the indentation value. indent_hint := []byte{'0' + byte(emitter.BestIndent)} if err := emitter.writeIndicator(indent_hint, false, false, false); err != nil { return err @@ -1947,6 +2029,8 @@ func (emitter *Emitter) writeBlockScalarHints(value []byte) error { return nil } +// writeLiteralScalar writes a literal block scalar (|) to the output, +// preserving line breaks exactly. func (emitter *Emitter) writeLiteralScalar(value []byte) error { if err := emitter.writeIndicator([]byte{'|'}, true, false, false); err != nil { return err @@ -1982,6 +2066,8 @@ func (emitter *Emitter) writeLiteralScalar(value []byte) error { return nil } +// writeFoldedScalar writes a folded block scalar (>) to the output, folding +// long lines at appropriate breaks. func (emitter *Emitter) writeFoldedScalar(value []byte) error { if err := emitter.writeIndicator([]byte{'>'}, true, false, false); err != nil { return err @@ -2021,7 +2107,9 @@ func (emitter *Emitter) writeFoldedScalar(value []byte) error { } leading_spaces = isBlank(value, i) } - if !breaks && isSpace(value, i) && !isSpace(value, i+1) && emitter.column > emitter.best_width { + if !breaks && isSpace(value, i) && + !isSpace(value, i+1) && + emitter.column > emitter.best_width { if err := emitter.writeIndent(); err != nil { return err } @@ -2038,6 +2126,8 @@ func (emitter *Emitter) writeFoldedScalar(value []byte) error { return nil } +// writeComment writes a comment to the output, ensuring each line starts +// with '#' and handling line breaks appropriately. func (emitter *Emitter) writeComment(comment []byte) error { breaks := false pound := false @@ -2081,3 +2171,201 @@ func (emitter *Emitter) writeComment(comment []byte) error { emitter.whitespace = true return nil } + +// Flush the buffer if needed. +func (emitter *Emitter) flushIfNeeded() error { + if emitter.buffer_pos+5 >= len(emitter.buffer) { + return emitter.flush() + } + return nil +} + +// Put a character to the output buffer. +func (emitter *Emitter) put(value byte) error { + if emitter.buffer_pos+5 >= len(emitter.buffer) { + if err := emitter.flush(); err != nil { + return err + } + } + emitter.buffer[emitter.buffer_pos] = value + emitter.buffer_pos++ + emitter.column++ + return nil +} + +// Put a line break to the output buffer. +func (emitter *Emitter) putLineBreak() error { + if emitter.buffer_pos+5 >= len(emitter.buffer) { + if err := emitter.flush(); err != nil { + return err + } + } + switch emitter.line_break { + case CR_BREAK: + emitter.buffer[emitter.buffer_pos] = '\r' + emitter.buffer_pos += 1 + case LN_BREAK: + emitter.buffer[emitter.buffer_pos] = '\n' + emitter.buffer_pos += 1 + case CRLN_BREAK: + emitter.buffer[emitter.buffer_pos+0] = '\r' + emitter.buffer[emitter.buffer_pos+1] = '\n' + emitter.buffer_pos += 2 + default: + panic("unknown line break setting") + } + if emitter.column == 0 { + emitter.space_above = true + } + emitter.column = 0 + emitter.line++ + // [Go] Do this here and below and drop from everywhere else (see + // commented lines). + emitter.indention = true + return nil +} + +// Copy a character from a string into buffer. +func (emitter *Emitter) write(s []byte, i *int) error { + if emitter.buffer_pos+5 >= len(emitter.buffer) { + if err := emitter.flush(); err != nil { + return err + } + } + p := emitter.buffer_pos + w := width(s[*i]) + switch w { + case 4: + emitter.buffer[p+3] = s[*i+3] + fallthrough + case 3: + emitter.buffer[p+2] = s[*i+2] + fallthrough + case 2: + emitter.buffer[p+1] = s[*i+1] + fallthrough + case 1: + emitter.buffer[p+0] = s[*i+0] + default: + panic("unknown character width") + } + emitter.column++ + emitter.buffer_pos += w + *i += w + return nil +} + +// Write a whole string into buffer. +func (emitter *Emitter) writeAll(s []byte) error { + for i := 0; i < len(s); { + if err := emitter.write(s, &i); err != nil { + return err + } + } + return nil +} + +// Copy a line break character from a string into buffer. +func (emitter *Emitter) writeLineBreak(s []byte, i *int) error { + if s[*i] == '\n' { + if err := emitter.putLineBreak(); err != nil { + return err + } + *i++ + } else { + if err := emitter.write(s, i); err != nil { + return err + } + if emitter.column == 0 { + emitter.space_above = true + } + emitter.column = 0 + emitter.line++ + // [Go] Do this here and above and drop from everywhere else + // (see commented lines). + emitter.indention = true + } + return nil +} + +// Append a directive to the directives stack. +func (emitter *Emitter) appendTagDirective(value *TagDirective, allow_duplicates bool) error { + for i := 0; i < len(emitter.tag_directives); i++ { + if bytes.Equal(value.handle, emitter.tag_directives[i].handle) { + if allow_duplicates { + return nil + } + return EmitterError{ + Message: "duplicate %TAG directive", + } + } + } + + // [Go] Do we actually need to copy this given garbage collection + // and the lack of deallocating destructors? + tag_copy := TagDirective{ + handle: make([]byte, len(value.handle)), + prefix: make([]byte, len(value.prefix)), + } + copy(tag_copy.handle, value.handle) + copy(tag_copy.prefix, value.prefix) + emitter.tag_directives = append(emitter.tag_directives, tag_copy) + return nil +} + +// Increase the indentation level. +func (emitter *Emitter) increaseIndentCompact(flow, indentless bool, compact_seq bool) error { + emitter.indents = append(emitter.indents, emitter.indent) + if emitter.indent < 0 { + if flow { + emitter.indent = emitter.BestIndent + } else { + emitter.indent = 0 + } + } else if !indentless { + // [Go] This was changed so that indentations are more regular. + if emitter.states[len(emitter.states)-1] == EMIT_BLOCK_SEQUENCE_ITEM_STATE { + // The first indent inside a sequence will just skip + // the "- " indicator. + emitter.indent += 2 + } else { + // Everything else aligns to the chosen indentation. + emitter.indent = emitter.BestIndent * + ((emitter.indent + emitter.BestIndent) / emitter.BestIndent) + if compact_seq { + // The value compact_seq passed in is almost + // always set to `false` when this function is + // called, except when we are dealing with + // sequence nodes. So this gets triggered to + // subtract 2 only when we are increasing the + // indent to account for sequence nodes, which + // will be correct because we need to subtract + // 2 to account for the - at the beginning of + // the sequence node. + emitter.indent = emitter.indent - 2 + } + } + } + return nil +} + +// emitter preserves the original signature and delegates to +// increaseIndentCompact without compact-sequence indentation +func (emitter *Emitter) increaseIndent(flow, indentless bool) error { + return emitter.increaseIndentCompact(flow, indentless, false) +} + +// silentNilEvent checks if an event represents an implicit null scalar that +// can be omitted in non-canonical mode. +func (emitter *Emitter) silentNilEvent(event *Event) bool { + return event.Type == SCALAR_EVENT && event.Implicit && !emitter.canonical && len(emitter.scalar_data.value) == 0 +} + +// requiredQuoteStyle returns the appropriate quote style based on the +// emitter's quotePreference setting. +func (emitter *Emitter) requiredQuoteStyle() ScalarStyle { + if emitter.quotePreference == QuoteDouble { + return DOUBLE_QUOTED_SCALAR_STYLE + } + return SINGLE_QUOTED_SCALAR_STYLE +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/errors.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/errors.go index 8b279bf..a33cc77 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/errors.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/errors.go @@ -12,111 +12,185 @@ import ( "strings" ) -type MarkedYAMLError struct { - // optional context - ContextMark Mark - ContextMessage string +// Stage identifies the processing stage where an error occurred during YAML +// loading or dumping. +type Stage string - Mark Mark - Message string +const ( + // Load stages + ReaderStage Stage = "reader" // Input reading and encoding + ScannerStage Stage = "scanner" // Tokenization + ParserStage Stage = "parser" // Event stream parsing + ComposerStage Stage = "composer" // Node tree construction + ResolverStage Stage = "resolver" // Tag resolution + ConstructorStage Stage = "constructor" // Go value construction + + // Dump stages + RepresenterStage Stage = "representer" // Go value to Node tree + SerializerStage Stage = "serializer" // Node tree to events + EmitterStage Stage = "emitter" // Events to YAML bytes + WriterStage Stage = "writer" // Output writing +) + +// LoadError represents an error that occurred while loading a YAML document. +// +// It provides detailed location information and identifies the processing +// stage where the error occurred. +type LoadError struct { + Stage Stage // Processing stage where error occurred + Message string // Error description + + // Position information + Mark Mark // Primary error position + ContextMark Mark // Optional context position (e.g., start of construct) + ContextMsg string // Optional context message + + // Error chaining + err error // Underlying error (for Unwrap support) } -func (e MarkedYAMLError) Error() string { +// Error returns the error message with stage and position information. +// Format: "go-yaml load error in at L:C: " +// Or with context: "go-yaml load error in () at L:C-L:C: " +func (e *LoadError) Error() string { + if len(e.ContextMsg) > 0 { + return fmt.Sprintf("go-yaml load error in %s (%s) at %s: %s", + e.Stage, e.ContextMsg, e.ContextMark.rangeString(e.Mark), e.Message) + } + return fmt.Sprintf("go-yaml load error in %s at %s: %s", + e.Stage, e.Mark.shortString(), e.Message) +} + +// simpleError returns the error message without the "yaml: Load error (in stage)" prefix. +// Used for formatting errors within LoadErrors collections. +// Format: "line L: " (backwards compatible - no column info) +func (e *LoadError) simpleError() string { var builder strings.Builder - builder.WriteString("yaml: ") - if len(e.ContextMessage) > 0 { - fmt.Fprintf(&builder, "%s at %s: ", e.ContextMessage, e.ContextMark) + if len(e.ContextMsg) > 0 { + fmt.Fprintf(&builder, "%s at %s: ", e.ContextMsg, e.ContextMark) } - if len(e.ContextMessage) == 0 || e.ContextMark != e.Mark { - fmt.Fprintf(&builder, "%s: ", e.Mark) + if len(e.ContextMsg) == 0 || e.ContextMark != e.Mark { + if e.Mark.Line > 0 { + fmt.Fprintf(&builder, "line %d: ", e.Mark.Line) + } else { + builder.WriteString(": ") + } } builder.WriteString(e.Message) return builder.String() } -type ParserError MarkedYAMLError +// Unwrap returns the underlying error. +func (e *LoadError) Unwrap() error { + return e.err +} -func (e ParserError) Error() string { - return MarkedYAMLError(e).Error() +// NewLoadError creates a LoadError with an underlying cause. +// The cause is accessible via Unwrap for use with [errors.Is] and [errors.As]. +func NewLoadError(stage Stage, message string, mark Mark, cause error) *LoadError { + return &LoadError{ + Stage: stage, + Message: message, + Mark: mark, + err: cause, + } } -type ScannerError MarkedYAMLError +// DumpError represents an error that occurred while dumping a YAML document. +// +// It identifies the processing stage where the error occurred and provides +// an optional underlying cause via Unwrap. +type DumpError struct { + Stage Stage // Processing stage where error occurred + Message string // Error description -func (e ScannerError) Error() string { - return MarkedYAMLError(e).Error() + // Error chaining + err error // Underlying error (for Unwrap support) } -type ReaderError struct { - Offset int - Value int - Err error +// Error returns the error message with stage information. +// Format: "go-yaml dump error in : " +func (e *DumpError) Error() string { + return fmt.Sprintf("go-yaml dump error in %s: %s", e.Stage, e.Message) } -func (e ReaderError) Error() string { - return fmt.Sprintf("yaml: offset %d: %s", e.Offset, e.Err) +// Unwrap returns the underlying error. +func (e *DumpError) Unwrap() error { + return e.err } -func (e ReaderError) Unwrap() error { - return e.Err +// NewDumpError creates a DumpError with an underlying cause. +// The cause is accessible via Unwrap for use with [errors.Is] and [errors.As]. +func NewDumpError(stage Stage, message string, cause error) *DumpError { + return &DumpError{Stage: stage, Message: message, err: cause} } +// failDump panics with a YAMLError wrapping a DumpError for the given stage. +// If err is exactly a *DumpError it is passed through unchanged to avoid +// double-wrapping (e.g. a user MarshalYAML that returns yaml.NewDumpError). +// Errors that merely wrap a *DumpError are treated as ordinary errors so that +// the outer wrapper's message and context are preserved. +func failDump(stage Stage, err error) { + if de, ok := err.(*DumpError); ok { + panic(&YAMLError{de}) + } + panic(&YAMLError{&DumpError{Stage: stage, Message: err.Error(), err: err}}) +} + +// failDumpf panics with a YAMLError wrapping a formatted DumpError. +func failDumpf(stage Stage, format string, args ...any) { + panic(&YAMLError{&DumpError{Stage: stage, Message: fmt.Sprintf(format, args...)}}) +} + +// EmitterError represents an error that occurred during emitting. type EmitterError struct { Message string } +// Error returns the error message. func (e EmitterError) Error() string { return fmt.Sprintf("yaml: %s", e.Message) } +// WriterError represents an error that occurred while writing output. type WriterError struct { Err error } +// Error returns the error message. func (e WriterError) Error() string { return fmt.Sprintf("yaml: %s", e.Err) } +// Unwrap returns the underlying error. func (e WriterError) Unwrap() error { return e.Err } -// ConstructError represents a single, non-fatal error that occurred during -// the constructing of a YAML document into a Go value. -type ConstructError struct { - Err error - Line int - Column int -} - -func (e *ConstructError) Error() string { - return fmt.Sprintf("line %d: %s", e.Line, e.Err.Error()) -} - -func (e *ConstructError) Unwrap() error { - return e.Err -} - // LoadErrors is returned when one or more fields cannot be properly decoded. type LoadErrors struct { - Errors []*ConstructError + Errors []*LoadError } +// Error returns a formatted error message listing all construct errors. func (e *LoadErrors) Error() string { var b strings.Builder - b.WriteString("yaml: construct errors:") - for _, err := range e.Errors { - b.WriteString("\n ") - b.WriteString(err.Error()) + b.WriteString("yaml: construct errors: ") + for i, err := range e.Errors { + if i > 0 { + b.WriteString("; ") + } + b.WriteString(err.simpleError()) } return b.String() } -// As implements errors.As for Go versions prior to 1.20 that don't support +// As implements [errors.As] for Go versions prior to 1.20 that don't support // the Unwrap() []error interface. It allows [LoadErrors] to match against -// *ConstructError targets by returning the first error in the list. +// *LoadError or *TypeError targets. func (e *LoadErrors) As(target any) bool { switch t := target.(type) { - case **ConstructError: + case **LoadError: if len(e.Errors) == 0 { return false } @@ -125,7 +199,7 @@ func (e *LoadErrors) As(target any) bool { case **TypeError: var msgs []string for _, err := range e.Errors { - msgs = append(msgs, err.Error()) + msgs = append(msgs, err.simpleError()) } *t = &TypeError{Errors: msgs} return true @@ -133,7 +207,7 @@ func (e *LoadErrors) As(target any) bool { return false } -// Is implements errors.Is for Go versions prior to 1.20 that don't support +// Is implements [errors.Is] for Go versions prior to 1.20 that don't support // the Unwrap() []error interface. It checks if any wrapped error matches // the target error. func (e *LoadErrors) Is(target error) bool { @@ -145,7 +219,7 @@ func (e *LoadErrors) Is(target error) bool { return false } -// TypeError is an obsolete error type retained for compatibility. +// TypeError is a legacy error type retained for compatibility. // // A TypeError is returned by Unmarshal when one or more fields in // the YAML document cannot be properly decoded into the requested @@ -157,8 +231,9 @@ type TypeError struct { Errors []string } +// Error returns a formatted error message listing all unmarshal errors. func (e *TypeError) Error() string { - return fmt.Sprintf("yaml: unmarshal errors:\n %s", strings.Join(e.Errors, "\n ")) + return fmt.Sprintf("yaml: unmarshal errors: %s", strings.Join(e.Errors, "; ")) } // YAMLError is an internal error wrapper type. @@ -166,6 +241,19 @@ type YAMLError struct { Err error } +// Error returns the error message. func (e *YAMLError) Error() string { return e.Err.Error() } + +// handleErr recovers from panics caused by yaml errors. +// It's used in defer statements to convert YAMLError panics into regular errors. +func handleErr(err *error) { + if v := recover(); v != nil { + if e, ok := v.(*YAMLError); ok { + *err = e.Err + } else { + panic(v) + } + } +} diff --git a/vendor/go.yaml.in/yaml/v4/loader.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/loader.go similarity index 55% rename from vendor/go.yaml.in/yaml/v4/loader.go rename to vendor/go.yaml.in/yaml/v4/internal/libyaml/loader.go index aa9757f..6b80812 100644 --- a/vendor/go.yaml.in/yaml/v4/loader.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/loader.go @@ -7,18 +7,45 @@ // - Load: Decode YAML document(s) into a value (use WithAll for multi-doc) // - NewLoader: Create a streaming loader from io.Reader -package yaml +package libyaml import ( "bytes" "errors" "io" "reflect" - - "go.yaml.in/yaml/v4/internal/libyaml" ) -// Load decodes YAML document(s) with the given options. +// A Loader reads and loads YAML values from an input stream with configurable +// options. +type Loader struct { + composer *Composer + resolver *Resolver + constructor *Constructor + options *Options + docCount int +} + +// NewLoader returns a new Loader that reads from r with the given options. +// +// The Loader introduces its own buffering and may read data from r beyond the +// YAML values requested. +func NewLoader(r io.Reader, opts ...Option) (*Loader, error) { + o, err := ApplyOptions(opts...) + if err != nil { + return nil, err + } + c := NewComposerFromReader(r, o) + c.SetStreamNodes(o.StreamNodes) + return &Loader{ + composer: c, + resolver: NewResolver(o), + constructor: NewConstructor(o), + options: o, + }, nil +} + +// Load loads YAML document(s) with the given options. // // By default, Load requires exactly one document in the input. // If zero documents are found, it returns an error. @@ -30,7 +57,7 @@ import ( // yaml.Load(multiDocYAML, &configs, yaml.WithAllDocuments()) // // When WithAllDocuments is used, out must be a pointer to a slice. -// Each document is decoded into the slice element type. +// Each document is loaded into the slice element type. // Zero documents results in an empty slice (no error). // // Maps and pointers (to a struct, string, int, etc) are accepted as out @@ -38,8 +65,8 @@ import ( // the yaml package will initialize it if necessary. The out parameter // must not be nil. // -// The type of the decoded values should be compatible with the respective -// values in out. If one or more values cannot be decoded due to type +// The type of the loaded values should be compatible with the respective +// values in out. If one or more values cannot be loaded due to type // mismatches, decoding continues partially until the end of the YAML // content, and a *yaml.LoadErrors is returned with details for all // missed values. @@ -62,7 +89,7 @@ import ( // See the documentation of Dump for the format of tags and a list of // supported tag options. func Load(in []byte, out any, opts ...Option) error { - o, err := libyaml.ApplyOptions(opts...) + o, err := ApplyOptions(opts...) if err != nil { return err } @@ -76,26 +103,84 @@ func Load(in []byte, out any, opts ...Option) error { return loadSingle(in, out, o) } -// loadAll loads all documents into a slice -func loadAll(in []byte, out any, opts *libyaml.Options) error { +// Load reads the next YAML-encoded document from its input and stores it +// in the value pointed to by v. +// +// Returns [io.EOF] when there are no more documents to read. +// If WithSingleDocument option was set and a document was already read, +// subsequent calls return [io.EOF]. +// +// Maps and pointers (to a struct, string, int, etc) are accepted as v +// values. If an internal pointer within a struct is not initialized, +// the yaml package will initialize it if necessary. The v parameter +// must not be nil. +// +// Struct fields are only loaded if they are exported (have an upper case +// first letter), and are loaded using the field name lowercased as the +// default key. Custom keys may be defined via the "yaml" name in the field +// tag: the content preceding the first comma is used as the key, and the +// following comma-separated options control the loading and dumping behavior. +// +// See the documentation of the package-level Load function for more details +// about YAML to Go conversion and tag options. +func (l *Loader) Load(v any) (err error) { + defer handleErr(&err) + if l.options.SingleDocument && l.docCount > 0 { + return io.EOF + } + + // Stage 1: Compose - parse events into node tree (unresolved tags) + node := l.composer.Compose() // *Node + if node == nil { + return io.EOF + } + l.docCount++ + + // Stage 2: Resolve - determine implicit types for untagged scalars + l.resolver.Resolve(node) + + // Stage 3: Construct - convert node tree to Go values + out := reflect.ValueOf(v) + if out.Kind() == reflect.Pointer && !out.IsNil() { + out = out.Elem() + } + l.constructor.Construct(node, out) + if len(l.constructor.TypeErrors) > 0 { + typeErrors := l.constructor.TypeErrors + l.constructor.TypeErrors = nil + return &LoadErrors{Errors: typeErrors} + } + return nil +} + +// loadAll loads all documents from the input into a slice. +// The out parameter must be a non-nil pointer to a slice. +// Each document is appended to the slice as an element. +func loadAll(in []byte, out any, opts *Options) error { outVal := reflect.ValueOf(out) if outVal.Kind() != reflect.Pointer || outVal.IsNil() { - return &LoadErrors{Errors: []*libyaml.ConstructError{{ - Err: errors.New("yaml: WithAllDocuments requires a non-nil pointer to a slice"), + msg := "yaml: WithAllDocuments requires a non-nil pointer to a slice" + return &LoadErrors{Errors: []*LoadError{{ + Stage: ConstructorStage, + Message: msg, + err: errors.New(msg), }}} } sliceVal := outVal.Elem() if sliceVal.Kind() != reflect.Slice { - return &LoadErrors{Errors: []*libyaml.ConstructError{{ - Err: errors.New("yaml: WithAllDocuments requires a pointer to a slice"), + msg := "yaml: WithAllDocuments requires a pointer to a slice" + return &LoadErrors{Errors: []*LoadError{{ + Stage: ConstructorStage, + Message: msg, + err: errors.New(msg), }}} } // Create a new slice (clear existing content) sliceVal.Set(reflect.MakeSlice(sliceVal.Type(), 0, 0)) - l, err := NewLoader(bytes.NewReader(in), func(o *libyaml.Options) error { + l, err := NewLoader(bytes.NewReader(in), func(o *Options) error { *o = *opts // Copy options return nil }) @@ -114,16 +199,18 @@ func loadAll(in []byte, out any, opts *libyaml.Options) error { if err != nil { return err } - // Append decoded element to slice + // Append loaded element to slice sliceVal.Set(reflect.Append(sliceVal, elemPtr.Elem())) } return nil } -// loadSingle loads exactly one document (strict) -func loadSingle(in []byte, out any, opts *libyaml.Options) error { - l, err := NewLoader(bytes.NewReader(in), func(o *libyaml.Options) error { +// loadSingle loads exactly one document from the input. +// Returns an error if the input contains zero or multiple documents +// (unless FromLegacy option is set for backward compatibility). +func loadSingle(in []byte, out any, opts *Options) error { + l, err := NewLoader(bytes.NewReader(in), func(o *Options) error { *o = *opts // Copy options return nil }) @@ -134,14 +221,25 @@ func loadSingle(in []byte, out any, opts *libyaml.Options) error { // Load first document err = l.Load(out) if err == io.EOF { - return &LoadErrors{Errors: []*libyaml.ConstructError{{ - Err: errors.New("yaml: no documents in stream"), + if opts.FromLegacy { + return nil + } + msg := "yaml: no documents in stream" + return &LoadErrors{Errors: []*LoadError{{ + Stage: ConstructorStage, + Message: msg, + err: errors.New(msg), }}} } if err != nil { return err } + // Skip trailing document check for legacy Unmarshal() compatibility + if opts.FromLegacy { + return nil + } + // Check for additional documents var dummy any err = l.Load(&dummy) @@ -151,81 +249,53 @@ func loadSingle(in []byte, out any, opts *libyaml.Options) error { return err } // Successfully loaded a second document - this is an error in strict mode - return &LoadErrors{Errors: []*libyaml.ConstructError{{ - Err: errors.New("yaml: expected single document, found multiple"), + msg := "yaml: expected single document, found multiple" + return &LoadErrors{Errors: []*LoadError{{ + Stage: ConstructorStage, + Message: msg, + err: errors.New(msg), }}} } return nil } -// A Loader reads and decodes YAML values from an input stream with configurable -// options. -type Loader struct { - composer *libyaml.Composer - decoder *libyaml.Constructor - opts *libyaml.Options - docCount int +// SetKnownFields enables or disables strict field checking for subsequent Load +// calls. +// This is used by the legacy Decoder.KnownFields() method. +func (l *Loader) SetKnownFields(enable bool) { + l.constructor.KnownFields = enable } -// NewLoader returns a new Loader that reads from r with the given options. -// -// The Loader introduces its own buffering and may read data from r beyond the -// YAML values requested. -func NewLoader(r io.Reader, opts ...Option) (*Loader, error) { - o, err := libyaml.ApplyOptions(opts...) - if err != nil { - return nil, err +// ComposeAndResolve composes and resolves the next document from the input +// and returns the node without constructing Go values. This is used by +// Unmarshal() to support the Unmarshaler interface. +func (l *Loader) ComposeAndResolve() *Node { + if l.options.SingleDocument && l.docCount > 0 { + return nil } - c := libyaml.NewComposerFromReader(r) - c.SetStreamNodes(o.StreamNodes) - return &Loader{ - composer: c, - decoder: libyaml.NewConstructor(o), - opts: o, - }, nil -} -// Load reads the next YAML-encoded document from its input and stores it -// in the value pointed to by v. -// -// Returns io.EOF when there are no more documents to read. -// If WithSingleDocument option was set and a document was already read, -// subsequent calls return io.EOF. -// -// Maps and pointers (to a struct, string, int, etc) are accepted as v -// values. If an internal pointer within a struct is not initialized, -// the yaml package will initialize it if necessary. The v parameter -// must not be nil. -// -// Struct fields are only loaded if they are exported (have an upper case -// first letter), and are loaded using the field name lowercased as the -// default key. Custom keys may be defined via the "yaml" name in the field -// tag: the content preceding the first comma is used as the key, and the -// following comma-separated options control the loading and dumping behavior. -// -// See the documentation of the package-level Load function for more details -// about YAML to Go conversion and tag options. -func (l *Loader) Load(v any) (err error) { - defer handleErr(&err) - if l.opts.SingleDocument && l.docCount > 0 { - return io.EOF - } - node := l.composer.Parse() // *libyaml.Node + // Stage 1: Compose - parse events into node tree (unresolved tags) + node := l.composer.Compose() if node == nil { - return io.EOF + return nil } l.docCount++ - out := reflect.ValueOf(v) - if out.Kind() == reflect.Pointer && !out.IsNil() { - out = out.Elem() - } - l.decoder.Construct(node, out) // Pass libyaml.Node directly - if len(l.decoder.TypeErrors) > 0 { - typeErrors := l.decoder.TypeErrors - l.decoder.TypeErrors = nil - return &LoadErrors{Errors: typeErrors} + // Stage 2: Resolve - determine implicit types for untagged scalars + l.resolver.Resolve(node) + + return node +} + +// LoadAny parses YAML data into generic Go structures (map[string]any, []any). +// +// Useful for test data loading where the structure is unknown at compile time. +// This is a convenience wrapper around Load with an any target. +func LoadAny(data []byte) (any, error) { + var result any + if err := Load(data, &result); err != nil { + return nil, err } - return nil + return result, nil } diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/node.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/node.go index 48b2582..4fee73b 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/node.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/node.go @@ -28,13 +28,17 @@ const ( mergeTag = "!!merge" ) +// longTagPrefix is the standard YAML tag prefix for core types. const longTagPrefix = "tag:yaml.org,2002:" +// longTags maps short tags to their long form representations. +// shortTags maps long tags to their short form representations. var ( longTags = make(map[string]string) shortTags = make(map[string]string) ) +// init initializes the tag conversion maps. func init() { for _, stag := range []string{nullTag, boolTag, strTag, intTag, floatTag, timestampTag, seqTag, mapTag, binaryTag, mergeTag} { ltag := longTag(stag) @@ -43,6 +47,7 @@ func init() { } } +// shortTag converts a long-form tag to its short form (e.g., "tag:yaml.org,2002:str" to "!!str"). func shortTag(tag string) string { if strings.HasPrefix(tag, longTagPrefix) { if stag, ok := shortTags[tag]; ok { @@ -53,6 +58,7 @@ func shortTag(tag string) string { return tag } +// longTag converts a short-form tag to its long form (e.g., "!!str" to "tag:yaml.org,2002:str"). func longTag(tag string) string { if strings.HasPrefix(tag, "!!") { if ltag, ok := longTags[tag]; ok { @@ -66,6 +72,7 @@ func longTag(tag string) string { // Kind represents the type of YAML node type Kind uint32 +// Kind constants define the different types of YAML nodes. const ( DocumentNode Kind = 1 << iota SequenceNode @@ -78,6 +85,7 @@ const ( // Style represents the formatting style of a YAML node type Style uint32 +// Style constants define different formatting styles for YAML nodes. const ( TaggedStyle Style = 1 << iota DoubleQuotedStyle @@ -99,6 +107,14 @@ type StreamTagDirective struct { Prefix string } +// Stream holds stream-level metadata for StreamNode. +// This includes encoding, version directive, and tag directives. +type Stream struct { + Encoding Encoding + Version *StreamVersionDirective + TagDirectives []StreamTagDirective +} + // Node represents an element in the YAML document hierarchy. While documents // are typically encoded and decoded into higher level types, such as structs // and maps, Node is an intermediate representation that allows detailed @@ -171,26 +187,15 @@ type Node struct { Line int Column int - // StreamNode-specific fields (only valid when Kind == StreamNode) - - // Encoding holds the stream encoding (UTF-8, UTF-16LE, UTF-16BE). - // Only valid for StreamNode. - Encoding Encoding - - // Version holds the YAML version directive (%YAML). - // Only valid for StreamNode. - Version *StreamVersionDirective - - // TagDirectives holds the %TAG directives. - // Only valid for StreamNode. - TagDirectives []StreamTagDirective + // Stream holds stream metadata (non-nil only when Kind == StreamNode). + Stream *Stream } // IsZero returns whether the node has all of its fields unset. func (n *Node) IsZero() bool { return n.Kind == 0 && n.Style == 0 && n.Tag == "" && n.Value == "" && n.Anchor == "" && n.Alias == nil && n.Content == nil && n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0 && - n.Encoding == 0 && n.Version == nil && n.TagDirectives == nil + n.Stream == nil } // LongTag returns the long form of the tag that indicates the data type for @@ -230,6 +235,7 @@ func (n *Node) ShortTag() string { return shortTag(n.Tag) } +// indicatedString returns true if the node's style explicitly indicates a string type. func (n *Node) indicatedString() bool { return n.Kind == ScalarNode && (shortTag(n.Tag) == strTag || @@ -324,14 +330,22 @@ func (n *Node) Load(v any, opts ...Option) (err error) { // conversion of Go values into YAML. func (n *Node) Encode(v any) (err error) { defer handleErr(&err) - e := NewRepresenter(noWriter, DefaultOptions) - defer e.Destroy() - e.MarshalDoc("", reflect.ValueOf(v)) - e.Finish() - p := NewComposer(e.Out) + // Use the 3-stage dump pipeline with round-trip to preserve styles + r := NewRepresenter(DefaultOptions) + node := r.Represent("", reflect.ValueOf(v)) + d := NewDesolver(DefaultOptions) + d.Desolve(node) + s := NewSerializer(nil, DefaultOptions) + var out []byte + s.Emitter.SetOutputString(&out) + s.Serialize(node) + s.Finish() + // Parse back to get styles + p := NewComposer(out, nil) p.Textless = true defer p.Destroy() - doc := p.Parse() + doc := p.Compose() + NewResolver(nil).Resolve(doc) *n = *doc.Content[0] return nil } @@ -350,14 +364,106 @@ func (n *Node) Dump(v any, opts ...Option) (err error) { if err != nil { return err } - e := NewRepresenter(noWriter, o) - defer e.Destroy() - e.MarshalDoc("", reflect.ValueOf(v)) - e.Finish() - p := NewComposer(e.Out) + // Use the 3-stage dump pipeline with round-trip to preserve styles + r := NewRepresenter(o) + node := r.Represent("", reflect.ValueOf(v)) + d := NewDesolver(o) + d.Desolve(node) + s := NewSerializer(nil, o) + var out []byte + s.Emitter.SetOutputString(&out) + s.Serialize(node) + s.Finish() + // Parse back to get styles + p := NewComposer(out, nil) p.Textless = true defer p.Destroy() - doc := p.Parse() + doc := p.Compose() + NewResolver(nil).Resolve(doc) *n = *doc.Content[0] return nil } + +// Marshaler interface may be implemented by types to customize their +// behavior when being marshaled into a YAML document. +type Marshaler interface { + MarshalYAML() (any, error) +} + +// Unmarshaler is the interface implemented by types that can unmarshal +// a YAML description of themselves. +type Unmarshaler interface { + UnmarshalYAML(node *Node) error +} + +// IsZeroer is used to check whether an object is zero to determine whether +// it should be omitted when marshaling with the ,omitempty flag. One notable +// implementation is [time.Time]. +type IsZeroer interface { + IsZero() bool +} + +// FromYAMLNode is a new interface that types can implement to customize +// their unmarshaling behavior. It receives a Node directly and modifies +// the receiver in place. +// This is the preferred interface for new code. +// +// Note: This interface is reserved for the v4 API and is not yet fully +// integrated into the current implementation. +type FromYAMLNode interface { + FromYAMLNode(*Node) error +} + +// ToYAMLNode is a new interface that types can implement to customize +// their marshaling behavior. It returns a Node directly. +// This is the preferred interface for new code. +// +// Note: This interface is reserved for the v4 API and is not yet fully +// integrated into the current implementation. +type ToYAMLNode interface { + ToYAMLNode() (*Node, error) +} + +// isZero reports whether v represents the zero value for its type. +// If v implements the IsZeroer interface, IsZero() is called. +// Otherwise, zero is determined by checking type-specific conditions. +// This is used to determine omitempty behavior when marshaling. +func isZero(v reflect.Value) bool { + kind := v.Kind() + if z, ok := v.Interface().(IsZeroer); ok { + if (kind == reflect.Pointer || kind == reflect.Interface) && v.IsNil() { + return true + } + return z.IsZero() + } + switch kind { + case reflect.String: + return len(v.String()) == 0 + case reflect.Interface, reflect.Pointer: + return v.IsNil() + case reflect.Slice: + return v.Len() == 0 + case reflect.Map: + return v.Len() == 0 + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Struct: + vt := v.Type() + for i := v.NumField() - 1; i >= 0; i-- { + if vt.Field(i).PkgPath != "" { + continue // Private field + } + if !isZero(v.Field(i)) { + return false + } + } + return true + } + return false +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/options.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/options.go index a21c53c..c2a3ac4 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/options.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/options.go @@ -1,7 +1,5 @@ -// -// Copyright (c) 2025 The go-yaml Project Contributors +// Copyright 2025 The go-yaml Project Contributors // SPDX-License-Identifier: Apache-2.0 -// // Options configuration for loading and dumping YAML. // Provides centralized control for indentation, line width, strictness, and @@ -34,11 +32,68 @@ type Options struct { ExplicitEnd bool // Always emit ... FlowSimpleCollections bool // Use flow style for simple collections QuotePreference QuoteStyle // Preferred quote style when quoting is required + + // Safety limit checks (set by ApplyOptions or WithPlugin(limit.New(...))) + DepthCheck func(depth int, ctx *DepthContext) error + AliasCheck func(aliasCount, constructCount int) error + + // Private options (not exported, used internally) + FromLegacy bool // Indicates legacy Unmarshal()/Decoder path (check Unmarshaler, allow trailing content) } // Option allows configuring YAML loading and dumping operations. type Option func(*Options) error +// DepthKind represents the type of nesting (flow or block). +type DepthKind string + +// DepthKindFlow and DepthKindBlock are the possible values of DepthContext.Kind. +const ( + DepthKindFlow DepthKind = "flow" + DepthKindBlock DepthKind = "block" +) + +// DepthContext holds context about a nesting depth check. +type DepthContext struct { + Kind DepthKind +} + +// DefaultDepthCheck is the default depth check function. +// It returns an error when depth exceeds 10000. +func DefaultDepthCheck(depth int, ctx *DepthContext) error { + const maxDepth = 10000 + if depth > maxDepth { + return fmt.Errorf("exceeded max depth of %d", maxDepth) + } + return nil +} + +// DefaultAliasCheck is the default alias check function. +// It uses a ratio-based heuristic to prevent DoS attacks via excessive aliasing. +func DefaultAliasCheck(aliasCount, constructCount int) error { + const ( + aliasRatioRangeLow = 400000 + aliasRatioRangeHigh = 4000000 + aliasRatioRange = float64(aliasRatioRangeHigh - aliasRatioRangeLow) + ) + if aliasCount <= 100 || constructCount <= 1000 { + return nil + } + var allowed float64 + switch { + case constructCount <= aliasRatioRangeLow: + allowed = 0.99 + case constructCount >= aliasRatioRangeHigh: + allowed = 0.10 + default: + allowed = 0.99 - 0.89*(float64(constructCount-aliasRatioRangeLow)/aliasRatioRange) + } + if float64(aliasCount)/float64(constructCount) > allowed { + return errors.New("document contains excessive aliasing") + } + return nil +} + // WithIndent sets the number of spaces to use for indentation when // dumping YAML content. // @@ -92,7 +147,7 @@ func WithKnownFields(knownFields ...bool) Option { // WithSingleDocument configures the Loader to only process the first document // in a YAML stream. After the first document is loaded, subsequent calls to -// Load will return io.EOF. +// Load will return [io.EOF]. // // When called without arguments, defaults to true. // @@ -371,6 +426,10 @@ func ApplyOptions(opts ...Option) (*Options, error) { LineWidth: 80, Unicode: true, UniqueKeys: true, + + // Default safety limits + DepthCheck: DefaultDepthCheck, + AliasCheck: DefaultAliasCheck, } for _, opt := range opts { if err := opt(o); err != nil { diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/parser.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/parser.go index 34152d6..64daaaf 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/parser.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/parser.go @@ -4,7 +4,8 @@ // SPDX-License-Identifier: Apache-2.0 AND MIT // Parser stage: Transforms token stream into event stream. -// Implements a recursive-descent parser (LL(1)) following the YAML grammar specification. +// Implements a recursive-descent parser (LL(1)) following the YAML grammar +// specification. // // The parser implements the following grammar: // @@ -52,59 +53,213 @@ import ( "strings" ) -// Peek the next token in the token queue. -func (parser *Parser) peekToken(out **Token) error { - if !parser.token_available { - if err := parser.fetchMoreTokens(); err != nil { - return err - } +// ReadHandler is called by the [Parser] when it needs to read more bytes +// from the input source. The handler should fill the provided buffer with +// up to len(buffer) bytes from the input source. +// +// The arguments are as follows: +// +// [in] parser The parser object. +// [out] buffer The buffer for reading. +// [out] size_read The actual number of bytes read from the source. +// +// On success, the handler should return 1. If the handler failed, +// the returned value should be 0. On EOF, the handler should set the +// size_read to 0 and return 1. +type ReadHandler func(parser *Parser, buffer []byte) (n int, err error) + +// SimpleKey holds information about a potential simple key. +type SimpleKey struct { + flow_level int // What flow level is the key at? + required bool // Is a simple key required? + token_number int // The number of the token. + mark Mark // The position mark. +} + +// ParserState represents the state of the parser. +type ParserState int + +// Parser state constants define the different states the parser can be in. +const ( + PARSE_STREAM_START_STATE ParserState = iota + + PARSE_IMPLICIT_DOCUMENT_START_STATE // Expect the beginning of an implicit document. + PARSE_DOCUMENT_START_STATE // Expect DOCUMENT-START. + PARSE_DOCUMENT_CONTENT_STATE // Expect the content of a document. + PARSE_DOCUMENT_END_STATE // Expect DOCUMENT-END. + PARSE_BLOCK_NODE_STATE // Expect a block node. + PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a block sequence. + PARSE_BLOCK_SEQUENCE_ENTRY_STATE // Expect an entry of a block sequence. + PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE // Expect an entry of an indentless sequence. + PARSE_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. + PARSE_BLOCK_MAPPING_KEY_STATE // Expect a block mapping key. + PARSE_BLOCK_MAPPING_VALUE_STATE // Expect a block mapping value. + PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a flow sequence. + PARSE_FLOW_SEQUENCE_ENTRY_STATE // Expect an entry of a flow sequence. + PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE // Expect a key of an ordered mapping. + PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping. + PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE // Expect the and of an ordered mapping entry. + PARSE_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. + PARSE_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. + PARSE_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. + PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE // Expect an empty value of a flow mapping. + PARSE_END_STATE // Expect nothing. +) + +// String returns a string representation of the parser state. +func (ps ParserState) String() string { + switch ps { + case PARSE_STREAM_START_STATE: + return "PARSE_STREAM_START_STATE" + case PARSE_IMPLICIT_DOCUMENT_START_STATE: + return "PARSE_IMPLICIT_DOCUMENT_START_STATE" + case PARSE_DOCUMENT_START_STATE: + return "PARSE_DOCUMENT_START_STATE" + case PARSE_DOCUMENT_CONTENT_STATE: + return "PARSE_DOCUMENT_CONTENT_STATE" + case PARSE_DOCUMENT_END_STATE: + return "PARSE_DOCUMENT_END_STATE" + case PARSE_BLOCK_NODE_STATE: + return "PARSE_BLOCK_NODE_STATE" + case PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: + return "PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE" + case PARSE_BLOCK_SEQUENCE_ENTRY_STATE: + return "PARSE_BLOCK_SEQUENCE_ENTRY_STATE" + case PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: + return "PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE" + case PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: + return "PARSE_BLOCK_MAPPING_FIRST_KEY_STATE" + case PARSE_BLOCK_MAPPING_KEY_STATE: + return "PARSE_BLOCK_MAPPING_KEY_STATE" + case PARSE_BLOCK_MAPPING_VALUE_STATE: + return "PARSE_BLOCK_MAPPING_VALUE_STATE" + case PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: + return "PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE" + case PARSE_FLOW_SEQUENCE_ENTRY_STATE: + return "PARSE_FLOW_SEQUENCE_ENTRY_STATE" + case PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: + return "PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE" + case PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: + return "PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE" + case PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: + return "PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE" + case PARSE_FLOW_MAPPING_FIRST_KEY_STATE: + return "PARSE_FLOW_MAPPING_FIRST_KEY_STATE" + case PARSE_FLOW_MAPPING_KEY_STATE: + return "PARSE_FLOW_MAPPING_KEY_STATE" + case PARSE_FLOW_MAPPING_VALUE_STATE: + return "PARSE_FLOW_MAPPING_VALUE_STATE" + case PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: + return "PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE" + case PARSE_END_STATE: + return "PARSE_END_STATE" } + return "" +} - token := &parser.tokens[parser.tokens_head] - parser.UnfoldComments(token) - *out = token - return nil +// AliasData holds information about aliases. +type AliasData struct { + anchor []byte // The anchor. + index int // The node id. + mark Mark // The anchor mark. } -// UnfoldComments walks through the comments queue and joins all -// comments behind the position of the provided token into the respective -// top-level comment slices in the parser. -func (parser *Parser) UnfoldComments(token *Token) { - for parser.comments_head < len(parser.comments) && token.StartMark.Index >= parser.comments[parser.comments_head].TokenMark.Index { - comment := &parser.comments[parser.comments_head] - if len(comment.Head) > 0 { - if token.Type == BLOCK_END_TOKEN { - // No heads on ends, so keep comment.Head for a follow up token. - break - } - if len(parser.HeadComment) > 0 { - parser.HeadComment = append(parser.HeadComment, '\n') - } - parser.HeadComment = append(parser.HeadComment, comment.Head...) - } - if len(comment.Foot) > 0 { - if len(parser.FootComment) > 0 { - parser.FootComment = append(parser.FootComment, '\n') - } - parser.FootComment = append(parser.FootComment, comment.Foot...) - } - if len(comment.Line) > 0 { - if len(parser.LineComment) > 0 { - parser.LineComment = append(parser.LineComment, '\n') - } - parser.LineComment = append(parser.LineComment, comment.Line...) - } - *comment = Comment{} - parser.comments_head++ - } +// Comment holds information about a comment in the YAML stream. +type Comment struct { + ScanMark Mark // Position where scanning for comments started + TokenMark Mark // Position after which tokens will be associated with this comment + StartMark Mark // Position of '#' comment mark + EndMark Mark // Position where comment terminated + + Head []byte + Line []byte + Foot []byte } -// Remove the next token from the queue (must be called after peek_token). -func (parser *Parser) skipToken() { - parser.token_available = false - parser.tokens_parsed++ - parser.stream_end_produced = parser.tokens[parser.tokens_head].Type == STREAM_END_TOKEN - parser.tokens_head++ +// Parser structure holds all information about the current +// state of the parser. +type Parser struct { + lastError error + + // Reader stuff + read_handler ReadHandler // Read handler. + + input_reader io.Reader // File input data. + input []byte // String input data. + input_pos int + + eof bool // EOF flag + + buffer []byte // The working buffer. + buffer_pos int // The current position of the buffer. + + unread int // The number of unread characters in the buffer. + + newlines int // The number of line breaks since last non-break/non-blank character + + raw_buffer []byte // The raw buffer. + raw_buffer_pos int // The current position of the buffer. + + encoding Encoding // The input encoding. + + offset int // The offset of the current position (in bytes). + mark Mark // The mark of the current position. + + // Comments + + HeadComment []byte // The current head comments + LineComment []byte // The current line comments + FootComment []byte // The current foot comments + tail_comment []byte // Foot comment that happens at the end of a block. + stem_comment []byte // Comment in item preceding a nested structure (list inside list item, etc) + + comments []Comment // The folded comments for all parsed tokens + comments_head int + + skip_comments bool // Skip comment scanning for performance + + // Scanner stuff + + stream_start_produced bool // Have we started to scan the input stream? + stream_end_produced bool // Have we reached the end of the input stream? + + flow_level int // The number of unclosed '[' and '{' indicators. + + tokens []Token // The tokens queue. + tokens_head int // The head of the tokens queue. + tokens_parsed int // The number of tokens fetched from the queue. + token_available bool // Does the tokens queue contain a token ready for dequeueing. + + indent int // The current indentation level. + indents []int // The indentation levels stack. + + simple_key_allowed bool // May a simple key occur at the current position? + simple_key_possible bool // Is the current simple key possible? + simple_key SimpleKey // The current simple key. + simple_key_stack []SimpleKey // The stack of simple keys. + + depthCheck func(int, *DepthContext) error // Depth limit check function + + // Parser stuff + + state ParserState // The current parser state. + states []ParserState // The parser states stack. + marks []Mark // The stack of marks. + tag_directives []TagDirective // The list of TAG directives. + + // Representer stuff + + aliases []AliasData // The alias data. +} + +// NewParser creates a new parser object. +func NewParser() Parser { + return Parser{ + raw_buffer: make([]byte, 0, input_raw_buffer_size), + buffer: make([]byte, 0, input_buffer_size), + mark: Mark{Line: 1, Column: 1}, + depthCheck: DefaultDepthCheck, + } } // Parse gets the next event. @@ -130,21 +285,74 @@ func (parser *Parser) Parse(event *Event) error { return nil } -func formatParserError(problem string, problem_mark Mark) error { - return ParserError{ - Mark: problem_mark, - Message: problem, +// Delete a parser object. +func (parser *Parser) Delete() { + *parser = Parser{} +} + +// String read handler. +func yamlStringReadHandler(parser *Parser, buffer []byte) (n int, err error) { + if parser.input_pos == len(parser.input) { + return 0, io.EOF } + n = copy(buffer, parser.input[parser.input_pos:]) + parser.input_pos += n + return n, nil } -func formatParserErrorContext(context string, context_mark Mark, problem string, problem_mark Mark) error { - return ParserError{ - ContextMark: context_mark, - ContextMessage: context, +// Reader read handler. +func yamlReaderReadHandler(parser *Parser, buffer []byte) (n int, err error) { + return parser.input_reader.Read(buffer) +} - Mark: problem_mark, - Message: problem, +// SetInputString sets a string input. +func (parser *Parser) SetInputString(input []byte) { + if parser.read_handler != nil { + panic("must set the input source only once") + } + parser.read_handler = yamlStringReadHandler + parser.input = input + parser.input_pos = 0 +} + +// SetInputReader sets a file input. +func (parser *Parser) SetInputReader(r io.Reader) { + if parser.read_handler != nil { + panic("must set the input source only once") + } + parser.read_handler = yamlReaderReadHandler + parser.input_reader = r +} + +// SetEncoding sets the source encoding. +func (parser *Parser) SetEncoding(encoding Encoding) { + if parser.encoding != ANY_ENCODING { + panic("must set the encoding only once") } + parser.encoding = encoding +} + +// GetPendingComments returns the parser's comment queue for CLI access. +func (parser *Parser) GetPendingComments() []Comment { + return parser.comments +} + +// GetCommentsHead returns the current position in the comment queue. +func (parser *Parser) GetCommentsHead() int { + return parser.comments_head +} + +// SetSkipComments enables or disables comment scanning. +// When enabled, the scanner skips comment tokens for better performance. +func (parser *Parser) SetSkipComments(skip bool) { + parser.skip_comments = skip +} + +// default_tag_directives defines the standard tag directives (! and !!) +// that are implicitly available in all YAML documents. +var default_tag_directives = []TagDirective{ + {[]byte("!"), []byte("!")}, + {[]byte("!!"), []byte("tag:yaml.org,2002:")}, } // State dispatcher. @@ -221,9 +429,9 @@ func (parser *Parser) stateMachine(event *Event) error { } // Parse the production: -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END // -// ************ +// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END +// ************ func (parser *Parser) parseStreamStart(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -244,13 +452,11 @@ func (parser *Parser) parseStreamStart(event *Event) error { } // Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* // -// * -// -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// -// ************************* +// implicit_document ::= block_node DOCUMENT-END* +// * +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// ************************* func (parser *Parser) parseDocumentStart(event *Event, implicit bool) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -258,12 +464,10 @@ func (parser *Parser) parseDocumentStart(event *Event, implicit bool) error { } // Parse extra document end indicators. - if !implicit { - for token.Type == DOCUMENT_END_TOKEN { - parser.skipToken() - if err := parser.peekToken(&token); err != nil { - return err - } + for token.Type == DOCUMENT_END_TOKEN { + parser.skipToken() + if err := parser.peekToken(&token); err != nil { + return err } } @@ -280,9 +484,11 @@ func (parser *Parser) parseDocumentStart(event *Event, implicit bool) error { var head_comment []byte if len(parser.HeadComment) > 0 { - // [Go] Scan the header comment backwards, and if an empty line is found, break - // the header so the part before the last empty line goes into the - // document header, while the bottom of it goes into a follow up event. + // [Go] Scan the header comment backwards, and if an + // empty line is found, break the header so the part + // before the last empty line goes into the document + // header, while the bottom of it goes into a follow up + // event. for i := len(parser.HeadComment) - 1; i > 0; i-- { if parser.HeadComment[i] == '\n' { if i == len(parser.HeadComment)-1 { @@ -344,6 +550,7 @@ func (parser *Parser) parseDocumentStart(event *Event, implicit bool) error { StartMark: token.StartMark, EndMark: token.EndMark, } + parser.setEventComments(event) parser.skipToken() } @@ -351,9 +558,9 @@ func (parser *Parser) parseDocumentStart(event *Event, implicit bool) error { } // Parse the productions: -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // -// *********** +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// *********** func (parser *Parser) parseDocumentContent(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -374,11 +581,10 @@ func (parser *Parser) parseDocumentContent(event *Event) error { } // Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* // -// ************* -// -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// implicit_document ::= block_node DOCUMENT-END* +// ************* +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* func (parser *Parser) parseDocumentEnd(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -412,54 +618,113 @@ func (parser *Parser) parseDocumentEnd(event *Event) error { return nil } -func (parser *Parser) setEventComments(event *Event) { - event.HeadComment = parser.HeadComment - event.LineComment = parser.LineComment - event.FootComment = parser.FootComment - parser.HeadComment = nil - parser.LineComment = nil - parser.FootComment = nil - parser.tail_comment = nil - parser.stem_comment = nil +// Parse directives. +func (parser *Parser) processDirectives(version_directive_ref **VersionDirective, tag_directives_ref *[]TagDirective) error { + var version_directive *VersionDirective + var tag_directives []TagDirective + + var token *Token + if err := parser.peekToken(&token); err != nil { + return err + } + + for token.Type == VERSION_DIRECTIVE_TOKEN || token.Type == TAG_DIRECTIVE_TOKEN { + switch token.Type { + case VERSION_DIRECTIVE_TOKEN: + if version_directive != nil { + return formatParserError( + "found duplicate %YAML directive", token.StartMark) + } + if token.major != 1 || token.minor != 1 { + return formatParserError( + "found incompatible YAML document", token.StartMark) + } + version_directive = &VersionDirective{ + major: token.major, + minor: token.minor, + } + case TAG_DIRECTIVE_TOKEN: + value := TagDirective{ + handle: token.Value, + prefix: token.prefix, + } + if err := parser.appendTagDirective(value, false, token.StartMark); err != nil { + return err + } + tag_directives = append(tag_directives, value) + } + + parser.skipToken() + if err := parser.peekToken(&token); err != nil { + return err + } + } + + for i := range default_tag_directives { + if err := parser.appendTagDirective(default_tag_directives[i], true, token.StartMark); err != nil { + return err + } + } + + if version_directive_ref != nil { + *version_directive_ref = version_directive + } + if tag_directives_ref != nil { + *tag_directives_ref = tag_directives + } + return nil +} + +// Append a tag directive to the directives stack. +func (parser *Parser) appendTagDirective(value TagDirective, allow_duplicates bool, mark Mark) error { + for i := range parser.tag_directives { + if bytes.Equal(value.handle, parser.tag_directives[i].handle) { + if allow_duplicates { + return nil + } + return formatParserError("found duplicate %TAG directive", mark) + } + } + + // [Go] I suspect the copy is unnecessary. This was likely done + // because there was no way to track ownership of the data. + value_copy := TagDirective{ + handle: make([]byte, len(value.handle)), + prefix: make([]byte, len(value.prefix)), + } + copy(value_copy.handle, value.handle) + copy(value_copy.prefix, value.prefix) + parser.tag_directives = append(parser.tag_directives, value_copy) + return nil } // Parse the productions: -// block_node_or_indentless_sequence ::= // -// ALIAS -// ***** -// | properties (block_content | indentless_block_sequence)? -// ********** * -// | block_content | indentless_block_sequence -// * -// -// block_node ::= ALIAS -// -// ***** -// | properties block_content? -// ********** * -// | block_content -// * -// -// flow_node ::= ALIAS -// -// ***** -// | properties flow_content? -// ********** * -// | flow_content -// * -// -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// -// ************************* -// -// block_content ::= block_collection | flow_collection | SCALAR -// -// ****** -// -// flow_content ::= flow_collection | SCALAR -// -// ****** +// block_node_or_indentless_sequence ::= +// ALIAS +// ***** +// | properties (block_content | indentless_block_sequence)? +// ********** * +// | block_content | indentless_block_sequence +// * +// block_node ::= ALIAS +// ***** +// | properties block_content? +// ********** * +// | block_content +// * +// flow_node ::= ALIAS +// ***** +// | properties flow_content? +// ********** * +// | flow_content +// * +// properties ::= TAG ANCHOR? | ANCHOR TAG? +// ************************* +// block_content ::= block_collection | flow_collection | SCALAR +// ****** +// flow_content ::= flow_collection | SCALAR +// ****** func (parser *Parser) parseNode(event *Event, block, indentless_sequence bool) error { // defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() @@ -683,9 +948,9 @@ func (parser *Parser) parseNode(event *Event, block, indentless_sequence bool) e } // Parse the productions: -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END // -// ******************** *********** * ********* +// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END +// ******************** *********** * ********* func (parser *Parser) parseBlockSequenceEntry(event *Event, first bool) error { if first { var token *Token @@ -742,9 +1007,9 @@ func (parser *Parser) parseBlockSequenceEntry(event *Event, first bool) error { } // Parse the productions: -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ // -// *********** * +// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ +// *********** * func (parser *Parser) parseIndentlessSequenceEntry(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -784,10 +1049,11 @@ func (parser *Parser) parseIndentlessSequenceEntry(event *Event) error { // Split stem comment from head comment. // -// When a sequence or map is found under a sequence entry, the former head comment -// is assigned to the underlying sequence or map as a whole, not the individual -// sequence or map entry as would be expected otherwise. To handle this case the -// previous head comment is moved aside as the stem comment. +// When a sequence or map is found under a sequence entry, the former head +// comment is assigned to the underlying sequence or map as a whole, not the +// individual sequence or map entry as would be expected otherwise. +// To handle this case the previous head comment is moved aside as the stem +// comment. func (parser *Parser) splitStemComment(stem_len int) error { if stem_len == 0 { return nil @@ -813,15 +1079,15 @@ func (parser *Parser) splitStemComment(stem_len int) error { } // Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START // -// ******************* -// ((KEY block_node_or_indentless_sequence?)? -// *** * -// (VALUE block_node_or_indentless_sequence?)?)* +// block_mapping ::= BLOCK-MAPPING_START +// ******************* +// ((KEY block_node_or_indentless_sequence?)? +// *** * +// (VALUE block_node_or_indentless_sequence?)?)* // -// BLOCK-END -// ********* +// BLOCK-END +// ********* func (parser *Parser) parseBlockMappingKey(event *Event, first bool) error { if first { var token *Token @@ -837,8 +1103,9 @@ func (parser *Parser) parseBlockMappingKey(event *Event, first bool) error { return err } - // [Go] A tail comment was left from the prior mapping value processed. Emit an event - // as it needs to be processed with that value and not the following key. + // [Go] A tail comment was left from the prior mapping value processed. + // Emit an event as it needs to be processed with that value and not + // the following key. if len(parser.tail_comment) > 0 { *event = Event{ Type: TAIL_COMMENT_EVENT, @@ -888,13 +1155,14 @@ func (parser *Parser) parseBlockMappingKey(event *Event, first bool) error { } // Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START // -// ((KEY block_node_or_indentless_sequence?)? +// block_mapping ::= BLOCK-MAPPING_START +// +// ((KEY block_node_or_indentless_sequence?)? // -// (VALUE block_node_or_indentless_sequence?)?)* -// ***** * -// BLOCK-END +// (VALUE block_node_or_indentless_sequence?)?)* +// ***** * +// BLOCK-END func (parser *Parser) parseBlockMappingValue(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -920,19 +1188,17 @@ func (parser *Parser) parseBlockMappingValue(event *Event) error { } // Parse the productions: -// flow_sequence ::= FLOW-SEQUENCE-START -// -// ******************* -// (flow_sequence_entry FLOW-ENTRY)* -// * ********** -// flow_sequence_entry? -// * -// FLOW-SEQUENCE-END -// ***************** -// -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// * +// flow_sequence ::= FLOW-SEQUENCE-START +// ******************* +// (flow_sequence_entry FLOW-ENTRY)* +// * ********** +// flow_sequence_entry? +// * +// FLOW-SEQUENCE-END +// ***************** +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * func (parser *Parser) parseFlowSequenceEntry(event *Event, first bool) error { if first { var token *Token @@ -995,9 +1261,9 @@ func (parser *Parser) parseFlowSequenceEntry(event *Event, first bool) error { } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// *** * +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// *** * func (parser *Parser) parseFlowSequenceEntryMappingKey(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -1016,9 +1282,9 @@ func (parser *Parser) parseFlowSequenceEntryMappingKey(event *Event) error { } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// ***** * +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// ***** * func (parser *Parser) parseFlowSequenceEntryMappingValue(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -1040,9 +1306,9 @@ func (parser *Parser) parseFlowSequenceEntryMappingValue(event *Event) error { } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? // -// * +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * func (parser *Parser) parseFlowSequenceEntryMappingEnd(event *Event) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -1058,18 +1324,17 @@ func (parser *Parser) parseFlowSequenceEntryMappingEnd(event *Event) error { } // Parse the productions: -// flow_mapping ::= FLOW-MAPPING-START // -// ****************** -// (flow_mapping_entry FLOW-ENTRY)* -// * ********** -// flow_mapping_entry? -// ****************** -// FLOW-MAPPING-END -// **************** -// -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// - *** * +// flow_mapping ::= FLOW-MAPPING-START +// ****************** +// (flow_mapping_entry FLOW-ENTRY)* +// * ********** +// flow_mapping_entry? +// ****************** +// FLOW-MAPPING-END +// **************** +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * *** * func (parser *Parser) parseFlowMappingKey(event *Event, first bool) error { if first { var token *Token @@ -1135,8 +1400,9 @@ func (parser *Parser) parseFlowMappingKey(event *Event, first bool) error { } // Parse the productions: -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// - ***** * +// +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * ***** * func (parser *Parser) parseFlowMappingValue(event *Event, empty bool) error { var token *Token if err := parser.peekToken(&token); err != nil { @@ -1160,107 +1426,112 @@ func (parser *Parser) parseFlowMappingValue(event *Event, empty bool) error { return parser.processEmptyScalar(event, token.StartMark) } -// Generate an empty scalar event. -func (parser *Parser) processEmptyScalar(event *Event, mark Mark) error { - *event = Event{ - Type: SCALAR_EVENT, - StartMark: mark, - EndMark: mark, - Value: nil, // Empty - Implicit: true, - Style: Style(PLAIN_SCALAR_STYLE), +// Peek the next token in the token queue. +func (parser *Parser) peekToken(out **Token) error { + if !parser.token_available { + if err := parser.fetchMoreTokens(); err != nil { + return err + } } - return nil -} -var default_tag_directives = []TagDirective{ - {[]byte("!"), []byte("!")}, - {[]byte("!!"), []byte("tag:yaml.org,2002:")}, + token := &parser.tokens[parser.tokens_head] + parser.UnfoldComments(token) + *out = token + return nil } -// Parse directives. -func (parser *Parser) processDirectives(version_directive_ref **VersionDirective, tag_directives_ref *[]TagDirective) error { - var version_directive *VersionDirective - var tag_directives []TagDirective - - var token *Token - if err := parser.peekToken(&token); err != nil { - return err - } - - for token.Type == VERSION_DIRECTIVE_TOKEN || token.Type == TAG_DIRECTIVE_TOKEN { - switch token.Type { - case VERSION_DIRECTIVE_TOKEN: - if version_directive != nil { - return formatParserError( - "found duplicate %YAML directive", token.StartMark) - } - if token.major != 1 || token.minor != 1 { - return formatParserError( - "found incompatible YAML document", token.StartMark) - } - version_directive = &VersionDirective{ - major: token.major, - minor: token.minor, +// UnfoldComments walks through the comments queue and joins all +// comments behind the position of the provided token into the respective +// top-level comment slices in the parser. +func (parser *Parser) UnfoldComments(token *Token) { + for parser.comments_head < len(parser.comments) && token.StartMark.Index >= parser.comments[parser.comments_head].TokenMark.Index { + comment := &parser.comments[parser.comments_head] + if len(comment.Head) > 0 { + if token.Type == BLOCK_END_TOKEN { + // No heads on ends, so keep comment.Head for a follow up token. + break } - case TAG_DIRECTIVE_TOKEN: - value := TagDirective{ - handle: token.Value, - prefix: token.prefix, + if len(parser.HeadComment) > 0 { + parser.HeadComment = append(parser.HeadComment, '\n') } - if err := parser.appendTagDirective(value, false, token.StartMark); err != nil { - return err + parser.HeadComment = append(parser.HeadComment, comment.Head...) + } + if len(comment.Foot) > 0 { + if len(parser.FootComment) > 0 { + parser.FootComment = append(parser.FootComment, '\n') } - tag_directives = append(tag_directives, value) + parser.FootComment = append(parser.FootComment, comment.Foot...) } - - parser.skipToken() - if err := parser.peekToken(&token); err != nil { - return err + if len(comment.Line) > 0 { + if len(parser.LineComment) > 0 { + parser.LineComment = append(parser.LineComment, '\n') + } + parser.LineComment = append(parser.LineComment, comment.Line...) } + *comment = Comment{} + parser.comments_head++ } +} - for i := range default_tag_directives { - if err := parser.appendTagDirective(default_tag_directives[i], true, token.StartMark); err != nil { - return err - } - } +// Remove the next token from the queue (must be called after peek_token). +func (parser *Parser) skipToken() { + parser.token_available = false + parser.tokens_parsed++ + parser.stream_end_produced = parser.tokens[parser.tokens_head].Type == STREAM_END_TOKEN + parser.tokens_head++ +} - if version_directive_ref != nil { - *version_directive_ref = version_directive - } - if tag_directives_ref != nil { - *tag_directives_ref = tag_directives +// formatParserError creates a LoadError with the given problem message +// and mark position. +func formatParserError(problem string, problemMark Mark) *LoadError { + return &LoadError{ + Stage: ParserStage, + Mark: problemMark, + Message: problem, } - return nil } -// Append a tag directive to the directives stack. -func (parser *Parser) appendTagDirective(value TagDirective, allow_duplicates bool, mark Mark) error { - for i := range parser.tag_directives { - if bytes.Equal(value.handle, parser.tag_directives[i].handle) { - if allow_duplicates { - return nil - } - return formatParserError("found duplicate %TAG directive", mark) - } +// formatParserErrorContext creates a LoadError with both context and +// problem information, each with their own mark positions. +func formatParserErrorContext(context string, contextMark Mark, problem string, problemMark Mark) *LoadError { + return &LoadError{ + Stage: ParserStage, + ContextMark: contextMark, + ContextMsg: context, + Mark: problemMark, + Message: problem, } +} - // [Go] I suspect the copy is unnecessary. This was likely done - // because there was no way to track ownership of the data. - value_copy := TagDirective{ - handle: make([]byte, len(value.handle)), - prefix: make([]byte, len(value.prefix)), +// setEventComments transfers accumulated comments from the parser to the +// event and clears the parser's comment state. +func (parser *Parser) setEventComments(event *Event) { + event.HeadComment = parser.HeadComment + event.LineComment = parser.LineComment + event.FootComment = parser.FootComment + parser.HeadComment = nil + parser.LineComment = nil + parser.FootComment = nil + parser.tail_comment = nil + parser.stem_comment = nil +} + +// Generate an empty scalar event. +func (parser *Parser) processEmptyScalar(event *Event, mark Mark) error { + *event = Event{ + Type: SCALAR_EVENT, + StartMark: mark, + EndMark: mark, + Value: nil, // Empty + Implicit: true, + Style: Style(PLAIN_SCALAR_STYLE), } - copy(value_copy.handle, value.handle) - copy(value_copy.prefix, value.prefix) - parser.tag_directives = append(parser.tag_directives, value_copy) return nil } // ParserGetEvents parses the YAML input and returns the generated event stream. func ParserGetEvents(in []byte) (string, error) { - p := NewComposer(in) + p := NewComposer(in, nil) defer p.Destroy() var events strings.Builder var event Event @@ -1280,6 +1551,8 @@ func ParserGetEvents(in []byte) (string, error) { return events.String(), nil } +// formatEvent formats an event as a human-readable string for debugging +// and testing purposes. func formatEvent(e *Event) string { var b strings.Builder switch e.Type { diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/reader.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/reader.go index ecc00fe..b2c1a53 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/reader.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/reader.go @@ -15,89 +15,6 @@ import ( "io" ) -func formatReaderError(problem string, offset int, value int) error { - return ReaderError{ - Offset: offset, - Value: value, - Err: errors.New(problem), - } -} - -// Byte order marks. -const ( - bom_UTF8 = "\xef\xbb\xbf" - bom_UTF16LE = "\xff\xfe" - bom_UTF16BE = "\xfe\xff" -) - -// Determine the input stream encoding by checking the BOM symbol. If no BOM is -// found, the UTF-8 encoding is assumed. Return 1 on success, 0 on failure. -func (parser *Parser) determineEncoding() error { - // Ensure that we had enough bytes in the raw buffer. - for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 { - if err := parser.updateRawBuffer(); err != nil { - return err - } - } - - // Determine the encoding. - buf := parser.raw_buffer - pos := parser.raw_buffer_pos - avail := len(buf) - pos - if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] { - parser.encoding = UTF16LE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] { - parser.encoding = UTF16BE_ENCODING - parser.raw_buffer_pos += 2 - parser.offset += 2 - } else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] { - parser.encoding = UTF8_ENCODING - parser.raw_buffer_pos += 3 - parser.offset += 3 - } else { - parser.encoding = UTF8_ENCODING - } - return nil -} - -// Update the raw buffer. -func (parser *Parser) updateRawBuffer() error { - size_read := 0 - - // Return if the raw buffer is full. - if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) { - return nil - } - - // Return on EOF. - if parser.eof { - return nil - } - - // Move the remaining bytes in the raw buffer to the beginning. - if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) { - copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:]) - } - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos] - parser.raw_buffer_pos = 0 - - // Call the read handler to fill the buffer. - size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)]) - parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read] - if err == io.EOF { - parser.eof = true - } else if err != nil { - return ReaderError{ - Offset: parser.offset, - Value: -1, - Err: fmt.Errorf("input error: %w", err), - } - } - return nil -} - // Ensure that the buffer contains at least `length` characters. // Return true on success, false on failure. // @@ -107,9 +24,10 @@ func (parser *Parser) updateBuffer(length int) error { panic("read handler must be set") } - // [Go] This function was changed to guarantee the requested length size at EOF. - // The fact we need to do this is pretty awful, but the description above implies - // for that to be the case, and there are tests + // [Go] This function was changed to guarantee the requested length + // size at EOF. + // The fact we need to do this is pretty awful, but the description + // above implies for that to be the case, and there are tests // If the EOF flag is set and the raw buffer is empty, do nothing. // @@ -205,8 +123,8 @@ func (parser *Parser) updateBuffer(length int) error { default: // The leading octet is invalid. return formatReaderError( - "invalid leading UTF-8 octet", - parser.offset, int(octet)) + fmt.Sprintf("invalid leading UTF-8 octet (value: %d)", octet), + Mark{Index: parser.offset}) } // Check if the raw buffer contains an incomplete character. @@ -214,7 +132,7 @@ func (parser *Parser) updateBuffer(length int) error { if parser.eof { return formatReaderError( "incomplete UTF-8 octet sequence", - parser.offset, -1) + Mark{Index: parser.offset}) } break inner } @@ -240,8 +158,8 @@ func (parser *Parser) updateBuffer(length int) error { // Check if the octet is valid. if (octet & 0xC0) != 0x80 { return formatReaderError( - "invalid trailing UTF-8 octet", - parser.offset+k, int(octet)) + fmt.Sprintf("invalid trailing UTF-8 octet (value: %d)", octet), + Mark{Index: parser.offset + k}) } // Decode the octet. @@ -257,14 +175,14 @@ func (parser *Parser) updateBuffer(length int) error { default: return formatReaderError( "invalid length of a UTF-8 sequence", - parser.offset, -1) + Mark{Index: parser.offset}) } // Check the range of the value. if value >= 0xD800 && value <= 0xDFFF || value > 0x10FFFF { return formatReaderError( - "invalid Unicode character", - parser.offset, int(value)) + fmt.Sprintf("invalid Unicode character (value: %d)", value), + Mark{Index: parser.offset}) } case UTF16LE_ENCODING, UTF16BE_ENCODING: @@ -304,7 +222,7 @@ func (parser *Parser) updateBuffer(length int) error { if parser.eof { return formatReaderError( "incomplete UTF-16 character", - parser.offset, -1) + Mark{Index: parser.offset}) } break inner } @@ -316,8 +234,8 @@ func (parser *Parser) updateBuffer(length int) error { // Check for unexpected low surrogate area. if value&0xFC00 == 0xDC00 { return formatReaderError( - "unexpected low surrogate area", - parser.offset, int(value)) + fmt.Sprintf("unexpected low surrogate area (value: %d)", value), + Mark{Index: parser.offset}) } // Check for a high surrogate area. @@ -329,7 +247,7 @@ func (parser *Parser) updateBuffer(length int) error { if parser.eof { return formatReaderError( "incomplete UTF-16 surrogate pair", - parser.offset, -1) + Mark{Index: parser.offset}) } break inner } @@ -341,8 +259,8 @@ func (parser *Parser) updateBuffer(length int) error { // Check for a low surrogate area. if value2&0xFC00 != 0xDC00 { return formatReaderError( - "expected low surrogate area", - parser.offset+2, int(value2)) + fmt.Sprintf("expected low surrogate area (value: %d)", value2), + Mark{Index: parser.offset + 2}) } // Generate the value of the surrogate pair. @@ -383,8 +301,8 @@ func (parser *Parser) updateBuffer(length int) error { case value >= 0x10000 && value <= 0x10FFFF: default: return formatReaderError( - "control characters are not allowed", - parser.offset, int(value)) + fmt.Sprintf("control characters are not allowed (value: %d)", value), + Mark{Index: parser.offset}) } // Move the raw pointers. @@ -439,3 +357,90 @@ func (parser *Parser) updateBuffer(length int) error { parser.buffer = parser.buffer[:buffer_len] return nil } + +// Byte order marks for UTF-8, UTF-16LE, and UTF-16BE encodings. +const ( + bom_UTF8 = "\xef\xbb\xbf" + bom_UTF16LE = "\xff\xfe" + bom_UTF16BE = "\xfe\xff" +) + +// Determine the input stream encoding by checking the BOM symbol. +// If no BOM is found, the UTF-8 encoding is assumed. +// Return 1 on success, 0 on failure. +func (parser *Parser) determineEncoding() error { + // Ensure that we had enough bytes in the raw buffer. + for !parser.eof && len(parser.raw_buffer)-parser.raw_buffer_pos < 3 { + if err := parser.updateRawBuffer(); err != nil { + return err + } + } + + // Determine the encoding. + buf := parser.raw_buffer + pos := parser.raw_buffer_pos + avail := len(buf) - pos + if avail >= 2 && buf[pos] == bom_UTF16LE[0] && buf[pos+1] == bom_UTF16LE[1] { + parser.encoding = UTF16LE_ENCODING + parser.raw_buffer_pos += 2 + parser.offset += 2 + } else if avail >= 2 && buf[pos] == bom_UTF16BE[0] && buf[pos+1] == bom_UTF16BE[1] { + parser.encoding = UTF16BE_ENCODING + parser.raw_buffer_pos += 2 + parser.offset += 2 + } else if avail >= 3 && buf[pos] == bom_UTF8[0] && buf[pos+1] == bom_UTF8[1] && buf[pos+2] == bom_UTF8[2] { + parser.encoding = UTF8_ENCODING + parser.raw_buffer_pos += 3 + parser.offset += 3 + } else { + parser.encoding = UTF8_ENCODING + } + return nil +} + +// Update the raw buffer. +func (parser *Parser) updateRawBuffer() error { + size_read := 0 + + // Return if the raw buffer is full. + if parser.raw_buffer_pos == 0 && len(parser.raw_buffer) == cap(parser.raw_buffer) { + return nil + } + + // Return on EOF. + if parser.eof { + return nil + } + + // Move the remaining bytes in the raw buffer to the beginning. + if parser.raw_buffer_pos > 0 && parser.raw_buffer_pos < len(parser.raw_buffer) { + copy(parser.raw_buffer, parser.raw_buffer[parser.raw_buffer_pos:]) + } + parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)-parser.raw_buffer_pos] + parser.raw_buffer_pos = 0 + + // Call the read handler to fill the buffer. + size_read, err := parser.read_handler(parser, parser.raw_buffer[len(parser.raw_buffer):cap(parser.raw_buffer)]) + parser.raw_buffer = parser.raw_buffer[:len(parser.raw_buffer)+size_read] + if err == io.EOF { + parser.eof = true + } else if err != nil { + return &LoadError{ + Stage: ReaderStage, + Message: fmt.Sprintf("input error: %v", err), + Mark: Mark{Index: parser.offset}, + err: err, + } + } + return nil +} + +// formatReaderError creates a LoadError for reader-stage errors. +func formatReaderError(message string, mark Mark) *LoadError { + return &LoadError{ + Stage: ReaderStage, + Message: message, + Mark: mark, + err: errors.New(message), + } +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/representer.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/representer.go index 2f45194..c9f1b21 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/representer.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/representer.go @@ -3,14 +3,12 @@ // SPDX-License-Identifier: Apache-2.0 // Representer stage: Converts Go values to YAML nodes. -// Handles marshaling from Go types to the intermediate node representation. +// Handles representing from Go types to the intermediate node representation. package libyaml import ( "encoding" - "fmt" - "io" "reflect" "regexp" "sort" @@ -21,10 +19,399 @@ import ( "unicode/utf8" ) +// keyList is a sortable slice of reflect.Values used for sorting map keys +// in a natural order (numeric, then lexicographic). type keyList []reflect.Value -func (l keyList) Len() int { return len(l) } +// Representer converts Go values to YAML node trees with configurable +// formatting options. +type Representer struct { + flow bool + Indent int + lineWidth int + explicitStart bool + explicitEnd bool + flowSimpleCollections bool + quotePreference QuoteStyle +} + +// NewRepresenter creates a new YAML representer with the given options. +func NewRepresenter(opts *Options) *Representer { + return &Representer{ + Indent: opts.Indent, + lineWidth: opts.LineWidth, + explicitStart: opts.ExplicitStart, + explicitEnd: opts.ExplicitEnd, + flowSimpleCollections: opts.FlowSimpleCollections, + quotePreference: opts.QuotePreference, + } +} + +// Represent converts a Go value to a YAML node tree. +// This is the primary method for the Representer stage in the dump pipeline. +func (r *Representer) Represent(tag string, in reflect.Value) *Node { + var node *Node + if in.IsValid() { + node, _ = in.Interface().(*Node) + } + if node != nil && node.Kind == DocumentNode { + // Already a document node, return as-is + return node + } else { + // Wrap the represented value in a document node + contentNode := r.represent(tag, in) + return &Node{ + Kind: DocumentNode, + Content: []*Node{contentNode}, + } + } +} + +// From http://yaml.org/type/float.html, except the regular expression there +// is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix. +var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`) + +// represent is the core conversion method that handles the actual +// type-specific conversion from Go values to YAML nodes. +func (r *Representer) represent(tag string, in reflect.Value) *Node { + tag = shortTag(tag) + if !in.IsValid() || in.Kind() == reflect.Pointer && in.IsNil() { + return r.nilv() + } + iface := in.Interface() + switch value := iface.(type) { + case *Node: + return r.nodev(in) + case Node: + if !in.CanAddr() { + n := reflect.New(in.Type()).Elem() + n.Set(in) + in = n + } + return r.nodev(in.Addr()) + case time.Time: + return r.timev(tag, in) + case *time.Time: + return r.timev(tag, in.Elem()) + case time.Duration: + return r.stringv(tag, reflect.ValueOf(value.String())) + case Marshaler: + v, err := value.MarshalYAML() + if err != nil { + failDump(RepresenterStage, err) + } + if v == nil { + return r.nilv() + } + return r.represent(tag, reflect.ValueOf(v)) + case encoding.TextMarshaler: + text, err := value.MarshalText() + if err != nil { + failDump(RepresenterStage, err) + } + in = reflect.ValueOf(string(text)) + case nil: + return r.nilv() + } + switch in.Kind() { + case reflect.Interface: + return r.represent(tag, in.Elem()) + case reflect.Map: + return r.mapv(tag, in) + case reflect.Pointer: + return r.represent(tag, in.Elem()) + case reflect.Struct: + return r.structv(tag, in) + case reflect.Slice, reflect.Array: + return r.slicev(tag, in) + case reflect.String: + return r.stringv(tag, in) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return r.intv(tag, in) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return r.uintv(tag, in) + case reflect.Float32, reflect.Float64: + return r.floatv(tag, in) + case reflect.Bool: + return r.boolv(tag, in) + default: + failDumpf(RepresenterStage, "cannot represent type: %s", in.Type().String()) + return nil // unreachable; failDumpf always panics + } +} + +// mapv converts a Go map to a YAML mapping node with sorted keys. +func (r *Representer) mapv(tag string, in reflect.Value) *Node { + if tag == "" { + tag = mapTag + } + var style Style + if r.flow { + r.flow = false + style = FlowStyle + } + + keys := keyList(in.MapKeys()) + sort.Sort(keys) + content := make([]*Node, 0, len(keys)*2) + for _, k := range keys { + content = append(content, r.represent("", k)) + content = append(content, r.represent("", in.MapIndex(k))) + } + + return &Node{ + Kind: MappingNode, + Tag: tag, + Content: content, + Style: style, + } +} + +// structv converts a Go struct to a YAML mapping node, handling field tags, +// omitempty, inline fields, and inline maps. +func (r *Representer) structv(tag string, in reflect.Value) *Node { + sinfo, err := getStructInfo(in.Type()) + if err != nil { + failDump(RepresenterStage, err) + } + + if tag == "" { + tag = mapTag + } + var style Style + if r.flow { + r.flow = false + style = FlowStyle + } + + content := make([]*Node, 0) + for _, info := range sinfo.FieldsList { + var value reflect.Value + if info.Inline == nil { + value = in.Field(info.Num) + } else { + value = r.fieldByIndex(in, info.Inline) + if !value.IsValid() { + continue + } + } + if info.OmitEmpty && isZero(value) { + continue + } + content = append(content, r.represent("", reflect.ValueOf(info.Key))) + r.flow = info.Flow + content = append(content, r.represent("", value)) + } + if sinfo.InlineMap >= 0 { + m := in.Field(sinfo.InlineMap) + if m.Len() > 0 { + r.flow = false + keys := keyList(m.MapKeys()) + sort.Sort(keys) + for _, k := range keys { + if _, found := sinfo.FieldsMap[k.String()]; found { + failDumpf(RepresenterStage, "cannot have key %q in inlined map: conflicts with struct field", k.String()) + } + content = append(content, r.represent("", k)) + r.flow = false + content = append(content, r.represent("", m.MapIndex(k))) + } + } + } + + return &Node{ + Kind: MappingNode, + Tag: tag, + Content: content, + Style: style, + } +} + +// slicev converts a Go slice or array to a YAML sequence node. +func (r *Representer) slicev(tag string, in reflect.Value) *Node { + if tag == "" { + tag = seqTag + } + var style Style + if r.flow { + r.flow = false + style = FlowStyle + } + + n := in.Len() + content := make([]*Node, n) + for i := 0; i < n; i++ { + content[i] = r.represent("", in.Index(i)) + } + + return &Node{ + Kind: SequenceNode, + Tag: tag, + Content: content, + Style: style, + } +} + +// stringv converts a Go string to a YAML scalar node, handling quoting, +// binary data (base64 encoding), and special string values. +func (r *Representer) stringv(tag string, in reflect.Value) *Node { + var style Style + s := in.String() + needsQuoting := false + + switch { + case !utf8.ValidString(s): + if tag == binaryTag { + failDumpf(RepresenterStage, "explicitly tagged !!binary data must be base64-encoded") + } + if tag != "" { + failDumpf(RepresenterStage, "cannot represent invalid UTF-8 data as %s", shortTag(tag)) + } + // It can't be represented directly as YAML so use a binary tag + // and represent it as base64. + tag = binaryTag + s = encodeBase64(s) + case tag == "": + tag = strTag + // Check if this string needs quoting for compatibility + // even though it would resolve as !!str + needsQuoting = isBase60Float(s) || isOldBool(s) || looksLikeMerge(s) + } + + // Set the style based on content + switch { + case strings.Contains(s, "\n"): + if r.flow || !shouldUseLiteralStyle(s) { + style = DoubleQuotedStyle + } else { + style = LiteralStyle + } + case needsQuoting: + // Force quoting for YAML 1.1 compatibility values + style = SingleQuotedStyle + default: + // Plain style by default - Desolver will add quotes if type mismatch + style = 0 + } + + return &Node{ + Kind: ScalarNode, + Tag: tag, + Value: s, + Style: style, + } +} + +// boolv converts a Go bool to a YAML scalar node. +func (r *Representer) boolv(tag string, in reflect.Value) *Node { + var s string + if in.Bool() { + s = "true" + } else { + s = "false" + } + if tag == "" { + tag = boolTag + } + return &Node{ + Kind: ScalarNode, + Tag: tag, + Value: s, + } +} + +// intv converts a Go signed integer to a YAML scalar node. +func (r *Representer) intv(tag string, in reflect.Value) *Node { + s := strconv.FormatInt(in.Int(), 10) + if tag == "" { + tag = intTag + } + return &Node{ + Kind: ScalarNode, + Tag: tag, + Value: s, + } +} + +// uintv converts a Go unsigned integer to a YAML scalar node. +func (r *Representer) uintv(tag string, in reflect.Value) *Node { + s := strconv.FormatUint(in.Uint(), 10) + if tag == "" { + tag = intTag + } + return &Node{ + Kind: ScalarNode, + Tag: tag, + Value: s, + } +} + +// timev converts a Go [time.Time] to a YAML scalar node in RFC3339Nano format. +func (r *Representer) timev(tag string, in reflect.Value) *Node { + t := in.Interface().(time.Time) + s := t.Format(time.RFC3339Nano) + if tag == "" { + tag = timestampTag + } + return &Node{ + Kind: ScalarNode, + Tag: tag, + Value: s, + } +} + +// floatv converts a Go float to a YAML scalar node, handling special values +// like infinity and NaN. +func (r *Representer) floatv(tag string, in reflect.Value) *Node { + // Issue #352: When formatting, use the precision of the underlying value + precision := 64 + if in.Kind() == reflect.Float32 { + precision = 32 + } + + s := strconv.FormatFloat(in.Float(), 'g', -1, precision) + switch s { + case "+Inf": + s = ".inf" + case "-Inf": + s = "-.inf" + case "NaN": + s = ".nan" + } + if tag == "" { + tag = floatTag + } + return &Node{ + Kind: ScalarNode, + Tag: tag, + Value: s, + } +} + +// nilv creates a YAML null node. +func (r *Representer) nilv() *Node { + return &Node{ + Kind: ScalarNode, + Tag: nullTag, + Value: "null", + } +} + +// nodev returns a node value as-is without conversion. +func (r *Representer) nodev(in reflect.Value) *Node { + // Return the node as-is - no conversion needed + return in.Interface().(*Node) +} + +// Len returns the number of keys in the list. +func (l keyList) Len() int { return len(l) } + +// Swap exchanges the positions of two keys in the list. func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } + +// Less implements a natural sort order for map keys: numeric values sort +// numerically, strings sort with natural number ordering, and mixed types +// sort by kind. func (l keyList) Less(i, j int) bool { a := l[i] b := l[j] @@ -134,198 +521,8 @@ func numLess(a, b reflect.Value) bool { panic("not a number") } -// Sentinel values for newRepresenter parameters. -// These provide clarity at call sites, similar to http.NoBody. -var ( - noWriter io.Writer = nil - noVersionDirective *VersionDirective = nil - noTagDirective []TagDirective = nil -) - -type Representer struct { - Emitter Emitter - Out []byte - flow bool - Indent int - lineWidth int - doneInit bool - explicitStart bool - explicitEnd bool - flowSimpleCollections bool - quotePreference QuoteStyle -} - -// NewRepresenter creates a new YAML representr with the given options. -// -// The writer parameter specifies the output destination for the representr. -// If writer is nil, the representr will write to an internal buffer. -func NewRepresenter(writer io.Writer, opts *Options) *Representer { - emitter := NewEmitter() - emitter.CompactSequenceIndent = opts.CompactSeqIndent - emitter.quotePreference = opts.QuotePreference - emitter.SetWidth(opts.LineWidth) - emitter.SetUnicode(opts.Unicode) - emitter.SetCanonical(opts.Canonical) - emitter.SetLineBreak(opts.LineBreak) - - r := &Representer{ - Emitter: emitter, - Indent: opts.Indent, - lineWidth: opts.LineWidth, - explicitStart: opts.ExplicitStart, - explicitEnd: opts.ExplicitEnd, - flowSimpleCollections: opts.FlowSimpleCollections, - quotePreference: opts.QuotePreference, - } - - if writer != nil { - r.Emitter.SetOutputWriter(writer) - } else { - r.Emitter.SetOutputString(&r.Out) - } - - return r -} - -func (r *Representer) init() { - if r.doneInit { - return - } - if r.Indent == 0 { - r.Indent = 4 - } - r.Emitter.BestIndent = r.Indent - r.emit(NewStreamStartEvent(UTF8_ENCODING)) - r.doneInit = true -} - -func (r *Representer) Finish() { - r.Emitter.OpenEnded = false - r.emit(NewStreamEndEvent()) -} - -func (r *Representer) Destroy() { - r.Emitter.Delete() -} - -func (r *Representer) emit(event Event) { - // This will internally delete the event value. - r.must(r.Emitter.Emit(&event)) -} - -func (r *Representer) must(err error) { - if err != nil { - msg := err.Error() - if msg == "" { - msg = "unknown problem generating YAML content" - } - failf("%s", msg) - } -} - -func (r *Representer) MarshalDoc(tag string, in reflect.Value) { - r.init() - var node *Node - if in.IsValid() { - node, _ = in.Interface().(*Node) - } - if node != nil && node.Kind == DocumentNode { - r.nodev(in) - } else { - // Use !explicitStart for implicit flag (true = implicit/no marker) - r.emit(NewDocumentStartEvent(noVersionDirective, noTagDirective, !r.explicitStart)) - r.marshal(tag, in) - // Use !explicitEnd for implicit flag - r.emit(NewDocumentEndEvent(!r.explicitEnd)) - } -} - -func (r *Representer) marshal(tag string, in reflect.Value) { - tag = shortTag(tag) - if !in.IsValid() || in.Kind() == reflect.Pointer && in.IsNil() { - r.nilv() - return - } - iface := in.Interface() - switch value := iface.(type) { - case *Node: - r.nodev(in) - return - case Node: - if !in.CanAddr() { - n := reflect.New(in.Type()).Elem() - n.Set(in) - in = n - } - r.nodev(in.Addr()) - return - case time.Time: - r.timev(tag, in) - return - case *time.Time: - r.timev(tag, in.Elem()) - return - case time.Duration: - r.stringv(tag, reflect.ValueOf(value.String())) - return - case Marshaler: - v, err := value.MarshalYAML() - if err != nil { - Fail(err) - } - if v == nil { - r.nilv() - return - } - r.marshal(tag, reflect.ValueOf(v)) - return - case encoding.TextMarshaler: - text, err := value.MarshalText() - if err != nil { - Fail(err) - } - in = reflect.ValueOf(string(text)) - case nil: - r.nilv() - return - } - switch in.Kind() { - case reflect.Interface: - r.marshal(tag, in.Elem()) - case reflect.Map: - r.mapv(tag, in) - case reflect.Pointer: - r.marshal(tag, in.Elem()) - case reflect.Struct: - r.structv(tag, in) - case reflect.Slice, reflect.Array: - r.slicev(tag, in) - case reflect.String: - r.stringv(tag, in) - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - r.intv(tag, in) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - r.uintv(tag, in) - case reflect.Float32, reflect.Float64: - r.floatv(tag, in) - case reflect.Bool: - r.boolv(tag, in) - default: - panic("cannot marshal type: " + in.Type().String()) - } -} - -func (r *Representer) mapv(tag string, in reflect.Value) { - r.mappingv(tag, func() { - keys := keyList(in.MapKeys()) - sort.Sort(keys) - for _, k := range keys { - r.marshal("", k) - r.marshal("", in.MapIndex(k)) - } - }) -} - +// fieldByIndex navigates through struct fields using the given index path, +// dereferencing pointers as needed. func (r *Representer) fieldByIndex(v reflect.Value, index []int) (field reflect.Value) { for _, num := range index { for { @@ -343,79 +540,10 @@ func (r *Representer) fieldByIndex(v reflect.Value, index []int) (field reflect. return v } -func (r *Representer) structv(tag string, in reflect.Value) { - sinfo, err := getStructInfo(in.Type()) - if err != nil { - panic(err) - } - r.mappingv(tag, func() { - for _, info := range sinfo.FieldsList { - var value reflect.Value - if info.Inline == nil { - value = in.Field(info.Num) - } else { - value = r.fieldByIndex(in, info.Inline) - if !value.IsValid() { - continue - } - } - if info.OmitEmpty && isZero(value) { - continue - } - r.marshal("", reflect.ValueOf(info.Key)) - r.flow = info.Flow - r.marshal("", value) - } - if sinfo.InlineMap >= 0 { - m := in.Field(sinfo.InlineMap) - if m.Len() > 0 { - r.flow = false - keys := keyList(m.MapKeys()) - sort.Sort(keys) - for _, k := range keys { - if _, found := sinfo.FieldsMap[k.String()]; found { - panic(fmt.Sprintf("cannot have key %q in inlined map: conflicts with struct field", k.String())) - } - r.marshal("", k) - r.flow = false - r.marshal("", m.MapIndex(k)) - } - } - } - }) -} - -func (r *Representer) mappingv(tag string, f func()) { - implicit := tag == "" - style := BLOCK_MAPPING_STYLE - if r.flow { - r.flow = false - style = FLOW_MAPPING_STYLE - } - r.emit(NewMappingStartEvent(nil, []byte(tag), implicit, style)) - f() - r.emit(NewMappingEndEvent()) -} - -func (r *Representer) slicev(tag string, in reflect.Value) { - implicit := tag == "" - style := BLOCK_SEQUENCE_STYLE - if r.flow { - r.flow = false - style = FLOW_SEQUENCE_STYLE - } - r.emit(NewSequenceStartEvent(nil, []byte(tag), implicit, style)) - n := in.Len() - for i := 0; i < n; i++ { - r.marshal("", in.Index(i)) - } - r.emit(NewSequenceEndEvent()) -} - // isBase60 returns whether s is in base 60 notation as defined in YAML 1.1. // // The base 60 float notation in YAML 1.1 is a terrible idea and is unsupported -// in YAML 1.2 and by this package, but these should be marshaled quoted for +// in YAML 1.2 and by this package, but these should be represented quoted for // the time being for compatibility with other parsers. func isBase60Float(s string) (result bool) { // Fast path. @@ -430,14 +558,10 @@ func isBase60Float(s string) (result bool) { return base60float.MatchString(s) } -// From http://yaml.org/type/float.html, except the regular expression there -// is bogus. In practice parsers do not enforce the "\.[0-9_]*" suffix. -var base60float = regexp.MustCompile(`^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+(?:\.[0-9_]*)?$`) - // isOldBool returns whether s is bool notation as defined in YAML 1.1. // // We continue to force strings that YAML 1.1 would interpret as booleans to be -// rendered as quotes strings so that the marshaled output valid for YAML 1.1 +// rendered as quotes strings so that the represented output valid for YAML 1.1 // parsing. func isOldBool(s string) (result bool) { switch s { @@ -456,116 +580,3 @@ func isOldBool(s string) (result bool) { func looksLikeMerge(s string) (result bool) { return s == "<<" } - -func (r *Representer) stringv(tag string, in reflect.Value) { - var style ScalarStyle - s := in.String() - canUsePlain := true - switch { - case !utf8.ValidString(s): - if tag == binaryTag { - failf("explicitly tagged !!binary data must be base64-encoded") - } - if tag != "" { - failf("cannot marshal invalid UTF-8 data as %s", shortTag(tag)) - } - // It can't be represented directly as YAML so use a binary tag - // and represent it as base64. - tag = binaryTag - s = encodeBase64(s) - case tag == "": - // Check to see if it would resolve to a specific - // tag when represented unquoted. If it doesn't, - // there's no need to quote it. - rtag, _ := resolve("", s) - canUsePlain = rtag == strTag && - !(isBase60Float(s) || - isOldBool(s) || - looksLikeMerge(s)) - } - // Note: it's possible for user code to emit invalid YAML - // if they explicitly specify a tag and a string containing - // text that's incompatible with that tag. - switch { - case strings.Contains(s, "\n"): - if r.flow || !shouldUseLiteralStyle(s) { - style = DOUBLE_QUOTED_SCALAR_STYLE - } else { - style = LITERAL_SCALAR_STYLE - } - case canUsePlain: - style = PLAIN_SCALAR_STYLE - default: - style = r.quotePreference.ScalarStyle() - } - r.emitScalar(s, "", tag, style, nil, nil, nil, nil) -} - -func (r *Representer) boolv(tag string, in reflect.Value) { - var s string - if in.Bool() { - s = "true" - } else { - s = "false" - } - r.emitScalar(s, "", tag, PLAIN_SCALAR_STYLE, nil, nil, nil, nil) -} - -func (r *Representer) intv(tag string, in reflect.Value) { - s := strconv.FormatInt(in.Int(), 10) - r.emitScalar(s, "", tag, PLAIN_SCALAR_STYLE, nil, nil, nil, nil) -} - -func (r *Representer) uintv(tag string, in reflect.Value) { - s := strconv.FormatUint(in.Uint(), 10) - r.emitScalar(s, "", tag, PLAIN_SCALAR_STYLE, nil, nil, nil, nil) -} - -func (r *Representer) timev(tag string, in reflect.Value) { - t := in.Interface().(time.Time) - s := t.Format(time.RFC3339Nano) - r.emitScalar(s, "", tag, PLAIN_SCALAR_STYLE, nil, nil, nil, nil) -} - -func (r *Representer) floatv(tag string, in reflect.Value) { - // Issue #352: When formatting, use the precision of the underlying value - precision := 64 - if in.Kind() == reflect.Float32 { - precision = 32 - } - - s := strconv.FormatFloat(in.Float(), 'g', -1, precision) - switch s { - case "+Inf": - s = ".inf" - case "-Inf": - s = "-.inf" - case "NaN": - s = ".nan" - } - r.emitScalar(s, "", tag, PLAIN_SCALAR_STYLE, nil, nil, nil, nil) -} - -func (r *Representer) nilv() { - r.emitScalar("null", "", "", PLAIN_SCALAR_STYLE, nil, nil, nil, nil) -} - -func (r *Representer) emitScalar( - value, anchor, tag string, style ScalarStyle, head, line, foot, tail []byte, -) { - // TODO Kill this function. Replace all initialize calls by their underlining Go literals. - implicit := tag == "" - if !implicit { - tag = longTag(tag) - } - event := NewScalarEvent([]byte(anchor), []byte(tag), []byte(value), implicit, implicit, style) - event.HeadComment = head - event.LineComment = line - event.FootComment = foot - event.TailComment = tail - r.emit(event) -} - -func (r *Representer) nodev(in reflect.Value) { - r.node(in.Interface().(*Node), "") -} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/resolver.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/resolver.go index d78a20e..5256b77 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/resolver.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/resolver.go @@ -10,6 +10,7 @@ package libyaml import ( "encoding/base64" + "fmt" "math" "regexp" "strconv" @@ -17,67 +18,77 @@ import ( "time" ) +// resolveMapItem holds a resolved value and its YAML tag for exact string +// matches in the resolution table. type resolveMapItem struct { value any tag string } -var ( - resolveTable = make([]byte, 256) - resolveMap = make(map[string]resolveMapItem) -) +// Resolver handles tag resolution for YAML nodes. +type Resolver struct { + opts *Options +} -// negativeZero represents -0.0 for YAML encoding/decoding -// this is needed because Go constants cannot express -0.0 -// https://staticcheck.dev/docs/checks/#SA4026 -var negativeZero = math.Copysign(0.0, -1.0) +// NewResolver creates a new Resolver with the given options. +func NewResolver(opts *Options) *Resolver { + return &Resolver{opts: opts} +} -func init() { - t := resolveTable - t[int('+')] = 'S' // Sign - t[int('-')] = 'S' - for _, c := range "0123456789" { - t[int(c)] = 'D' // Digit +// Resolve walks the node tree and resolves tags for untagged nodes. +// This is called after composition to: +// - Default quoted scalars to !!str +// - Default sequences to !!seq +// - Default mappings to !!map +// - Resolve plain scalars to implicit types (int, float, bool, null, timestamp) +func (r *Resolver) Resolve(n *Node) { + if n == nil { + return } - for _, c := range "yYnNtTfFoO~<" { // < for merge key << - t[int(c)] = 'M' // In map - } - t[int('.')] = '.' // Float (potentially in map) - resolveMapList := []struct { - v any - tag string - l []string - }{ - {true, boolTag, []string{"true", "True", "TRUE"}}, - {false, boolTag, []string{"false", "False", "FALSE"}}, - {nil, nullTag, []string{"", "~", "null", "Null", "NULL"}}, - {math.NaN(), floatTag, []string{".nan", ".NaN", ".NAN"}}, - {math.Inf(+1), floatTag, []string{".inf", ".Inf", ".INF"}}, - {math.Inf(+1), floatTag, []string{"+.inf", "+.Inf", "+.INF"}}, - {math.Inf(-1), floatTag, []string{"-.inf", "-.Inf", "-.INF"}}, - {negativeZero, floatTag, []string{"-0", "-0.0"}}, - {"<<", mergeTag, []string{"<<"}}, - } + switch n.Kind { + case ScalarNode: + if n.Tag == "" { + if n.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0 { + // Quoted scalars default to !!str without value resolution + n.Tag = strTag + } else { + // Plain scalars: resolve type from value + n.Tag, _ = resolve("", n.Value) + } + } - m := resolveMap - for _, item := range resolveMapList { - for _, s := range item.l { - m[s] = resolveMapItem{item.v, item.tag} + case SequenceNode: + if n.Tag == "" { + n.Tag = seqTag + } + for _, child := range n.Content { + r.Resolve(child) } - } -} -func resolvableTag(tag string) bool { - switch tag { - case "", strTag, boolTag, intTag, floatTag, nullTag, timestampTag: - return true + case MappingNode: + if n.Tag == "" { + n.Tag = mapTag + } + for _, child := range n.Content { + r.Resolve(child) + } + + case DocumentNode: + for _, child := range n.Content { + r.Resolve(child) + } + + case AliasNode: + // Alias nodes point to already-resolved nodes } - return false } -var yamlStyleFloat = regexp.MustCompile(`^[-+]?(\.[0-9]+|[0-9]+(\.[0-9]*)?)([eE][-+]?[0-9]+)?$`) - +// resolve determines the YAML tag and Go value for a scalar string. +// It takes a tag hint and the scalar string value, and returns the resolved +// tag and the corresponding Go value (int, float, bool, [time.Time], etc.). +// If the tag is already specified and non-resolvable, it returns the input +// unchanged. func resolve(tag string, in string) (rtag string, out any) { tag = shortTag(tag) if !resolvableTag(tag) { @@ -102,7 +113,10 @@ func resolve(tag string, in string) (rtag string, out any) { } } } - failf("cannot construct %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)) + Fail(formatResolverError( + fmt.Sprintf("cannot construct %s `%s` as a %s", shortTag(rtag), in, shortTag(tag)), + Mark{}, + )) }() // Any data is accepted as a !!str or !!binary. @@ -134,8 +148,8 @@ func resolve(tag string, in string) (rtag string, out any) { case 'D', 'S': // Int, float, or timestamp. - // Only try values as a timestamp if the value is unquoted or there's an explicit - // !!timestamp tag. + // Only try values as a timestamp if the value is + // unquoted or there's an explicit !!timestamp tag. if tag == "" || tag == timestampTag { t, ok := parseTimestamp(in) if ok { @@ -169,6 +183,83 @@ func resolve(tag string, in string) (rtag string, out any) { return strTag, in } +// resolveTable provides a fast lookup table for initial character-based +// classification during tag resolution. +// resolveMap maps specific scalar strings to their resolved values and tags. +var ( + resolveTable = make([]byte, 256) + resolveMap = make(map[string]resolveMapItem) +) + +// negativeZero represents -0.0 for YAML encoding/decoding +// this is needed because Go constants cannot express -0.0 +// https://staticcheck.dev/docs/checks/#SA4026 +var negativeZero = math.Copysign(0.0, -1.0) + +// yamlStyleFloat matches floating-point numbers in YAML style (including +// scientific notation and numbers starting with a dot). +var yamlStyleFloat = regexp.MustCompile(`^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)(?:[eE][-+]?[0-9]+)?$`) + +// allowedTimestampFormats lists the timestamp formats supported by the +// resolver. +// This is a subset of the formats allowed by the regular expression +// defined at http://yaml.org/type/timestamp.html. +var allowedTimestampFormats = []string{ + "2006-1-2T15:4:5.999999999Z07:00", // RCF3339Nano with short date fields. + "2006-1-2t15:4:5.999999999Z07:00", // RFC3339Nano with short date fields and lower-case "t". + "2006-1-2 15:4:5.999999999", // space separated with no time zone + "2006-1-2", // date only + // Notable exception: time.Parse cannot handle: "2001-12-14 21:59:43.10 -5" + // from the set of examples. +} + +// init initializes the resolveTable with character class mappings for tag resolution. +func init() { + t := resolveTable + t[int('+')] = 'S' // Sign + t[int('-')] = 'S' + for _, c := range "0123456789" { + t[int(c)] = 'D' // Digit + } + for _, c := range "yYnNtTfFoO~<" { // < for merge key << + t[int(c)] = 'M' // In map + } + t[int('.')] = '.' // Float (potentially in map) + + resolveMapList := []struct { + v any + tag string + l []string + }{ + {true, boolTag, []string{"true", "True", "TRUE"}}, + {false, boolTag, []string{"false", "False", "FALSE"}}, + {nil, nullTag, []string{"", "~", "null", "Null", "NULL"}}, + {math.NaN(), floatTag, []string{".nan", ".NaN", ".NAN"}}, + {math.Inf(+1), floatTag, []string{".inf", ".Inf", ".INF"}}, + {math.Inf(+1), floatTag, []string{"+.inf", "+.Inf", "+.INF"}}, + {math.Inf(-1), floatTag, []string{"-.inf", "-.Inf", "-.INF"}}, + {negativeZero, floatTag, []string{"-0", "-0.0"}}, + {"<<", mergeTag, []string{"<<"}}, + } + + m := resolveMap + for _, item := range resolveMapList { + for _, s := range item.l { + m[s] = resolveMapItem{item.v, item.tag} + } + } +} + +// resolvableTag checks if a tag can be automatically resolved from a scalar +// value. +func resolvableTag(tag string) bool { + switch tag { + case "", strTag, boolTag, intTag, floatTag, nullTag, timestampTag: + return true + } + return false +} + // encodeBase64 encodes s as base64 that is broken up into multiple lines // as appropriate for the resulting length. func encodeBase64(s string) string { @@ -194,17 +285,6 @@ func encodeBase64(s string) string { return string(out[:k]) } -// This is a subset of the formats allowed by the regular expression -// defined at http://yaml.org/type/timestamp.html. -var allowedTimestampFormats = []string{ - "2006-1-2T15:4:5.999999999Z07:00", // RCF3339Nano with short date fields. - "2006-1-2t15:4:5.999999999Z07:00", // RFC3339Nano with short date fields and lower-case "t". - "2006-1-2 15:4:5.999999999", // space separated with no time zone - "2006-1-2", // date only - // Notable exception: time.Parse cannot handle: "2001-12-14 21:59:43.10 -5" - // from the set of examples. -} - // parseTimestamp parses s as a timestamp string and // returns the timestamp and reports whether it succeeded. // Timestamp formats are defined at http://yaml.org/type/timestamp.html @@ -229,3 +309,24 @@ func parseTimestamp(s string) (time.Time, bool) { } return time.Time{}, false } + +// formatResolverError creates a LoadError for resolver-stage errors. +func formatResolverError(message string, mark Mark) *LoadError { + return &LoadError{ + Stage: ResolverStage, + Mark: mark, + Message: message, + } +} + +// formatResolverErrorContext creates a LoadError with both context and +// problem information for resolver-stage errors. +func formatResolverErrorContext(context string, contextMark Mark, message string, mark Mark) *LoadError { + return &LoadError{ + Stage: ResolverStage, + ContextMark: contextMark, + ContextMsg: context, + Mark: mark, + Message: message, + } +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/scanner.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/scanner.go index 36f62b0..1cbcc32 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/scanner.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/scanner.go @@ -490,96 +490,267 @@ import ( // BLOCK-END // -// Advance the buffer pointer. -func (parser *Parser) skip() { - if !isBlank(parser.buffer, parser.buffer_pos) { - parser.newlines = 0 - } - parser.mark.Index++ - parser.mark.Column++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) +// Buffer sizes and internal constants +const ( + // The size of the input raw buffer. + input_raw_buffer_size = 512 + + // The size of the input buffer. + // It should be possible to decode the whole raw buffer. + input_buffer_size = input_raw_buffer_size * 3 + + // The size of the output buffer. + output_buffer_size = 128 + + // The size of other stacks and queues. + initial_stack_size = 16 + initial_queue_size = 16 + initial_string_size = 16 +) + +// Character classification functions + +// Check if the character at the specified position is an alphabetical +// character, a digit, '_', or '-'. +func isAlpha(b []byte, i int) bool { + return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || + b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-' } -func (parser *Parser) skipLine() { - if isCRLF(parser.buffer, parser.buffer_pos) { - parser.mark.Index += 2 - parser.mark.Column = 0 - parser.mark.Line++ - parser.unread -= 2 - parser.buffer_pos += 2 - parser.newlines++ - } else if isLineBreak(parser.buffer, parser.buffer_pos) { - parser.mark.Index++ - parser.mark.Column = 0 - parser.mark.Line++ - parser.unread-- - parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) - parser.newlines++ +// Check if the character at the specified position is a flow indicator as +// defined by spec production [23] c-flow-indicator ::= +// c-collect-entry | c-sequence-start | c-sequence-end | +// c-mapping-start | c-mapping-end +func isFlowIndicator(b []byte, i int) bool { + return b[i] == '[' || b[i] == ']' || + b[i] == '{' || b[i] == '}' || b[i] == ',' +} + +// Check if the character at the specified position is valid for anchor names +// as defined by spec production [102] ns-anchor-char ::= ns-char - +// c-flow-indicator. +// This includes all printable characters except: CR, LF, BOM, space, tab, '[', +// ']', '{', '}', ','. +// We further limit it to ascii chars only, which is a subset of the spec +// production but is usually what most people expect. +func isAnchorChar(b []byte, i int) bool { + if isColon(b, i) { + // [Go] we exclude colons from anchor/alias names. + // + // A colon is a valid anchor character according to the YAML 1.2 specification, + // but it can lead to ambiguity. + // https://github.com/yaml/go-yaml/issues/109 + // + // Also, it would have been a breaking change to support it, as go.yaml.in/yaml/v3 ignores it. + // Supporting it could lead to unexpected behavior. + return false } + + return isPrintable(b, i) && + !isLineBreak(b, i) && + !isBlank(b, i) && + !isBOM(b, i) && + !isFlowIndicator(b, i) && + isASCII(b, i) } -// Copy a character to a string buffer and advance pointers. -func (parser *Parser) read(s []byte) []byte { - if !isBlank(parser.buffer, parser.buffer_pos) { - parser.newlines = 0 +// isColon checks whether the character at the specified position is a colon. +func isColon(b []byte, i int) bool { + return b[i] == ':' +} + +// Check if the character at the specified position is valid in a tag URI. +// +// The set of valid characters is: +// +// '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', +// '=', '+', '$', '.', '!', '~', '*', '\'', '(', ')', '%'. +// +// If verbatim is true, flow indicators (',', '[', ']', '{', '}') are also +// allowed. +func isTagURIChar(b []byte, i int, verbatim bool) bool { + c := b[i] + // isAlpha covers: 0-9, A-Z, a-z, _, - + if isAlpha(b, i) { + return true } - w := width(parser.buffer[parser.buffer_pos]) - if w == 0 { - panic("invalid character sequence") + // Check special URI characters + switch c { + case ';', '/', '?', ':', '@', '&', '=', '+', '$', '.', '!', '~', '*', '\'', '(', ')', '%': + return true + case ',', '[', ']', '{', '}': + return verbatim } - if len(s) == 0 { - s = make([]byte, 0, 32) + return false +} + +// Check if the character at the specified position is a digit. +func isDigit(b []byte, i int) bool { + return b[i] >= '0' && b[i] <= '9' +} + +// Get the value of a digit. +func asDigit(b []byte, i int) int { + return int(b[i]) - '0' +} + +// Check if the character at the specified position is a hex-digit. +func isHex(b []byte, i int) bool { + return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || + b[i] >= 'a' && b[i] <= 'f' +} + +// Get the value of a hex-digit. +func asHex(b []byte, i int) int { + bi := b[i] + if bi >= 'A' && bi <= 'F' { + return int(bi) - 'A' + 10 } - if w == 1 && len(s)+w <= cap(s) { - s = s[:len(s)+1] - s[len(s)-1] = parser.buffer[parser.buffer_pos] - parser.buffer_pos++ - } else { - s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...) - parser.buffer_pos += w + if bi >= 'a' && bi <= 'f' { + return int(bi) - 'a' + 10 } - parser.mark.Index++ - parser.mark.Column++ - parser.unread-- - return s + return int(bi) - '0' } -// Copy a line break character to a string buffer and advance pointers. -func (parser *Parser) readLine(s []byte) []byte { - buf := parser.buffer - pos := parser.buffer_pos - switch { - case buf[pos] == '\r' && buf[pos+1] == '\n': - // CR LF . LF - s = append(s, '\n') - parser.buffer_pos += 2 - parser.mark.Index++ - parser.unread-- - case buf[pos] == '\r' || buf[pos] == '\n': - // CR|LF . LF - s = append(s, '\n') - parser.buffer_pos += 1 - case buf[pos] == '\xC2' && buf[pos+1] == '\x85': - // NEL . LF - s = append(s, '\n') - parser.buffer_pos += 2 - case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'): - // LS|PS . LS|PS - s = append(s, buf[parser.buffer_pos:pos+3]...) - parser.buffer_pos += 3 +// Check if the character is ASCII. +func isASCII(b []byte, i int) bool { + return b[i] <= 0x7F +} + +// Check if the character at the start of the buffer can be printed unescaped. +func isPrintable(b []byte, i int) bool { + return ((b[i] == 0x0A) || // . == #x0A + (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E + (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF + (b[i] > 0xC2 && b[i] < 0xED) || + (b[i] == 0xED && b[i+1] < 0xA0) || + (b[i] == 0xEE) || + (b[i] == 0xEF && // #xE000 <= . <= #xFFFD + !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF + !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) +} + +// Check if the character at the specified position is NUL. +func isZeroChar(b []byte, i int) bool { + return b[i] == 0x00 +} + +// Check if the beginning of the buffer is a BOM. +func isBOM(b []byte, i int) bool { + return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF +} + +// Check if the character at the specified position is space. +func isSpace(b []byte, i int) bool { + return b[i] == ' ' +} + +// Check if the character at the specified position is tab. +func isTab(b []byte, i int) bool { + return b[i] == '\t' +} + +// Check if the character at the specified position is blank (space or tab). +func isBlank(b []byte, i int) bool { + // return isSpace(b, i) || isTab(b, i) + return b[i] == ' ' || b[i] == '\t' +} + +// Check if the character at the specified position is a line break. +func isLineBreak(b []byte, i int) bool { + return (b[i] == '\r' || // CR (#xD) + b[i] == '\n' || // LF (#xA) + b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029) +} + +// isCRLF checks if the position contains a CR LF sequence. +func isCRLF(b []byte, i int) bool { + return b[i] == '\r' && b[i+1] == '\n' +} + +// Check if the character is a line break or NUL. +func isBreakOrZero(b []byte, i int) bool { + // return isLineBreak(b, i) || isZeroChar(b, i) + return ( + // isBreak: + b[i] == '\r' || // CR (#xD) + b[i] == '\n' || // LF (#xA) + b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) + // isZeroChar: + b[i] == 0) +} + +// Check if the character is a line break, space, or NUL. +func isSpaceOrZero(b []byte, i int) bool { + // return isSpace(b, i) || isBreakOrZero(b, i) + return ( + // isSpace: + b[i] == ' ' || + // isBreakOrZero: + b[i] == '\r' || // CR (#xD) + b[i] == '\n' || // LF (#xA) + b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) + b[i] == 0) +} + +// Check if the character is a line break, space, tab, or NUL. +func isBlankOrZero(b []byte, i int) bool { + // return isBlank(b, i) || isBreakOrZero(b, i) + return ( + // isBlank: + b[i] == ' ' || b[i] == '\t' || + // isBreakOrZero: + b[i] == '\r' || // CR (#xD) + b[i] == '\n' || // LF (#xA) + b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) + b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) + b[i] == 0) +} + +func isEndOfScalarInFlowContentChar(b []byte, i int) bool { + switch b[i] { + // ",", "[", "]", "{" and "}" + case ',', '[', ']', '{', '}': + return true + // "? " + case '?': + return isBlankOrZero(b, i+1) + // ": ", ":,", ":]" and ":}" + case ':': + return b[i+1] == ' ' || b[i+1] == ',' || + b[i+1] == ']' || b[i+1] == '}' default: - return s + return false } - parser.mark.Index++ - parser.mark.Column = 0 - parser.mark.Line++ - parser.unread-- - parser.newlines++ - return s } -// Scan gets the next token. +// Determine the width of the character. +func width(b byte) int { + // Don't replace these by a switch without first + // confirming that it is being inlined. + if b&0x80 == 0x00 { + return 1 + } + if b&0xE0 == 0xC0 { + return 2 + } + if b&0xF0 == 0xE0 { + return 3 + } + if b&0xF8 == 0xF0 { + return 4 + } + return 0 +} + +// Scan advances the buffer pointer and reads the next token. func (parser *Parser) Scan(token *Token) error { // Erase the token object. *token = Token{} // [Go] Is this necessary? @@ -613,45 +784,13 @@ func (parser *Parser) Scan(token *Token) error { return nil } -func formatScannerError(problem string, problem_mark Mark) error { - problem_mark.Line += 1 - - return ScannerError{ - Mark: problem_mark, - Message: problem, - } -} - -func formatScannerErrorContext(context string, context_mark Mark, problem string, problem_mark Mark) error { - context_mark.Line += 1 - problem_mark.Line += 1 +// formatScannerError creates a ScannerError with the given problem message +// and mark position. - return ScannerError{ - ContextMark: context_mark, - ContextMessage: context, - - Mark: problem_mark, - Message: problem, - } -} - -func (parser *Parser) setScannerTagError(directive bool, context_mark Mark, problem string) error { - context := "while parsing a tag" - if directive { - context = "while parsing a %TAG directive" - } - return formatScannerErrorContext(context, context_mark, problem, parser.mark) -} - -func trace(args ...any) func() { - pargs := append([]any{"+++"}, args...) - fmt.Println(pargs...) - pargs = append([]any{"---"}, args...) - return func() { fmt.Println(pargs...) } -} +// max_number_length is the maximum length of a number suffix in a scalar tag. +const max_number_length = 2 -// Ensure that the tokens queue contains at least one token which can be -// returned to the Parser. +// fetchMoreTokens ensures the token queue has at least one token for lookahead. func (parser *Parser) fetchMoreTokens() error { // While we need more tokens to fetch, do it. for { @@ -738,7 +877,7 @@ func (parser *Parser) fetchNextToken() (err error) { } // Is it a directive? - if parser.mark.Column == 0 && parser.buffer[parser.buffer_pos] == '%' { + if parser.mark.Column == 1 && parser.buffer[parser.buffer_pos] == '%' { return parser.fetchDirective() } @@ -746,12 +885,12 @@ func (parser *Parser) fetchNextToken() (err error) { pos := parser.buffer_pos // Is it the document start indicator? - if parser.mark.Column == 0 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && isBlankOrZero(buf, pos+3) { + if parser.mark.Column == 1 && buf[pos] == '-' && buf[pos+1] == '-' && buf[pos+2] == '-' && isBlankOrZero(buf, pos+3) { return parser.fetchDocumentIndicator(DOCUMENT_START_TOKEN) } // Is it the document end indicator? - if parser.mark.Column == 0 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && isBlankOrZero(buf, pos+3) { + if parser.mark.Column == 1 && buf[pos] == '.' && buf[pos+1] == '.' && buf[pos+2] == '.' && isBlankOrZero(buf, pos+3) { return parser.fetchDocumentIndicator(DOCUMENT_END_TOKEN) } @@ -764,6 +903,9 @@ func (parser *Parser) fetchNextToken() (err error) { if err != nil { return } + if parser.skip_comments { + return + } if len(parser.tokens) > 0 && parser.tokens[len(parser.tokens)-1].Type == BLOCK_ENTRY_TOKEN { // Sequence indicators alone have no line comments. It becomes // a head comment for whatever follows. @@ -810,7 +952,8 @@ func (parser *Parser) fetchNextToken() (err error) { } // Is it the value indicator? - if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 && !parser.isFlowSequence() || isBlankOrZero(parser.buffer, parser.buffer_pos+1)) { + if parser.buffer[parser.buffer_pos] == ':' && (parser.flow_level > 0 && + !parser.isFlowSequence() || isBlankOrZero(parser.buffer, parser.buffer_pos+1)) { return parser.fetchValue() } @@ -891,249 +1034,88 @@ func (parser *Parser) fetchNextToken() (err error) { "found character that cannot start any token", parser.mark) } -func (parser *Parser) isFlowSequence() bool { - if len(parser.tokens) == 0 { - return false +// isFlowSequence checks if the previous token indicates we're in a flow +// sequence context. +func (parser *Parser) fetchAnchor(typ TokenType) error { + // An anchor or an alias could be a simple key. + if err := parser.saveSimpleKey(); err != nil { + return err } - previousToken := parser.tokens[len(parser.tokens)-1] - return previousToken.Type == FLOW_ENTRY_TOKEN || previousToken.Type == FLOW_SEQUENCE_START_TOKEN -} -// Check if a simple key may start at the current position and add it if -// needed. -func (parser *Parser) saveSimpleKey() error { - // A simple key is required at the current position if the scanner is in - // the block context and the current column coincides with the indentation - // level. + // A simple key cannot follow an anchor or an alias. + parser.simple_key_allowed = false - required := parser.flow_level == 0 && parser.indent == parser.mark.Column + // Create the ALIAS or ANCHOR token and append it to the queue. + var token Token + if err := parser.scanAnchor(&token, typ); err != nil { + return err + } + parser.insertToken(-1, &token) + return nil +} - // - // If the current position may start a simple key, save it. - // - if parser.simple_key_allowed { - if err := parser.removeSimpleKey(); err != nil { +// Produce the TAG token. +func (parser *Parser) fetchBlockEntry() error { + // Check if the scanner is in the block context. + if parser.flow_level == 0 { + // Check if we are allowed to start a new entry. + if !parser.simple_key_allowed { + return formatScannerError("block sequence entries are not allowed in this context", parser.mark) + } + // Add the BLOCK-SEQUENCE-START token if needed. + if err := parser.rollIndent(parser.mark.Column, -1, BLOCK_SEQUENCE_START_TOKEN, parser.mark); err != nil { return err } + } else { //nolint:staticcheck // there is no problem with this empty branch as it's documentation. - parser.simple_key_possible = true - parser.simple_key = SimpleKey{ - required: required, - flow_level: parser.flow_level, - token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), - mark: parser.mark, - } + // It is an error for the '-' indicator to occur in the flow context, + // but we let the Parser detect and report about it because the Parser + // is able to point to the context. } - return nil -} -// Remove a potential simple key at the current flow level. -func (parser *Parser) removeSimpleKey() error { - // If the key is required, it is an error. - if parser.simple_key.required { - return formatScannerErrorContext( - "while scanning a simple key", parser.simple_key.mark, - "could not find expected ':'", parser.mark) + // Reset any potential simple keys on the current flow level. + if err := parser.removeSimpleKey(); err != nil { + return err } - parser.simple_key_possible = false // disable the key - return nil -} + // Simple keys are allowed after '-'. + parser.simple_key_allowed = true -// max_flow_level limits the flow_level -const max_flow_level = 10000 + // Consume the token. + start_mark := parser.mark + parser.skip() + end_mark := parser.mark -// Increase the flow level and resize the simple key list if needed. -func (parser *Parser) increaseFlowLevel() error { - // Increase the flow level. - parser.flow_level++ - if parser.flow_level > max_flow_level { - return formatScannerErrorContext( - "while increasing flow level", parser.simple_key.mark, - fmt.Sprintf("exceeded max depth of %d", max_flow_level), parser.mark) + // Create the BLOCK-ENTRY token and append it to the queue. + token := Token{ + Type: BLOCK_ENTRY_TOKEN, + StartMark: start_mark, + EndMark: end_mark, } + parser.insertToken(-1, &token) + return nil +} - // If a simple key was possible, push it to the stack before resetting the key. - if parser.simple_key_possible { - parser.simple_key_stack = append(parser.simple_key_stack, parser.simple_key) +// Produce the KEY token. +func (parser *Parser) fetchBlockScalar(literal bool) error { + // Remove any potential simple keys. + if err := parser.removeSimpleKey(); err != nil { + return err } - // Reset the simple key for the new flow level. - parser.simple_key = SimpleKey{} + // A simple key may follow a block scalar. + parser.simple_key_allowed = true + // Create the SCALAR token and append it to the queue. + var token Token + if err := parser.scanBlockScalar(&token, literal); err != nil { + return err + } + parser.insertToken(-1, &token) return nil } -// Decrease the flow level. -func (parser *Parser) decreaseFlowLevel() error { - if parser.flow_level > 0 { - parser.flow_level-- - - if len(parser.simple_key_stack) == 0 { - return nil - } - - last := len(parser.simple_key_stack) - 1 - if parser.simple_key_stack[last].flow_level == parser.flow_level { - parser.simple_key = parser.simple_key_stack[last] // use last item - parser.simple_key_stack = parser.simple_key_stack[:last] // remove last item - parser.simple_key_possible = true // enable the key - } - } - return nil -} - -// max_indents limits the indents stack size -const max_indents = 10000 - -// Push the current indentation level to the stack and set the new level -// the current column is greater than the indentation level. In this case, -// append or insert the specified token into the token queue. -func (parser *Parser) rollIndent(column, number int, typ TokenType, mark Mark) error { - // In the flow context, do nothing. - if parser.flow_level > 0 { - return nil - } - - if parser.indent < column { - // Push the current indentation level to the stack and set the new - // indentation level. - parser.indents = append(parser.indents, parser.indent) - parser.indent = column - if len(parser.indents) > max_indents { - return formatScannerErrorContext( - "while increasing indent level", parser.simple_key.mark, - fmt.Sprintf("exceeded max depth of %d", max_indents), parser.mark) - } - - // Create a token and insert it into the queue. - token := Token{ - Type: typ, - StartMark: mark, - EndMark: mark, - } - if number > -1 { - number -= parser.tokens_parsed - } - parser.insertToken(number, &token) - } - return nil -} - -// Pop indentation levels from the indents stack until the current level -// becomes less or equal to the column. For each indentation level, append -// the BLOCK-END token. -func (parser *Parser) unrollIndent(column int, scan_mark Mark) error { - // In the flow context, do nothing. - if parser.flow_level > 0 { - return nil - } - - block_mark := scan_mark - block_mark.Index-- - - // Loop through the indentation levels in the stack. - for parser.indent > column { - - // [Go] Reposition the end token before potential following - // foot comments of parent blocks. For that, search - // backwards for recent comments that were at the same - // indent as the block that is ending now. - stop_index := block_mark.Index - for i := len(parser.comments) - 1; i >= 0; i-- { - comment := &parser.comments[i] - - if comment.EndMark.Index < stop_index { - // Don't go back beyond the start of the comment/whitespace scan, unless column < 0. - // If requested indent column is < 0, then the document is over and everything else - // is a foot anyway. - break - } - if comment.StartMark.Column == parser.indent+1 { - // This is a good match. But maybe there's a former comment - // at that same indent level, so keep searching. - block_mark = comment.StartMark - } - - // While the end of the former comment matches with - // the start of the following one, we know there's - // nothing in between and scanning is still safe. - stop_index = comment.ScanMark.Index - } - - // Create a token and append it to the queue. - token := Token{ - Type: BLOCK_END_TOKEN, - StartMark: block_mark, - EndMark: block_mark, - } - parser.insertToken(-1, &token) - - // Pop the indentation level. - parser.indent = parser.indents[len(parser.indents)-1] - parser.indents = parser.indents[:len(parser.indents)-1] - } - return nil -} - -// Initialize the scanner and produce the STREAM-START token. -func (parser *Parser) fetchStreamStart() error { - // Set the initial indentation. - parser.indent = -1 - - // Initialize the simple key stack. - parser.simple_key = SimpleKey{} - parser.simple_key_stack = []SimpleKey{} - - // A simple key is allowed at the beginning of the stream. - parser.simple_key_allowed = true - - // We have started. - parser.stream_start_produced = true - - // Create the STREAM-START token and append it to the queue. - token := Token{ - Type: STREAM_START_TOKEN, - StartMark: parser.mark, - EndMark: parser.mark, - encoding: parser.encoding, - } - parser.insertToken(-1, &token) - return nil -} - -// Produce the STREAM-END token and shut down the scanner. -func (parser *Parser) fetchStreamEnd() error { - // Force new line. - if parser.mark.Column != 0 { - parser.mark.Column = 0 - parser.mark.Line++ - } - - // Reset the indentation level. - if err := parser.unrollIndent(-1, parser.mark); err != nil { - return err - } - - // Reset simple keys. - if err := parser.removeSimpleKey(); err != nil { - return err - } - parser.simple_key = SimpleKey{} - parser.simple_key_stack = []SimpleKey{} - parser.simple_key_allowed = false - - // Create the STREAM-END token and append it to the queue. - token := Token{ - Type: STREAM_END_TOKEN, - StartMark: parser.mark, - EndMark: parser.mark, - } - parser.insertToken(-1, &token) - return nil -} - -// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token. +// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. func (parser *Parser) fetchDirective() error { // Reset the indentation level. if err := parser.unrollIndent(-1, parser.mark); err != nil { @@ -1192,26 +1174,27 @@ func (parser *Parser) fetchDocumentIndicator(typ TokenType) error { } // Produce the FLOW-SEQUENCE-START or FLOW-MAPPING-START token. -func (parser *Parser) fetchFlowCollectionStart(typ TokenType) error { - // The indicators '[' and '{' may start a simple key. - if err := parser.saveSimpleKey(); err != nil { +func (parser *Parser) fetchFlowCollectionEnd(typ TokenType) error { + // Reset any potential simple key on the current flow level. + if err := parser.removeSimpleKey(); err != nil { return err } - // Increase the flow level. - if err := parser.increaseFlowLevel(); err != nil { + // Decrease the flow level. + if err := parser.decreaseFlowLevel(); err != nil { return err } - // A simple key may follow the indicators '[' and '{'. - parser.simple_key_allowed = true + // No simple keys after the indicators ']' and '}'. + parser.simple_key_allowed = false // Consume the token. + start_mark := parser.mark parser.skip() end_mark := parser.mark - // Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. + // Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. token := Token{ Type: typ, StartMark: start_mark, @@ -1222,28 +1205,27 @@ func (parser *Parser) fetchFlowCollectionStart(typ TokenType) error { return nil } -// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. -func (parser *Parser) fetchFlowCollectionEnd(typ TokenType) error { - // Reset any potential simple key on the current flow level. - if err := parser.removeSimpleKey(); err != nil { +// Produce the FLOW-ENTRY token. +func (parser *Parser) fetchFlowCollectionStart(typ TokenType) error { + // The indicators '[' and '{' may start a simple key. + if err := parser.saveSimpleKey(); err != nil { return err } - // Decrease the flow level. - if err := parser.decreaseFlowLevel(); err != nil { + // Increase the flow level. + if err := parser.increaseFlowLevel(); err != nil { return err } - // No simple keys after the indicators ']' and '}'. - parser.simple_key_allowed = false + // A simple key may follow the indicators '[' and '{'. + parser.simple_key_allowed = true // Consume the token. - start_mark := parser.mark parser.skip() end_mark := parser.mark - // Create the FLOW-SEQUENCE-END of FLOW-MAPPING-END token. + // Create the FLOW-SEQUENCE-START of FLOW-MAPPING-START token. token := Token{ Type: typ, StartMark: start_mark, @@ -1254,7 +1236,7 @@ func (parser *Parser) fetchFlowCollectionEnd(typ TokenType) error { return nil } -// Produce the FLOW-ENTRY token. +// Produce the FLOW-SEQUENCE-END or FLOW-MAPPING-END token. func (parser *Parser) fetchFlowEntry() error { // Reset any potential simple keys on the current flow level. if err := parser.removeSimpleKey(); err != nil { @@ -1280,48 +1262,25 @@ func (parser *Parser) fetchFlowEntry() error { } // Produce the BLOCK-ENTRY token. -func (parser *Parser) fetchBlockEntry() error { - // Check if the scanner is in the block context. - if parser.flow_level == 0 { - // Check if we are allowed to start a new entry. - if !parser.simple_key_allowed { - return formatScannerError("block sequence entries are not allowed in this context", parser.mark) - } - // Add the BLOCK-SEQUENCE-START token if needed. - if err := parser.rollIndent(parser.mark.Column, -1, BLOCK_SEQUENCE_START_TOKEN, parser.mark); err != nil { - return err - } - } else { //nolint:staticcheck // there is no problem with this empty branch as it's documentation. - - // It is an error for the '-' indicator to occur in the flow context, - // but we let the Parser detect and report about it because the Parser - // is able to point to the context. - } - - // Reset any potential simple keys on the current flow level. - if err := parser.removeSimpleKey(); err != nil { +func (parser *Parser) fetchFlowScalar(single bool) error { + // A plain scalar could be a simple key. + if err := parser.saveSimpleKey(); err != nil { return err } - // Simple keys are allowed after '-'. - parser.simple_key_allowed = true - - // Consume the token. - start_mark := parser.mark - parser.skip() - end_mark := parser.mark + // A simple key cannot follow a flow scalar. + parser.simple_key_allowed = false - // Create the BLOCK-ENTRY token and append it to the queue. - token := Token{ - Type: BLOCK_ENTRY_TOKEN, - StartMark: start_mark, - EndMark: end_mark, + // Create the SCALAR token and append it to the queue. + var token Token + if err := parser.scanFlowScalar(&token, single); err != nil { + return err } parser.insertToken(-1, &token) return nil } -// Produce the KEY token. +// Produce the SCALAR(...,plain) token. func (parser *Parser) fetchKey() error { // In the block context, additional checks are required. if parser.flow_level == 0 { @@ -1359,20 +1318,115 @@ func (parser *Parser) fetchKey() error { } // Produce the VALUE token. -func (parser *Parser) fetchValue() error { - simple_key := &parser.simple_key +func (parser *Parser) fetchPlainScalar() error { + // A plain scalar could be a simple key. + if err := parser.saveSimpleKey(); err != nil { + return err + } - // Have we found a simple key? - if parser.simple_key_possible && simple_key.mark.Line == parser.mark.Line { - // Create the KEY token and insert it into the queue. - token := Token{ - Type: KEY_TOKEN, - StartMark: simple_key.mark, - EndMark: simple_key.mark, - } - parser.insertToken(simple_key.token_number-parser.tokens_parsed, &token) + // A simple key cannot follow a flow scalar. + parser.simple_key_allowed = false - // In the block context, we may need to add the BLOCK-MAPPING-START token. + // Create the SCALAR token and append it to the queue. + var token Token + if err := parser.scanPlainScalar(&token); err != nil { + return err + } + parser.insertToken(-1, &token) + return nil +} + +// Eat whitespaces and comments until the next token is found. +func (parser *Parser) fetchStreamEnd() error { + // Force new line. + if parser.mark.Column != 1 { + parser.mark.Column = 1 + parser.mark.Line++ + } + + // Reset the indentation level. + if err := parser.unrollIndent(-1, parser.mark); err != nil { + return err + } + + // Reset simple keys. + if err := parser.removeSimpleKey(); err != nil { + return err + } + parser.simple_key = SimpleKey{} + parser.simple_key_stack = []SimpleKey{} + parser.simple_key_allowed = false + + // Create the STREAM-END token and append it to the queue. + token := Token{ + Type: STREAM_END_TOKEN, + StartMark: parser.mark, + EndMark: parser.mark, + } + parser.insertToken(-1, &token) + return nil +} + +// Produce a VERSION-DIRECTIVE or TAG-DIRECTIVE token. +func (parser *Parser) fetchStreamStart() error { + // Set the initial indentation. + parser.indent = -1 + + // Initialize the simple key stack. + parser.simple_key = SimpleKey{} + parser.simple_key_stack = []SimpleKey{} + + // A simple key is allowed at the beginning of the stream. + parser.simple_key_allowed = true + + // We have started. + parser.stream_start_produced = true + + // Create the STREAM-START token and append it to the queue. + token := Token{ + Type: STREAM_START_TOKEN, + StartMark: parser.mark, + EndMark: parser.mark, + encoding: parser.encoding, + } + parser.insertToken(-1, &token) + return nil +} + +// Produce the STREAM-END token and shut down the scanner. +func (parser *Parser) fetchTag() error { + // A tag could be a simple key. + if err := parser.saveSimpleKey(); err != nil { + return err + } + + // A simple key cannot follow a tag. + parser.simple_key_allowed = false + + // Create the TAG token and append it to the queue. + var token Token + if err := parser.scanTag(&token); err != nil { + return err + } + parser.insertToken(-1, &token) + return nil +} + +// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. +func (parser *Parser) fetchValue() error { + simple_key := &parser.simple_key + + // Have we found a simple key? + if parser.simple_key_possible && simple_key.mark.Line == parser.mark.Line { + // Create the KEY token and insert it into the queue. + token := Token{ + Type: KEY_TOKEN, + StartMark: simple_key.mark, + EndMark: simple_key.mark, + } + parser.insertToken(simple_key.token_number-parser.tokens_parsed, &token) + + // In the block context, we may need to add the BLOCK-MAPPING-START token. if err := parser.rollIndent(simple_key.mark.Column, simple_key.token_number, BLOCK_MAPPING_START_TOKEN, simple_key.mark); err != nil { @@ -1423,255 +1477,136 @@ func (parser *Parser) fetchValue() error { } // Produce the ALIAS or ANCHOR token. -func (parser *Parser) fetchAnchor(typ TokenType) error { - // An anchor or an alias could be a simple key. - if err := parser.saveSimpleKey(); err != nil { - return err - } - - // A simple key cannot follow an anchor or an alias. - parser.simple_key_allowed = false +func (parser *Parser) scanAnchor(token *Token, typ TokenType) error { + var s []byte - // Create the ALIAS or ANCHOR token and append it to the queue. - var token Token - if err := parser.scanAnchor(&token, typ); err != nil { - return err - } - parser.insertToken(-1, &token) - return nil -} + // Eat the indicator character. + start_mark := parser.mark + parser.skip() -// Produce the TAG token. -func (parser *Parser) fetchTag() error { - // A tag could be a simple key. - if err := parser.saveSimpleKey(); err != nil { - return err + // Consume the value. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } } - // A simple key cannot follow a tag. - parser.simple_key_allowed = false - - // Create the TAG token and append it to the queue. - var token Token - if err := parser.scanTag(&token); err != nil { - return err + for isAnchorChar(parser.buffer, parser.buffer_pos) { + s = parser.read(s) + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } } - parser.insertToken(-1, &token) - return nil -} -// Produce the SCALAR(...,literal) or SCALAR(...,folded) tokens. -func (parser *Parser) fetchBlockScalar(literal bool) error { - // Remove any potential simple keys. - if err := parser.removeSimpleKey(); err != nil { - return err - } + end_mark := parser.mark - // A simple key may follow a block scalar. - parser.simple_key_allowed = true + /* + * Check if length of the anchor is greater than 0 and it is followed by + * a whitespace character or one of the indicators: + * + * '?', ':', ',', ']', '}', '%', '@', '`'. + */ - // Create the SCALAR token and append it to the queue. - var token Token - if err := parser.scanBlockScalar(&token, literal); err != nil { - return err + if len(s) == 0 || + !(isBlankOrZero(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' || + parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' || + parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' || + parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' || + parser.buffer[parser.buffer_pos] == '`') { + context := "while scanning an alias" + if typ == ANCHOR_TOKEN { + context = "while scanning an anchor" + } + return formatScannerErrorContext(context, start_mark, + "did not find expected alphabetic or numeric character", parser.mark) } - parser.insertToken(-1, &token) - return nil -} -// Produce the SCALAR(...,single-quoted) or SCALAR(...,double-quoted) tokens. -func (parser *Parser) fetchFlowScalar(single bool) error { - // A plain scalar could be a simple key. - if err := parser.saveSimpleKey(); err != nil { - return err + // Create a token. + *token = Token{ + Type: typ, + StartMark: start_mark, + EndMark: end_mark, + Value: s, } - // A simple key cannot follow a flow scalar. - parser.simple_key_allowed = false - - // Create the SCALAR token and append it to the queue. - var token Token - if err := parser.scanFlowScalar(&token, single); err != nil { - return err - } - parser.insertToken(-1, &token) return nil } -// Produce the SCALAR(...,plain) token. -func (parser *Parser) fetchPlainScalar() error { - // A plain scalar could be a simple key. - if err := parser.saveSimpleKey(); err != nil { - return err - } - - // A simple key cannot follow a flow scalar. - parser.simple_key_allowed = false +// scanTag scans a TAG token. +func (parser *Parser) scanBlockScalar(token *Token, literal bool) error { + // Eat the indicator '|' or '>'. + start_mark := parser.mark + parser.skip() - // Create the SCALAR token and append it to the queue. - var token Token - if err := parser.scanPlainScalar(&token); err != nil { - return err + // Scan the additional block scalar indicators. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } } - parser.insertToken(-1, &token) - return nil -} -// Eat whitespaces and comments until the next token is found. -func (parser *Parser) scanToNextToken() error { - scan_mark := parser.mark + // Check for a chomping indicator. + var chomping, increment int + if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { + // Set the chomping method and eat the indicator. + if parser.buffer[parser.buffer_pos] == '+' { + chomping = +1 + } else { + chomping = -1 + } + parser.skip() - // Until the next token is not found. - for { - // Allow the BOM mark to start a line. + // Check for an indentation indicator. if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } - if parser.mark.Column == 0 && isBOM(parser.buffer, parser.buffer_pos) { + if isDigit(parser.buffer, parser.buffer_pos) { + // Check that the indentation is greater than 0. + if parser.buffer[parser.buffer_pos] == '0' { + return formatScannerErrorContext("while scanning a block scalar", start_mark, + "found an indentation indicator equal to 0", parser.mark) + } + + // Get the indentation level and eat the indicator. + increment = asDigit(parser.buffer, parser.buffer_pos) parser.skip() } - // Eat whitespaces. - // Tabs are allowed: - // - in the flow context - // - in the block context, but not at the beginning of the line or - // after '-', '?', or ':' (complex value). - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - - for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') { - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - } + } else if isDigit(parser.buffer, parser.buffer_pos) { + // Do the same as above, but in the opposite order. - // Check if we just had a line comment under a sequence entry that - // looks more like a header to the following content. Similar to this: - // - // - # The comment - // - Some data - // - // If so, transform the line comment to a head comment and reposition. - if len(parser.comments) > 0 && len(parser.tokens) > 1 { - tokenA := parser.tokens[len(parser.tokens)-2] - tokenB := parser.tokens[len(parser.tokens)-1] - comment := &parser.comments[len(parser.comments)-1] - if tokenA.Type == BLOCK_SEQUENCE_START_TOKEN && tokenB.Type == BLOCK_ENTRY_TOKEN && len(comment.Line) > 0 && !isLineBreak(parser.buffer, parser.buffer_pos) { - // If it was in the prior line, reposition so it becomes a - // header of the follow up token. Otherwise, keep it in place - // so it becomes a header of the former. - comment.Head = comment.Line - comment.Line = nil - if comment.StartMark.Line == parser.mark.Line-1 { - comment.TokenMark = parser.mark - } - } + if parser.buffer[parser.buffer_pos] == '0' { + return formatScannerErrorContext("while scanning a block scalar", start_mark, + "found an indentation indicator equal to 0", parser.mark) } + increment = asDigit(parser.buffer, parser.buffer_pos) + parser.skip() - // Eat a comment until a line break. - if parser.buffer[parser.buffer_pos] == '#' { - if err := parser.scanComments(scan_mark); err != nil { + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { return err } } - - // If it is a line break, eat it. - if isLineBreak(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { - return err - } - } - parser.skipLine() - - // In the block context, a new line may start a simple key. - if parser.flow_level == 0 { - parser.simple_key_allowed = true + if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { + if parser.buffer[parser.buffer_pos] == '+' { + chomping = +1 + } else { + chomping = -1 } - } else { - break // We have found a token. - } - } - - return nil -} - -// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. -// -// Scope: -// -// %YAML 1.1 # a comment \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -func (parser *Parser) scanDirective(token *Token) error { - // Eat '%'. - start_mark := parser.mark - parser.skip() - - // Scan the directive name. - var name []byte - if err := parser.scanDirectiveName(start_mark, &name); err != nil { - return err - } - - // Is it a YAML directive? - if bytes.Equal(name, []byte("YAML")) { - // Scan the VERSION directive value. - var major, minor int8 - if err := parser.scanVersionDirectiveValue(start_mark, &major, &minor); err != nil { - return err - } - end_mark := parser.mark - - // Create a VERSION-DIRECTIVE token. - *token = Token{ - Type: VERSION_DIRECTIVE_TOKEN, - StartMark: start_mark, - EndMark: end_mark, - major: major, - minor: minor, - } - - // Is it a TAG directive? - } else if bytes.Equal(name, []byte("TAG")) { - // Scan the TAG directive value. - var handle, prefix []byte - if err := parser.scanTagDirectiveValue(start_mark, &handle, &prefix); err != nil { - return err - } - end_mark := parser.mark - - // Create a TAG-DIRECTIVE token. - *token = Token{ - Type: TAG_DIRECTIVE_TOKEN, - StartMark: start_mark, - EndMark: end_mark, - Value: handle, - prefix: prefix, + parser.skip() } - - // Unknown directive. - } else { - return formatScannerErrorContext("while scanning a directive", start_mark, - "found unknown directive name", parser.mark) } - // Eat the rest of the line including any comments. + // Eat whitespaces and comments to the end of the line. if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } - for isBlank(parser.buffer, parser.buffer_pos) { parser.skip() if parser.unread < 1 { @@ -1680,12 +1615,10 @@ func (parser *Parser) scanDirective(token *Token) error { } } } - if parser.buffer[parser.buffer_pos] == '#' { - // [Go] Discard this inline comment for the time being. - //if !parser.ScanLineComment(start_mark) { - // return false - //} + if err := parser.scanLineComment(start_mark); err != nil { + return err + } for !isBreakOrZero(parser.buffer, parser.buffer_pos) { parser.skip() if parser.unread < 1 { @@ -1698,7 +1631,7 @@ func (parser *Parser) scanDirective(token *Token) error { // Check if we are at the end of the line. if !isBreakOrZero(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a directive", start_mark, + return formatScannerErrorContext("while scanning a block scalar", start_mark, "did not find expected comment or line break", parser.mark) } @@ -1712,380 +1645,391 @@ func (parser *Parser) scanDirective(token *Token) error { parser.skipLine() } - return nil -} + end_mark := parser.mark -// Scan the directive name. -// -// Scope: -// -// %YAML 1.1 # a comment \n -// ^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^ -func (parser *Parser) scanDirectiveName(start_mark Mark, name *[]byte) error { - // Consume the directive name. + // Set the indentation level if it was specified. + var indent int + if increment > 0 { + if parser.indent >= 0 { + indent = parser.indent + increment + } else { + // With 1-based columns, the line start is column 1, so an + // explicit indent indicator of n means column n+1. + indent = increment + 1 + } + } + + // Scan the leading line breaks and determine the indentation level if + // needed. + var s, leading_break, trailing_breaks []byte + if err := parser.scanBlockScalarBreaks(&indent, &trailing_breaks, start_mark, &end_mark); err != nil { + return err + } + + // Scan the block scalar content. if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } + var leading_blank, trailing_blank bool + for parser.mark.Column == indent && !isZeroChar(parser.buffer, parser.buffer_pos) { + // We are at the beginning of a non-empty line. - var s []byte - for isAlpha(parser.buffer, parser.buffer_pos) { - s = parser.read(s) - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + // Is it a trailing whitespace? + trailing_blank = isBlank(parser.buffer, parser.buffer_pos) + + // Check if we need to fold the leading line break. + if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' { + // Do we need to join the lines by space? + if len(trailing_breaks) == 0 { + s = append(s, ' ') } + } else { + s = append(s, leading_break...) } - } + leading_break = leading_break[:0] - // Check if the name is empty. - if len(s) == 0 { - return formatScannerErrorContext("while scanning a directive", start_mark, - "could not find expected directive name", parser.mark) - } + // Append the remaining line breaks. + s = append(s, trailing_breaks...) + trailing_breaks = trailing_breaks[:0] - // Check for an blank character after the name. - if !isBlankOrZero(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a directive", start_mark, - "found unexpected non-alphabetical character", parser.mark) - } - *name = s - return nil -} + // Is it a leading whitespace? + leading_blank = isBlank(parser.buffer, parser.buffer_pos) -// Scan the value of VERSION-DIRECTIVE. -// -// Scope: -// -// %YAML 1.1 # a comment \n -// ^^^^^^ -func (parser *Parser) scanVersionDirectiveValue(start_mark Mark, major, minor *int8) error { - // Eat whitespaces. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + // Consume the current line. + for !isBreakOrZero(parser.buffer, parser.buffer_pos) { + s = parser.read(s) + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } } - } - for isBlank(parser.buffer, parser.buffer_pos) { - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { + + // Consume the line break. + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { return err } } - } - // Consume the major version number. - if err := parser.scanVersionDirectiveNumber(start_mark, major); err != nil { - return err - } + leading_break = parser.readLine(leading_break) - // Eat '.'. - if parser.buffer[parser.buffer_pos] != '.' { - return formatScannerErrorContext("while scanning a %YAML directive", start_mark, - "did not find expected digit or '.' character", parser.mark) + // Eat the following indentation spaces and line breaks. + if err := parser.scanBlockScalarBreaks(&indent, &trailing_breaks, start_mark, &end_mark); err != nil { + return err + } } - parser.skip() - - // Consume the minor version number. - if err := parser.scanVersionDirectiveNumber(start_mark, minor); err != nil { - return err - } - return nil -} - -const max_number_length = 2 - -// Scan the version number of VERSION-DIRECTIVE. -// -// Scope: -// -// %YAML 1.1 # a comment \n -// ^ -// %YAML 1.1 # a comment \n -// ^ -func (parser *Parser) scanVersionDirectiveNumber(start_mark Mark, number *int8) error { - // Repeat while the next character is digit. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } + // Chomp the tail. + if chomping != -1 { + s = append(s, leading_break...) } - var value, length int8 - for isDigit(parser.buffer, parser.buffer_pos) { - // Check if the number is too long. - length++ - if length > max_number_length { - return formatScannerErrorContext("while scanning a %YAML directive", start_mark, - "found extremely long version number", parser.mark) - } - value = value*10 + int8(asDigit(parser.buffer, parser.buffer_pos)) - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } + if chomping == 1 { + s = append(s, trailing_breaks...) } - // Check if the number was present. - if length == 0 { - return formatScannerErrorContext("while scanning a %YAML directive", start_mark, - "did not find expected version number", parser.mark) + // Create a token. + *token = Token{ + Type: SCALAR_TOKEN, + StartMark: start_mark, + EndMark: end_mark, + Value: s, + Style: LITERAL_SCALAR_STYLE, + } + if !literal { + token.Style = FOLDED_SCALAR_STYLE } - *number = value return nil } -// Scan the value of a TAG-DIRECTIVE token. -// -// Scope: -// -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -func (parser *Parser) scanTagDirectiveValue(start_mark Mark, handle, prefix *[]byte) error { - var handle_value, prefix_value []byte - - // Eat whitespaces. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } +// Scan indentation spaces and line breaks for a block scalar. +// Determine the indentation level if needed. +func (parser *Parser) scanBlockScalarBreaks(indent *int, breaks *[]byte, start_mark Mark, end_mark *Mark) error { + *end_mark = parser.mark - for isBlank(parser.buffer, parser.buffer_pos) { - parser.skip() + // Eat the indentation spaces and line breaks. + max_indent := 0 + for { + // Eat the indentation spaces. if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } - } + for (*indent == 0 || parser.mark.Column < *indent) && isSpace(parser.buffer, parser.buffer_pos) { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + } + if parser.mark.Column > max_indent { + max_indent = parser.mark.Column + } - // Scan a handle. - if err := parser.scanTagHandle(true, start_mark, &handle_value); err != nil { - return err - } + // Check for a tab character messing the indentation. + if (*indent == 0 || parser.mark.Column < *indent) && isTab(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a block scalar", start_mark, + "found a tab character where an indentation space is expected", parser.mark) + } - // Expect a whitespace. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + // Have we found a non-empty line? + if !isLineBreak(parser.buffer, parser.buffer_pos) { + break } - } - if !isBlank(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a %TAG directive", start_mark, - "did not find expected whitespace", parser.mark) - } - // Eat whitespaces. - for isBlank(parser.buffer, parser.buffer_pos) { - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { + // Consume the line break. + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { return err } } + // [Go] Should really be returning breaks instead. + *breaks = parser.readLine(*breaks) + *end_mark = parser.mark } - // Scan a prefix (TAG directive URI - flow indicators allowed). - if err := parser.scanTagURI(true, true, nil, start_mark, &prefix_value); err != nil { - return err - } - - // Expect a whitespace or line break. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + // Determine the indentation level if needed. + if *indent == 0 { + *indent = max_indent + if *indent < parser.indent+1 { + *indent = parser.indent + 1 + } + if *indent < 1 { + *indent = 1 } } - if !isBlankOrZero(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a %TAG directive", start_mark, - "did not find expected whitespace or line break", parser.mark) - } - - *handle = handle_value - *prefix = prefix_value return nil } -func (parser *Parser) scanAnchor(token *Token, typ TokenType) error { - var s []byte - - // Eat the indicator character. - start_mark := parser.mark - parser.skip() - - // Consume the value. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - - for isAnchorChar(parser.buffer, parser.buffer_pos) { - s = parser.read(s) - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - } - - end_mark := parser.mark - - /* - * Check if length of the anchor is greater than 0 and it is followed by - * a whitespace character or one of the indicators: - * - * '?', ':', ',', ']', '}', '%', '@', '`'. - */ +// Scan a quoted scalar. +func (parser *Parser) scanComments(scan_mark Mark) error { + token := parser.tokens[len(parser.tokens)-1] - if len(s) == 0 || - !(isBlankOrZero(parser.buffer, parser.buffer_pos) || parser.buffer[parser.buffer_pos] == '?' || - parser.buffer[parser.buffer_pos] == ':' || parser.buffer[parser.buffer_pos] == ',' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '}' || - parser.buffer[parser.buffer_pos] == '%' || parser.buffer[parser.buffer_pos] == '@' || - parser.buffer[parser.buffer_pos] == '`') { - context := "while scanning an alias" - if typ == ANCHOR_TOKEN { - context = "while scanning an anchor" - } - return formatScannerErrorContext(context, start_mark, - "did not find expected alphabetic or numeric character", parser.mark) + if token.Type == FLOW_ENTRY_TOKEN && len(parser.tokens) > 1 { + token = parser.tokens[len(parser.tokens)-2] } - // Create a token. - *token = Token{ - Type: typ, - StartMark: start_mark, - EndMark: end_mark, - Value: s, + token_mark := token.StartMark + var start_mark Mark + next_indent := parser.indent + if next_indent < 0 { + next_indent = 0 } - return nil -} - -/* - * Scan a TAG token. - */ + recent_empty := false + first_empty := parser.newlines <= 1 -func (parser *Parser) scanTag(token *Token) error { - var handle, suffix []byte + line := parser.mark.Line + column := parser.mark.Column - start_mark := parser.mark + var text []byte - // Check if the tag is in the canonical form. - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { - return err + // The foot line is the place where a comment must start to + // still be considered as a foot of the prior content. + // If there's some content in the currently parsed line, then + // the foot is the line below it. + foot_line := -1 + if scan_mark.Line > 0 { + foot_line = parser.mark.Line - parser.newlines + 1 + if parser.newlines == 0 && parser.mark.Column > 1 { + foot_line++ } } - if parser.buffer[parser.buffer_pos+1] == '<' { - // Keep the handle as '' - - // Eat '!<' - parser.skip() - parser.skip() - - // Consume the tag value (verbatim tag - flow indicators allowed). - if err := parser.scanTagURI(false, true, nil, start_mark, &suffix); err != nil { - return err + peek := 0 + for ; peek < 512; peek++ { + if parser.unread < peek+1 { + if parser.updateBuffer(peek+1) != nil { + break + } } - - // Check for '>' and eat it. - if parser.buffer[parser.buffer_pos] != '>' { - return formatScannerErrorContext("while scanning a tag", start_mark, - "did not find the expected '>'", parser.mark) + column++ + if isBlank(parser.buffer, parser.buffer_pos+peek) { + continue + } + c := parser.buffer[parser.buffer_pos+peek] + close_flow := parser.flow_level > 0 && (c == ']' || c == '}') + if close_flow || isBreakOrZero(parser.buffer, parser.buffer_pos+peek) { + // Got line break or terminator. + if close_flow || !recent_empty { + if close_flow || first_empty && (start_mark.Line == foot_line && token.Type != VALUE_TOKEN || start_mark.Column-1 < next_indent) { + // This is the first empty line and there were no empty lines before, + // so this initial part of the comment is a foot of the prior token + // instead of being a head for the following one. Split it up. + // Alternatively, this might also be the last comment inside a flow + // scope, so it must be a footer. + if len(text) > 0 { + if start_mark.Column-1 < next_indent { + // If dedented it's unrelated to the prior token. + token_mark = start_mark + } + parser.comments = append(parser.comments, Comment{ + ScanMark: scan_mark, + TokenMark: token_mark, + StartMark: start_mark, + EndMark: Mark{parser.mark.Index + peek, line, column}, + Foot: text, + }) + scan_mark = Mark{parser.mark.Index + peek, line, column} + token_mark = scan_mark + text = nil + } + } else { + if len(text) > 0 && parser.buffer[parser.buffer_pos+peek] != 0 { + text = append(text, '\n') + } + } + } + if !isLineBreak(parser.buffer, parser.buffer_pos+peek) { + break + } + first_empty = false + recent_empty = true + column = 1 + line++ + continue } - parser.skip() - } else { - // The tag has either the '!suffix' or the '!handle!suffix' form. - - // First, try to scan a handle. - if err := parser.scanTagHandle(false, start_mark, &handle); err != nil { - return err + if len(text) > 0 && (close_flow || column-1 < next_indent && column != start_mark.Column) { + // The comment at the different indentation is a foot of the + // preceding data rather than a head of the upcoming one. + parser.comments = append(parser.comments, Comment{ + ScanMark: scan_mark, + TokenMark: token_mark, + StartMark: start_mark, + EndMark: Mark{parser.mark.Index + peek, line, column}, + Foot: text, + }) + scan_mark = Mark{parser.mark.Index + peek, line, column} + token_mark = scan_mark + text = nil } - // Check if it is, indeed, handle. - if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' { - // Scan the suffix now (short form - flow indicators not allowed). - if err := parser.scanTagURI(false, false, nil, start_mark, &suffix); err != nil { - return err - } + if parser.buffer[parser.buffer_pos+peek] != '#' { + break + } + + if len(text) == 0 { + start_mark = Mark{parser.mark.Index + peek, line, column} } else { - // It wasn't a handle after all. Scan the rest of the tag (short form). - if err := parser.scanTagURI(false, false, handle, start_mark, &suffix); err != nil { - return err - } + text = append(text, '\n') + } - // Set the handle to '!'. - handle = []byte{'!'} + recent_empty = false - // A special case: the '!' tag. Set the handle to '' and the - // suffix to '!'. - if len(suffix) == 0 { - handle, suffix = suffix, handle + // Consume until after the consumed comment line. + seen := parser.mark.Index + peek + for { + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + if isBreakOrZero(parser.buffer, parser.buffer_pos) { + if parser.mark.Index >= seen { + break + } + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { + return err + } + } + parser.skipLine() + } else if parser.mark.Index >= seen { + text = parser.read(text) + } else { + parser.skip() } } - } - // Check the character which ends the tag. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + peek = 0 + column = 1 + line = parser.mark.Line + next_indent = parser.indent + if next_indent < 0 { + next_indent = 0 } } - if !isBlankOrZero(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a tag", start_mark, - "did not find expected whitespace or line break", parser.mark) - } - - end_mark := parser.mark - // Create a token. - *token = Token{ - Type: TAG_TOKEN, - StartMark: start_mark, - EndMark: end_mark, - Value: handle, - suffix: suffix, + if len(text) > 0 { + parser.comments = append(parser.comments, Comment{ + ScanMark: scan_mark, + TokenMark: start_mark, + StartMark: start_mark, + EndMark: Mark{parser.mark.Index + peek - 1, line, column}, + Head: text, + }) } return nil } -// Scan a tag handle. -func (parser *Parser) scanTagHandle(directive bool, start_mark Mark, handle *[]byte) error { - // Check the initial '!' character. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { +// scanDirective scans a directive (%YAML or %TAG). +func (parser *Parser) scanDirective(token *Token) error { + // Eat '%'. + start_mark := parser.mark + parser.skip() + + // Scan the directive name. + var name []byte + if err := parser.scanDirectiveName(start_mark, &name); err != nil { + return err + } + + // Is it a YAML directive? + if bytes.Equal(name, []byte("YAML")) { + // Scan the VERSION directive value. + var major, minor int8 + if err := parser.scanVersionDirectiveValue(start_mark, &major, &minor); err != nil { return err } - } - if parser.buffer[parser.buffer_pos] != '!' { - return parser.setScannerTagError(directive, - start_mark, "did not find expected '!'") - } + end_mark := parser.mark - var s []byte + // Create a VERSION-DIRECTIVE token. + *token = Token{ + Type: VERSION_DIRECTIVE_TOKEN, + StartMark: start_mark, + EndMark: end_mark, + major: major, + minor: minor, + } - // Copy the '!' character. - s = parser.read(s) + // Is it a TAG directive? + } else if bytes.Equal(name, []byte("TAG")) { + // Scan the TAG directive value. + var handle, prefix []byte + if err := parser.scanTagDirectiveValue(start_mark, &handle, &prefix); err != nil { + return err + } + end_mark := parser.mark - // Copy all subsequent alphabetical and numerical characters. + // Create a TAG-DIRECTIVE token. + *token = Token{ + Type: TAG_DIRECTIVE_TOKEN, + StartMark: start_mark, + EndMark: end_mark, + Value: handle, + prefix: prefix, + } + + // Unknown directive. + } else { + return formatScannerErrorContext("while scanning a directive", start_mark, + "found unknown directive name", parser.mark) + } + + // Eat the rest of the line including any comments. if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } - for isAlpha(parser.buffer, parser.buffer_pos) { - s = parser.read(s) + + for isBlank(parser.buffer, parser.buffer_pos) { + parser.skip() if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err @@ -2093,445 +2037,129 @@ func (parser *Parser) scanTagHandle(directive bool, start_mark Mark, handle *[]b } } - // Check if the trailing character is '!' and copy it. - if parser.buffer[parser.buffer_pos] == '!' { - s = parser.read(s) - } else { - // It's either the '!' tag or not really a tag handle. If it's a %TAG - // directive, it's an error. If it's a tag token, it must be a part of URI. - if directive && string(s) != "!" { - return parser.setScannerTagError(directive, - start_mark, "did not find expected '!'") + if parser.buffer[parser.buffer_pos] == '#' { + // [Go] Discard this inline comment for the time being. + //if !parser.ScanLineComment(start_mark) { + // return false + //} + for !isBreakOrZero(parser.buffer, parser.buffer_pos) { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } } } - *handle = s - return nil -} - -// Scan a tag URI. -// directive: true if scanning a %TAG directive URI -// verbatim: true if scanning a verbatim tag !<...> or TAG directive (flow indicators allowed) -func (parser *Parser) scanTagURI(directive bool, verbatim bool, head []byte, start_mark Mark, uri *[]byte) error { - // size_t length = head ? strlen((char *)head) : 0 - var s []byte - hasTag := len(head) > 0 - - // Copy the head if needed. - // - // Note that we don't copy the leading '!' character. - if len(head) > 1 { - s = append(s, head[1:]...) + // Check if we are at the end of the line. + if !isBreakOrZero(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a directive", start_mark, + "did not find expected comment or line break", parser.mark) } - // Scan the tag. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + // Eat a line break. + if isLineBreak(parser.buffer, parser.buffer_pos) { + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { + return err + } } + parser.skipLine() } - // The set of characters that may appear in URI is as follows: - // - // '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', - // '=', '+', '$', '.', '!', '~', '*', '\'', '(', ')', '%'. - // - // Note: Flow indicators (',', '[', ']', '{', '}') are only allowed in verbatim tags. - for isTagURIChar(parser.buffer, parser.buffer_pos, verbatim) { - // Check if it is a URI-escape sequence. - if parser.buffer[parser.buffer_pos] == '%' { - if err := parser.scanURIEscapes(directive, start_mark, &s); err != nil { - return err - } - } else { - s = parser.read(s) - } - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - hasTag = true - } - - // Check for characters which are not allowed in tags. - // For non-verbatim tags, if we stopped at a printable character that isn't whitespace, - // it's an invalid tag character - give a specific error. - // For verbatim tags, the caller will check for the expected '>' delimiter. - if !verbatim { - c := parser.buffer[parser.buffer_pos] - if !isBlankOrZero(parser.buffer, parser.buffer_pos) && - c >= 0x20 && c <= 0x7E { - return parser.setScannerTagError(directive, start_mark, - fmt.Sprintf("found character '%c' that is not allowed in a YAML tag", c)) - } - } - - if !hasTag { - return parser.setScannerTagError(directive, - start_mark, "did not find expected tag URI") - } - *uri = s - return nil -} - -// Decode an URI-escape sequence corresponding to a single UTF-8 character. -func (parser *Parser) scanURIEscapes(directive bool, start_mark Mark, s *[]byte) error { - // Decode the required number of characters. - w := 1024 - for w > 0 { - // Check for a URI-escaped octet. - if parser.unread < 3 { - if err := parser.updateBuffer(3); err != nil { - return err - } - } - - if !(parser.buffer[parser.buffer_pos] == '%' && - isHex(parser.buffer, parser.buffer_pos+1) && - isHex(parser.buffer, parser.buffer_pos+2)) { - return parser.setScannerTagError(directive, - start_mark, "did not find URI escaped octet") - } - - // Get the octet. - octet := byte((asHex(parser.buffer, parser.buffer_pos+1) << 4) + asHex(parser.buffer, parser.buffer_pos+2)) - - // If it is the leading octet, determine the length of the UTF-8 sequence. - if w == 1024 { - w = width(octet) - if w == 0 { - return parser.setScannerTagError(directive, - start_mark, "found an incorrect leading UTF-8 octet") - } - } else { - // Check if the trailing octet is correct. - if octet&0xC0 != 0x80 { - return parser.setScannerTagError(directive, - start_mark, "found an incorrect trailing UTF-8 octet") - } - } - - // Copy the octet and move the pointers. - *s = append(*s, octet) - parser.skip() - parser.skip() - parser.skip() - w-- - } return nil } -// Scan a block scalar. -func (parser *Parser) scanBlockScalar(token *Token, literal bool) error { - // Eat the indicator '|' or '>'. - start_mark := parser.mark - parser.skip() - - // Scan the additional block scalar indicators. +// Scan the directive name. +// +// Scope: +// +// %YAML 1.1 # a comment \n +// ^^^^ +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^ +func (parser *Parser) scanDirectiveName(start_mark Mark, name *[]byte) error { + // Consume the directive name. if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } - // Check for a chomping indicator. - var chomping, increment int - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - // Set the chomping method and eat the indicator. - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - parser.skip() - - // Check for an indentation indicator. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - if isDigit(parser.buffer, parser.buffer_pos) { - // Check that the indentation is greater than 0. - if parser.buffer[parser.buffer_pos] == '0' { - return formatScannerErrorContext("while scanning a block scalar", start_mark, - "found an indentation indicator equal to 0", parser.mark) - } - - // Get the indentation level and eat the indicator. - increment = asDigit(parser.buffer, parser.buffer_pos) - parser.skip() - } - - } else if isDigit(parser.buffer, parser.buffer_pos) { - // Do the same as above, but in the opposite order. - - if parser.buffer[parser.buffer_pos] == '0' { - return formatScannerErrorContext("while scanning a block scalar", start_mark, - "found an indentation indicator equal to 0", parser.mark) - } - increment = asDigit(parser.buffer, parser.buffer_pos) - parser.skip() - + var s []byte + for isAlpha(parser.buffer, parser.buffer_pos) { + s = parser.read(s) if parser.unread < 1 { if err := parser.updateBuffer(1); err != nil { return err } } - if parser.buffer[parser.buffer_pos] == '+' || parser.buffer[parser.buffer_pos] == '-' { - if parser.buffer[parser.buffer_pos] == '+' { - chomping = +1 - } else { - chomping = -1 - } - parser.skip() - } } - // Eat whitespaces and comments to the end of the line. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - for isBlank(parser.buffer, parser.buffer_pos) { - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - } - if parser.buffer[parser.buffer_pos] == '#' { - if err := parser.scanLineComment(start_mark); err != nil { - return err - } - for !isBreakOrZero(parser.buffer, parser.buffer_pos) { - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - } + // Check if the name is empty. + if len(s) == 0 { + return formatScannerErrorContext("while scanning a directive", start_mark, + "could not find expected directive name", parser.mark) } - // Check if we are at the end of the line. - if !isBreakOrZero(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a block scalar", start_mark, - "did not find expected comment or line break", parser.mark) + // Check for an blank character after the name. + if !isBlankOrZero(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a directive", start_mark, + "found unexpected non-alphabetical character", parser.mark) } + *name = s + return nil +} - // Eat a line break. - if isLineBreak(parser.buffer, parser.buffer_pos) { - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { +// Scan the value of VERSION-DIRECTIVE. +// +// Scope: +// +// %YAML 1.1 # a comment \n +// ^^^^^^ +func (parser *Parser) scanFlowScalar(token *Token, single bool) error { + // Eat the left quote. + start_mark := parser.mark + parser.skip() + + // Consume the content of the quoted scalar. + var s, leading_break, trailing_breaks, whitespaces []byte + for { + // Check that there are no document indicators at the beginning + // of the line. + if parser.unread < 4 { + if err := parser.updateBuffer(4); err != nil { return err } } - parser.skipLine() - } - - end_mark := parser.mark - // Set the indentation level if it was specified. - var indent int - if increment > 0 { - if parser.indent >= 0 { - indent = parser.indent + increment - } else { - indent = increment + if parser.mark.Column == 1 && + ((parser.buffer[parser.buffer_pos+0] == '-' && + parser.buffer[parser.buffer_pos+1] == '-' && + parser.buffer[parser.buffer_pos+2] == '-') || + (parser.buffer[parser.buffer_pos+0] == '.' && + parser.buffer[parser.buffer_pos+1] == '.' && + parser.buffer[parser.buffer_pos+2] == '.')) && + isBlankOrZero(parser.buffer, parser.buffer_pos+3) { + return formatScannerErrorContext("while scanning a quoted scalar", start_mark, + "found unexpected document indicator", parser.mark) } - } - - // Scan the leading line breaks and determine the indentation level if needed. - var s, leading_break, trailing_breaks []byte - if err := parser.scanBlockScalarBreaks(&indent, &trailing_breaks, start_mark, &end_mark); err != nil { - return err - } - // Scan the block scalar content. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err + // Check for EOF. + if isZeroChar(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a quoted scalar", start_mark, + "found unexpected end of stream", parser.mark) } - } - var leading_blank, trailing_blank bool - for parser.mark.Column == indent && !isZeroChar(parser.buffer, parser.buffer_pos) { - // We are at the beginning of a non-empty line. - // Is it a trailing whitespace? - trailing_blank = isBlank(parser.buffer, parser.buffer_pos) - - // Check if we need to fold the leading line break. - if !literal && !leading_blank && !trailing_blank && len(leading_break) > 0 && leading_break[0] == '\n' { - // Do we need to join the lines by space? - if len(trailing_breaks) == 0 { - s = append(s, ' ') - } - } else { - s = append(s, leading_break...) - } - leading_break = leading_break[:0] - - // Append the remaining line breaks. - s = append(s, trailing_breaks...) - trailing_breaks = trailing_breaks[:0] - - // Is it a leading whitespace? - leading_blank = isBlank(parser.buffer, parser.buffer_pos) - - // Consume the current line. - for !isBreakOrZero(parser.buffer, parser.buffer_pos) { - s = parser.read(s) - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - } - - // Consume the line break. - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { - return err - } - } - - leading_break = parser.readLine(leading_break) - - // Eat the following indentation spaces and line breaks. - if err := parser.scanBlockScalarBreaks(&indent, &trailing_breaks, start_mark, &end_mark); err != nil { - return err - } - } - - // Chomp the tail. - if chomping != -1 { - s = append(s, leading_break...) - } - if chomping == 1 { - s = append(s, trailing_breaks...) - } - - // Create a token. - *token = Token{ - Type: SCALAR_TOKEN, - StartMark: start_mark, - EndMark: end_mark, - Value: s, - Style: LITERAL_SCALAR_STYLE, - } - if !literal { - token.Style = FOLDED_SCALAR_STYLE - } - return nil -} - -// Scan indentation spaces and line breaks for a block scalar. Determine the -// indentation level if needed. -func (parser *Parser) scanBlockScalarBreaks(indent *int, breaks *[]byte, start_mark Mark, end_mark *Mark) error { - *end_mark = parser.mark - - // Eat the indentation spaces and line breaks. - max_indent := 0 - for { - // Eat the indentation spaces. - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - for (*indent == 0 || parser.mark.Column < *indent) && isSpace(parser.buffer, parser.buffer_pos) { - parser.skip() - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - } - if parser.mark.Column > max_indent { - max_indent = parser.mark.Column - } - - // Check for a tab character messing the indentation. - if (*indent == 0 || parser.mark.Column < *indent) && isTab(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a block scalar", start_mark, - "found a tab character where an indentation space is expected", parser.mark) - } - - // Have we found a non-empty line? - if !isLineBreak(parser.buffer, parser.buffer_pos) { - break - } - - // Consume the line break. - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { - return err - } - } - // [Go] Should really be returning breaks instead. - *breaks = parser.readLine(*breaks) - *end_mark = parser.mark - } - - // Determine the indentation level if needed. - if *indent == 0 { - *indent = max_indent - if *indent < parser.indent+1 { - *indent = parser.indent + 1 - } - if *indent < 1 { - *indent = 1 - } - } - return nil -} - -// Scan a quoted scalar. -func (parser *Parser) scanFlowScalar(token *Token, single bool) error { - // Eat the left quote. - start_mark := parser.mark - parser.skip() - - // Consume the content of the quoted scalar. - var s, leading_break, trailing_breaks, whitespaces []byte - for { - // Check that there are no document indicators at the beginning of the line. - if parser.unread < 4 { - if err := parser.updateBuffer(4); err != nil { - return err - } - } - - if parser.mark.Column == 0 && - ((parser.buffer[parser.buffer_pos+0] == '-' && - parser.buffer[parser.buffer_pos+1] == '-' && - parser.buffer[parser.buffer_pos+2] == '-') || - (parser.buffer[parser.buffer_pos+0] == '.' && - parser.buffer[parser.buffer_pos+1] == '.' && - parser.buffer[parser.buffer_pos+2] == '.')) && - isBlankOrZero(parser.buffer, parser.buffer_pos+3) { - return formatScannerErrorContext("while scanning a quoted scalar", start_mark, - "found unexpected document indicator", parser.mark) - } - - // Check for EOF. - if isZeroChar(parser.buffer, parser.buffer_pos) { - return formatScannerErrorContext("while scanning a quoted scalar", start_mark, - "found unexpected end of stream", parser.mark) - } - - // Consume non-blank characters. - leading_blanks := false - for !isBlankOrZero(parser.buffer, parser.buffer_pos) { - if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' { - // Is is an escaped single quote. - s = append(s, '\'') - parser.skip() - parser.skip() + // Consume non-blank characters. + leading_blanks := false + for !isBlankOrZero(parser.buffer, parser.buffer_pos) { + if single && parser.buffer[parser.buffer_pos] == '\'' && parser.buffer[parser.buffer_pos+1] == '\'' { + // Is is an escaped single quote. + s = append(s, '\'') + parser.skip() + parser.skip() } else if single && parser.buffer[parser.buffer_pos] == '\'' { // It is a right single quote. @@ -2755,6 +2383,67 @@ func (parser *Parser) scanFlowScalar(token *Token, single bool) error { } // Scan a plain scalar. +func (parser *Parser) scanLineComment(token_mark Mark) error { + if parser.newlines > 0 { + return nil + } + + var start_mark Mark + var text []byte + + for peek := 0; peek < 512; peek++ { + if parser.unread < peek+1 { + if parser.updateBuffer(peek+1) != nil { + break + } + } + if isBlank(parser.buffer, parser.buffer_pos+peek) { + continue + } + if parser.buffer[parser.buffer_pos+peek] == '#' { + seen := parser.mark.Index + peek + for { + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + if isBreakOrZero(parser.buffer, parser.buffer_pos) { + if parser.mark.Index >= seen { + break + } + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { + return err + } + } + parser.skipLine() + } else if parser.mark.Index >= seen { + if len(text) == 0 { + start_mark = parser.mark + } + text = parser.read(text) + } else { + parser.skip() + } + } + } + break + } + if len(text) > 0 { + parser.comments = append(parser.comments, Comment{ + ScanMark: token_mark, + TokenMark: token_mark, + StartMark: start_mark, + EndMark: parser.mark, + Line: text, + }) + } + return nil +} + +// scanComments scans and associates comments with tokens, handling head, line, +// and foot comments based on their position relative to tokens. func (parser *Parser) scanPlainScalar(token *Token) error { var s, leading_break, trailing_breaks, whitespaces []byte var leading_blanks bool @@ -2771,7 +2460,7 @@ func (parser *Parser) scanPlainScalar(token *Token) error { return err } } - if parser.mark.Column == 0 && + if parser.mark.Column == 1 && ((parser.buffer[parser.buffer_pos+0] == '-' && parser.buffer[parser.buffer_pos+1] == '-' && parser.buffer[parser.buffer_pos+2] == '-') || @@ -2791,13 +2480,9 @@ func (parser *Parser) scanPlainScalar(token *Token) error { for !isBlankOrZero(parser.buffer, parser.buffer_pos) { // Check for indicators that may end a plain scalar. + // Check for ": " or isEndOfScalarInFlowContentChar in flow context. if (parser.buffer[parser.buffer_pos] == ':' && isBlankOrZero(parser.buffer, parser.buffer_pos+1)) || - (parser.flow_level > 0 && - (parser.buffer[parser.buffer_pos] == ',' || - (parser.buffer[parser.buffer_pos] == '?' && isBlankOrZero(parser.buffer, parser.buffer_pos+1)) || - parser.buffer[parser.buffer_pos] == '[' || - parser.buffer[parser.buffer_pos] == ']' || parser.buffer[parser.buffer_pos] == '{' || - parser.buffer[parser.buffer_pos] == '}')) { + (parser.flow_level > 0 && isEndOfScalarInFlowContentChar(parser.buffer, parser.buffer_pos)) { break } @@ -2907,222 +2592,839 @@ func (parser *Parser) scanPlainScalar(token *Token) error { return nil } -func (parser *Parser) scanLineComment(token_mark Mark) error { - if parser.newlines > 0 { - return nil +// scanLineComment scans a comment on the same line as a token. +func (parser *Parser) scanTag(token *Token) error { + var handle, suffix []byte + + start_mark := parser.mark + + // Check if the tag is in the canonical form. + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { + return err + } } - var start_mark Mark - var text []byte + if parser.buffer[parser.buffer_pos+1] == '<' { + // Keep the handle as '' - for peek := 0; peek < 512; peek++ { - if parser.unread < peek+1 { - if parser.updateBuffer(peek+1) != nil { - break - } + // Eat '!<' + parser.skip() + parser.skip() + + // Consume the tag value (verbatim tag - flow indicators allowed). + if err := parser.scanTagURI(false, true, nil, start_mark, &suffix); err != nil { + return err } - if isBlank(parser.buffer, parser.buffer_pos+peek) { - continue + + // Check for '>' and eat it. + if parser.buffer[parser.buffer_pos] != '>' { + return formatScannerErrorContext("while scanning a tag", start_mark, + "did not find the expected '>'", parser.mark) } - if parser.buffer[parser.buffer_pos+peek] == '#' { - seen := parser.mark.Index + peek - for { - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - if isBreakOrZero(parser.buffer, parser.buffer_pos) { - if parser.mark.Index >= seen { - break - } - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { - return err - } - } - parser.skipLine() - } else if parser.mark.Index >= seen { - if len(text) == 0 { - start_mark = parser.mark - } - text = parser.read(text) - } else { - parser.skip() - } - } + + parser.skip() + } else { + // The tag has either the '!suffix' or the '!handle!suffix' form. + + // First, try to scan a handle. + if err := parser.scanTagHandle(false, start_mark, &handle); err != nil { + return err } - break - } - if len(text) > 0 { - parser.comments = append(parser.comments, Comment{ - ScanMark: token_mark, - TokenMark: token_mark, - StartMark: start_mark, - EndMark: parser.mark, - Line: text, - }) - } - return nil -} -func (parser *Parser) scanComments(scan_mark Mark) error { - token := parser.tokens[len(parser.tokens)-1] + // Check if it is, indeed, handle. + if handle[0] == '!' && len(handle) > 1 && handle[len(handle)-1] == '!' { + // Scan the suffix now (short form - flow indicators + // not allowed). + if err := parser.scanTagURI(false, false, nil, start_mark, &suffix); err != nil { + return err + } + } else { + // It wasn't a handle after all. Scan the rest of the + // tag (short form). + if err := parser.scanTagURI(false, false, handle, start_mark, &suffix); err != nil { + return err + } - if token.Type == FLOW_ENTRY_TOKEN && len(parser.tokens) > 1 { - token = parser.tokens[len(parser.tokens)-2] + // Set the handle to '!'. + handle = []byte{'!'} + + // A special case: the '!' tag. Set the handle to '' + // and the suffix to '!'. + if len(suffix) == 0 { + handle, suffix = suffix, handle + } + } } - token_mark := token.StartMark - var start_mark Mark - next_indent := parser.indent - if next_indent < 0 { - next_indent = 0 + // Check the character which ends the tag. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + if !isBlankOrZero(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a tag", start_mark, + "did not find expected whitespace or line break", parser.mark) } - recent_empty := false - first_empty := parser.newlines <= 1 + end_mark := parser.mark - line := parser.mark.Line - column := parser.mark.Column + // Create a token. + *token = Token{ + Type: TAG_TOKEN, + StartMark: start_mark, + EndMark: end_mark, + Value: handle, + suffix: suffix, + } + return nil +} - var text []byte +// Scan a tag handle. +func (parser *Parser) scanTagDirectiveValue(start_mark Mark, handle, prefix *[]byte) error { + var handle_value, prefix_value []byte - // The foot line is the place where a comment must start to - // still be considered as a foot of the prior content. - // If there's some content in the currently parsed line, then - // the foot is the line below it. - foot_line := -1 - if scan_mark.Line > 0 { - foot_line = parser.mark.Line - parser.newlines + 1 - if parser.newlines == 0 && parser.mark.Column > 1 { - foot_line++ + // Eat whitespaces. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err } } - peek := 0 - for ; peek < 512; peek++ { - if parser.unread < peek+1 { - if parser.updateBuffer(peek+1) != nil { - break - } - } - column++ - if isBlank(parser.buffer, parser.buffer_pos+peek) { - continue - } - c := parser.buffer[parser.buffer_pos+peek] - close_flow := parser.flow_level > 0 && (c == ']' || c == '}') - if close_flow || isBreakOrZero(parser.buffer, parser.buffer_pos+peek) { - // Got line break or terminator. - if close_flow || !recent_empty { - if close_flow || first_empty && (start_mark.Line == foot_line && token.Type != VALUE_TOKEN || start_mark.Column-1 < next_indent) { - // This is the first empty line and there were no empty lines before, - // so this initial part of the comment is a foot of the prior token - // instead of being a head for the following one. Split it up. - // Alternatively, this might also be the last comment inside a flow - // scope, so it must be a footer. - if len(text) > 0 { - if start_mark.Column-1 < next_indent { - // If dedented it's unrelated to the prior token. - token_mark = start_mark - } - parser.comments = append(parser.comments, Comment{ - ScanMark: scan_mark, - TokenMark: token_mark, - StartMark: start_mark, - EndMark: Mark{parser.mark.Index + peek, line, column}, - Foot: text, - }) - scan_mark = Mark{parser.mark.Index + peek, line, column} - token_mark = scan_mark - text = nil - } - } else { - if len(text) > 0 && parser.buffer[parser.buffer_pos+peek] != 0 { - text = append(text, '\n') - } - } - } - if !isLineBreak(parser.buffer, parser.buffer_pos+peek) { - break + for isBlank(parser.buffer, parser.buffer_pos) { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err } - first_empty = false - recent_empty = true - column = 0 - line++ - continue - } - - if len(text) > 0 && (close_flow || column-1 < next_indent && column != start_mark.Column) { - // The comment at the different indentation is a foot of the - // preceding data rather than a head of the upcoming one. - parser.comments = append(parser.comments, Comment{ - ScanMark: scan_mark, - TokenMark: token_mark, - StartMark: start_mark, - EndMark: Mark{parser.mark.Index + peek, line, column}, - Foot: text, - }) - scan_mark = Mark{parser.mark.Index + peek, line, column} - token_mark = scan_mark - text = nil } + } - if parser.buffer[parser.buffer_pos+peek] != '#' { - break - } + // Scan a handle. + if err := parser.scanTagHandle(true, start_mark, &handle_value); err != nil { + return err + } - if len(text) == 0 { - start_mark = Mark{parser.mark.Index + peek, line, column} - } else { - text = append(text, '\n') + // Expect a whitespace. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err } + } + if !isBlank(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a %TAG directive", start_mark, + "did not find expected whitespace", parser.mark) + } - recent_empty = false - - // Consume until after the consumed comment line. - seen := parser.mark.Index + peek - for { - if parser.unread < 1 { - if err := parser.updateBuffer(1); err != nil { - return err - } - } - if isBreakOrZero(parser.buffer, parser.buffer_pos) { - if parser.mark.Index >= seen { - break - } - if parser.unread < 2 { - if err := parser.updateBuffer(2); err != nil { - return err - } - } - parser.skipLine() - } else if parser.mark.Index >= seen { - text = parser.read(text) - } else { - parser.skip() + // Eat whitespaces. + for isBlank(parser.buffer, parser.buffer_pos) { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err } } + } - peek = 0 - column = 0 - line = parser.mark.Line - next_indent = parser.indent - if next_indent < 0 { - next_indent = 0 - } + // Scan a prefix (TAG directive URI - flow indicators allowed). + if err := parser.scanTagURI(true, true, nil, start_mark, &prefix_value); err != nil { + return err } - if len(text) > 0 { - parser.comments = append(parser.comments, Comment{ - ScanMark: scan_mark, - TokenMark: start_mark, - StartMark: start_mark, - EndMark: Mark{parser.mark.Index + peek - 1, line, column}, - Head: text, - }) + // Expect a whitespace or line break. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + if !isBlankOrZero(parser.buffer, parser.buffer_pos) { + return formatScannerErrorContext("while scanning a %TAG directive", start_mark, + "did not find expected whitespace or line break", parser.mark) + } + + *handle = handle_value + *prefix = prefix_value + return nil +} + +// scanAnchor scans an ANCHOR or ALIAS token. +func (parser *Parser) scanTagHandle(directive bool, start_mark Mark, handle *[]byte) error { + // Check the initial '!' character. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + if parser.buffer[parser.buffer_pos] != '!' { + return parser.setScannerTagError(directive, + start_mark, "did not find expected '!'") + } + + var s []byte + + // Copy the '!' character. + s = parser.read(s) + + // Copy all subsequent alphabetical and numerical characters. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + for isAlpha(parser.buffer, parser.buffer_pos) { + s = parser.read(s) + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + } + + // Check if the trailing character is '!' and copy it. + if parser.buffer[parser.buffer_pos] == '!' { + s = parser.read(s) + } else { + // It's either the '!' tag or not really a tag handle. + // If it's a %TAG directive, it's an error. + // If it's a tag token, it must be a part of URI. + if directive && string(s) != "!" { + return parser.setScannerTagError(directive, + start_mark, "did not find expected '!'") + } + } + + *handle = s + return nil +} + +// Scan a tag URI. +// directive: true if scanning a %TAG directive URI +// verbatim: true if scanning a verbatim tag !<...> or TAG directive (flow indicators allowed) +func (parser *Parser) scanTagURI(directive bool, verbatim bool, head []byte, start_mark Mark, uri *[]byte) error { + // size_t length = head ? strlen((char *)head) : 0 + var s []byte + hasTag := len(head) > 0 + + // Copy the head if needed. + // + // Note that we don't copy the leading '!' character. + if len(head) > 1 { + s = append(s, head[1:]...) + } + + // Scan the tag. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + + // The set of characters that may appear in URI is as follows: + // + // '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', + // '&', '=', '+', '$', '.', '!', '~', '*', '\'', '(', ')', '%'. + // + // Note: Flow indicators (',', '[', ']', '{', '}') are only allowed in + // verbatim tags. + for isTagURIChar(parser.buffer, parser.buffer_pos, verbatim) { + // Check if it is a URI-escape sequence. + if parser.buffer[parser.buffer_pos] == '%' { + if err := parser.scanURIEscapes(directive, start_mark, &s); err != nil { + return err + } + } else { + s = parser.read(s) + } + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + hasTag = true + } + + // Check for characters which are not allowed in tags. + // For non-verbatim tags, if we stopped at a printable character that + // isn't whitespace, it's an invalid tag character - give a specific + // error. + // For verbatim tags, the caller will check for the expected '>' + // delimiter. + if !verbatim { + c := parser.buffer[parser.buffer_pos] + if !isBlankOrZero(parser.buffer, parser.buffer_pos) && + c >= 0x20 && c <= 0x7E { + return parser.setScannerTagError(directive, start_mark, + fmt.Sprintf("found character '%c' that is not allowed in a YAML tag", c)) + } + } + + if !hasTag { + return parser.setScannerTagError(directive, + start_mark, "did not find expected tag URI") + } + *uri = s + return nil +} + +// Decode an URI-escape sequence corresponding to a single UTF-8 character. +func (parser *Parser) scanToNextToken() error { + scan_mark := parser.mark + + // Until the next token is not found. + for { + // Allow the BOM mark to start a line. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + if parser.mark.Column == 1 && isBOM(parser.buffer, parser.buffer_pos) { + parser.skip() + } + + // Eat whitespaces. + // Tabs are allowed: + // - in the flow context + // - in the block context, but not at the beginning of the line or + // after '-', '?', or ':' (complex value). + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + + for parser.buffer[parser.buffer_pos] == ' ' || ((parser.flow_level > 0 || !parser.simple_key_allowed) && parser.buffer[parser.buffer_pos] == '\t') { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + } + + // Check if we just had a line comment under a sequence entry that + // looks more like a header to the following content. Similar to this: + // + // - # The comment + // - Some data + // + // If so, transform the line comment to a head comment and reposition. + if len(parser.comments) > 0 && len(parser.tokens) > 1 { + tokenA := parser.tokens[len(parser.tokens)-2] + tokenB := parser.tokens[len(parser.tokens)-1] + comment := &parser.comments[len(parser.comments)-1] + if tokenA.Type == BLOCK_SEQUENCE_START_TOKEN && tokenB.Type == BLOCK_ENTRY_TOKEN && len(comment.Line) > 0 && !isLineBreak(parser.buffer, parser.buffer_pos) { + // If it was in the prior line, reposition so it becomes a + // header of the follow up token. Otherwise, keep it in place + // so it becomes a header of the former. + comment.Head = comment.Line + comment.Line = nil + if comment.StartMark.Line == parser.mark.Line-1 { + comment.TokenMark = parser.mark + } + } + } + + // Eat a comment until a line break. + if parser.buffer[parser.buffer_pos] == '#' { + if parser.skip_comments { + // Skip comment without storing it + for !isLineBreak(parser.buffer, parser.buffer_pos) && !isZeroChar(parser.buffer, parser.buffer_pos) { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + } + } else { + if err := parser.scanComments(scan_mark); err != nil { + return err + } + } + } + + // If it is a line break, eat it. + if isLineBreak(parser.buffer, parser.buffer_pos) { + if parser.unread < 2 { + if err := parser.updateBuffer(2); err != nil { + return err + } + } + parser.skipLine() + + // In the block context, a new line may start a simple key. + if parser.flow_level == 0 { + parser.simple_key_allowed = true + } + } else { + break // We have found a token. + } + } + + return nil +} + +// Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. +// +// Scope: +// +// %YAML 1.1 # a comment \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +func (parser *Parser) scanURIEscapes(directive bool, start_mark Mark, s *[]byte) error { + // Decode the required number of characters. + w := 1024 + for w > 0 { + // Check for a URI-escaped octet. + if parser.unread < 3 { + if err := parser.updateBuffer(3); err != nil { + return err + } + } + + if !(parser.buffer[parser.buffer_pos] == '%' && + isHex(parser.buffer, parser.buffer_pos+1) && + isHex(parser.buffer, parser.buffer_pos+2)) { + return parser.setScannerTagError(directive, + start_mark, "did not find URI escaped octet") + } + + // Get the octet. + octet := byte((asHex(parser.buffer, parser.buffer_pos+1) << 4) + asHex(parser.buffer, parser.buffer_pos+2)) + + // If it is the leading octet, determine the length of the + // UTF-8 sequence. + if w == 1024 { + w = width(octet) + if w == 0 { + return parser.setScannerTagError(directive, + start_mark, "found an incorrect leading UTF-8 octet") + } + } else { + // Check if the trailing octet is correct. + if octet&0xC0 != 0x80 { + return parser.setScannerTagError(directive, + start_mark, "found an incorrect trailing UTF-8 octet") + } + } + + // Copy the octet and move the pointers. + *s = append(*s, octet) + parser.skip() + parser.skip() + parser.skip() + w-- + } + return nil +} + +// Scan a block scalar. +func (parser *Parser) scanVersionDirectiveNumber(start_mark Mark, number *int8) error { + // Repeat while the next character is digit. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + var value, length int8 + for isDigit(parser.buffer, parser.buffer_pos) { + // Check if the number is too long. + length++ + if length > max_number_length { + return formatScannerErrorContext("while scanning a %YAML directive", start_mark, + "found extremely long version number", parser.mark) + } + value = value*10 + int8(asDigit(parser.buffer, parser.buffer_pos)) + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + } + + // Check if the number was present. + if length == 0 { + return formatScannerErrorContext("while scanning a %YAML directive", start_mark, + "did not find expected version number", parser.mark) + } + *number = value + return nil +} + +// Scan the value of a TAG-DIRECTIVE token. +// +// Scope: +// +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +func (parser *Parser) scanVersionDirectiveValue(start_mark Mark, major, minor *int8) error { + // Eat whitespaces. + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + for isBlank(parser.buffer, parser.buffer_pos) { + parser.skip() + if parser.unread < 1 { + if err := parser.updateBuffer(1); err != nil { + return err + } + } + } + + // Consume the major version number. + if err := parser.scanVersionDirectiveNumber(start_mark, major); err != nil { + return err + } + + // Eat '.'. + if parser.buffer[parser.buffer_pos] != '.' { + return formatScannerErrorContext("while scanning a %YAML directive", start_mark, + "did not find expected digit or '.' character", parser.mark) + } + + parser.skip() + + // Consume the minor version number. + if err := parser.scanVersionDirectiveNumber(start_mark, minor); err != nil { + return err + } + return nil +} + +// max_number_length limits the length of version number components in +// %YAML directives. +func (parser *Parser) saveSimpleKey() error { + // A simple key is required at the current position if the scanner is in + // the block context and the current column coincides with the indentation + // level. + + required := parser.flow_level == 0 && parser.indent == parser.mark.Column + + // + // If the current position may start a simple key, save it. + // + if parser.simple_key_allowed { + if err := parser.removeSimpleKey(); err != nil { + return err + } + + parser.simple_key_possible = true + parser.simple_key = SimpleKey{ + required: required, + flow_level: parser.flow_level, + token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head), + mark: parser.mark, + } + } + return nil +} + +// Remove a potential simple key at the current flow level. +func (parser *Parser) removeSimpleKey() error { + // If the key is required, it is an error. + if parser.simple_key.required { + return formatScannerErrorContext( + "while scanning a simple key", parser.simple_key.mark, + "could not find expected ':'", parser.mark) + } + + parser.simple_key_possible = false // disable the key + return nil +} + +func (parser *Parser) isFlowSequence() bool { + if len(parser.tokens) == 0 { + return false + } + previousToken := parser.tokens[len(parser.tokens)-1] + return previousToken.Type == FLOW_ENTRY_TOKEN || previousToken.Type == FLOW_SEQUENCE_START_TOKEN +} + +// Check if a simple key may start at the current position and add it if +// needed. +func (parser *Parser) increaseFlowLevel() error { + // Increase the flow level. + parser.flow_level++ + if err := parser.depthCheck(parser.flow_level, &DepthContext{Kind: DepthKindFlow}); err != nil { + return formatScannerErrorContext( + "while increasing flow level", parser.simple_key.mark, + err.Error(), parser.mark) + } + + // If a simple key was possible, push it to the stack before resetting the key. + if parser.simple_key_possible { + parser.simple_key_stack = append(parser.simple_key_stack, parser.simple_key) + } + + // Reset the simple key for the new flow level. + parser.simple_key = SimpleKey{} + + return nil +} + +// Decrease the flow level. +func (parser *Parser) decreaseFlowLevel() error { + if parser.flow_level > 0 { + parser.flow_level-- + + if len(parser.simple_key_stack) == 0 { + return nil + } + + last := len(parser.simple_key_stack) - 1 + if parser.simple_key_stack[last].flow_level == parser.flow_level { + parser.simple_key = parser.simple_key_stack[last] // use last item + parser.simple_key_stack = parser.simple_key_stack[:last] // remove last item + parser.simple_key_possible = true // enable the key + } + } + return nil +} + +func (parser *Parser) rollIndent(column, number int, typ TokenType, mark Mark) error { + // In the flow context, do nothing. + if parser.flow_level > 0 { + return nil + } + + if parser.indent < column { + // Push the current indentation level to the stack and set the new + // indentation level. + parser.indents = append(parser.indents, parser.indent) + parser.indent = column + if err := parser.depthCheck(len(parser.indents), &DepthContext{Kind: DepthKindBlock}); err != nil { + return formatScannerErrorContext( + "while increasing indent level", parser.simple_key.mark, + err.Error(), parser.mark) + } + + // Create a token and insert it into the queue. + token := Token{ + Type: typ, + StartMark: mark, + EndMark: mark, + } + if number > -1 { + number -= parser.tokens_parsed + } + parser.insertToken(number, &token) + } + return nil +} + +// Pop indentation levels from the indents stack until the current level +// becomes less or equal to the column. For each indentation level, append +// the BLOCK-END token. +func (parser *Parser) unrollIndent(column int, scan_mark Mark) error { + // In the flow context, do nothing. + if parser.flow_level > 0 { + return nil + } + + block_mark := scan_mark + block_mark.Index-- + + // Loop through the indentation levels in the stack. + for parser.indent > column { + + // [Go] Reposition the end token before potential following + // foot comments of parent blocks. For that, search + // backwards for recent comments that were at the same + // indent as the block that is ending now. + stop_index := block_mark.Index + for i := len(parser.comments) - 1; i >= 0; i-- { + comment := &parser.comments[i] + + if comment.EndMark.Index < stop_index { + // Don't go back beyond the start of the + // comment/whitespace scan, unless column < 0. + // If requested indent column is < 0, then the + // document is over and everything else is a + // foot anyway. + break + } + if comment.StartMark.Column == parser.indent+1 { + // This is a good match. + // But maybe there's a former comment at that + // same indent level, so keep searching. + block_mark = comment.StartMark + } + + // While the end of the former comment matches with + // the start of the following one, we know there's + // nothing in between and scanning is still safe. + stop_index = comment.ScanMark.Index + } + + // Create a token and append it to the queue. + token := Token{ + Type: BLOCK_END_TOKEN, + StartMark: block_mark, + EndMark: block_mark, + } + parser.insertToken(-1, &token) + + // Pop the indentation level. + parser.indent = parser.indents[len(parser.indents)-1] + parser.indents = parser.indents[:len(parser.indents)-1] } return nil } + +// insertToken inserts a token into the queue at the specified position. +func (parser *Parser) insertToken(pos int, token *Token) { + // fmt.Println("yaml_insert_token", "pos:", pos, "typ:", token.typ, "head:", parser.tokens_head, "len:", len(parser.tokens)) + + // Check if we can move the queue at the beginning of the buffer. + if parser.tokens_head > 0 && len(parser.tokens) == cap(parser.tokens) { + if parser.tokens_head != len(parser.tokens) { + copy(parser.tokens, parser.tokens[parser.tokens_head:]) + } + parser.tokens = parser.tokens[:len(parser.tokens)-parser.tokens_head] + parser.tokens_head = 0 + } + parser.tokens = append(parser.tokens, *token) + if pos < 0 { + return + } + copy(parser.tokens[parser.tokens_head+pos+1:], parser.tokens[parser.tokens_head+pos:]) + parser.tokens[parser.tokens_head+pos] = *token +} + +// Initialize the scanner and produce the STREAM-START token. +func (parser *Parser) skip() { + if !isBlank(parser.buffer, parser.buffer_pos) { + parser.newlines = 0 + } + parser.mark.Index++ + parser.mark.Column++ + parser.unread-- + parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) +} + +// skipLine advances the parser position past the current line break. +func (parser *Parser) skipLine() { + if isCRLF(parser.buffer, parser.buffer_pos) { + parser.mark.Index += 2 + parser.mark.Column = 1 + parser.mark.Line++ + parser.unread -= 2 + parser.buffer_pos += 2 + parser.newlines++ + } else if isLineBreak(parser.buffer, parser.buffer_pos) { + parser.mark.Index++ + parser.mark.Column = 1 + parser.mark.Line++ + parser.unread-- + parser.buffer_pos += width(parser.buffer[parser.buffer_pos]) + parser.newlines++ + } +} + +// Copy a character to a string buffer and advance pointers. +func (parser *Parser) read(s []byte) []byte { + if !isBlank(parser.buffer, parser.buffer_pos) { + parser.newlines = 0 + } + w := width(parser.buffer[parser.buffer_pos]) + if w == 0 { + panic("invalid character sequence") + } + if len(s) == 0 { + s = make([]byte, 0, 32) + } + if w == 1 && len(s)+w <= cap(s) { + s = s[:len(s)+1] + s[len(s)-1] = parser.buffer[parser.buffer_pos] + parser.buffer_pos++ + } else { + s = append(s, parser.buffer[parser.buffer_pos:parser.buffer_pos+w]...) + parser.buffer_pos += w + } + parser.mark.Index++ + parser.mark.Column++ + parser.unread-- + return s +} + +// Copy a line break character to a string buffer and advance pointers. +func (parser *Parser) readLine(s []byte) []byte { + buf := parser.buffer + pos := parser.buffer_pos + switch { + case buf[pos] == '\r' && buf[pos+1] == '\n': + // CR LF . LF + s = append(s, '\n') + parser.buffer_pos += 2 + parser.mark.Index++ + parser.unread-- + case buf[pos] == '\r' || buf[pos] == '\n': + // CR|LF . LF + s = append(s, '\n') + parser.buffer_pos += 1 + case buf[pos] == '\xC2' && buf[pos+1] == '\x85': + // NEL . LF + s = append(s, '\n') + parser.buffer_pos += 2 + case buf[pos] == '\xE2' && buf[pos+1] == '\x80' && (buf[pos+2] == '\xA8' || buf[pos+2] == '\xA9'): + // LS|PS . LS|PS + s = append(s, buf[parser.buffer_pos:pos+3]...) + parser.buffer_pos += 3 + default: + return s + } + parser.mark.Index++ + parser.mark.Column = 1 + parser.mark.Line++ + parser.unread-- + parser.newlines++ + return s +} + +// formatScannerError creates a LoadError for scanner-stage errors. +func formatScannerError(problem string, problemMark Mark) *LoadError { + return &LoadError{ + Stage: ScannerStage, + Mark: problemMark, + Message: problem, + } +} + +// formatScannerErrorContext creates a LoadError with both context and +// problem information, each with their own mark positions. +func formatScannerErrorContext(context string, contextMark Mark, problem string, problemMark Mark) *LoadError { + return &LoadError{ + Stage: ScannerStage, + ContextMark: contextMark, + ContextMsg: context, + Mark: problemMark, + Message: problem, + } +} + +// setScannerTagError creates a tag-related scanner error with appropriate +// context based on whether it's from a directive or tag parsing. +func (parser *Parser) setScannerTagError(directive bool, contextMark Mark, problem string) error { + context := "while parsing a tag" + if directive { + context = "while parsing a %TAG directive" + } + return formatScannerErrorContext(context, contextMark, problem, parser.mark) +} + +// trace is a debug utility that prints entry/exit messages for function calls. +func trace(args ...any) func() { + pargs := append([]any{"+++"}, args...) + fmt.Println(pargs...) + pargs = append([]any{"---"}, args...) + return func() { fmt.Println(pargs...) } +} + +// Ensure that the tokens queue contains at least one token which can be +// returned to the Parser. diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/serializer.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/serializer.go index 7ec160d..4914dce 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/serializer.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/serializer.go @@ -8,99 +8,158 @@ package libyaml import ( + "errors" + "fmt" + "io" "strings" "unicode/utf8" ) +// Serializer handles serialization of YAML nodes to event stream. +type Serializer struct { + Emitter Emitter + out []byte + lineWidth int + explicitStart bool + explicitEnd bool + flowSimpleCollections bool + quotePreference QuoteStyle + doneInit bool +} + +// NewSerializer creates a new Serializer with the given options. +func NewSerializer(w io.Writer, opts *Options) *Serializer { + emitter := NewEmitter() + emitter.CompactSequenceIndent = opts.CompactSeqIndent + emitter.quotePreference = opts.QuotePreference + emitter.SetWidth(opts.LineWidth) + emitter.SetUnicode(opts.Unicode) + emitter.SetCanonical(opts.Canonical) + emitter.SetLineBreak(opts.LineBreak) + + // Set indentation (defaults to 2 if not specified) + indent := opts.Indent + if indent == 0 { + indent = 2 + } + emitter.BestIndent = indent + + if w != nil { + emitter.SetOutputWriter(w) + } + + return &Serializer{ + Emitter: emitter, + lineWidth: opts.LineWidth, + explicitStart: opts.ExplicitStart, + explicitEnd: opts.ExplicitEnd, + flowSimpleCollections: opts.FlowSimpleCollections, + quotePreference: opts.QuotePreference, + } +} + +// Serialize walks a Node tree and emits events to produce YAML output. +// This is the primary method for the Serializer stage. +func (s *Serializer) Serialize(node *Node) { + s.init() + s.node(node, "") +} + +// Sentinel values for event creation. +// These provide clarity at call sites, similar to http.NoBody. +var ( + noVersionDirective *VersionDirective = nil + noTagDirective []TagDirective = nil +) + +// init initializes the serializer by emitting a STREAM_START event. +func (s *Serializer) init() { + if s.doneInit { + return + } + s.emit(NewStreamStartEvent(UTF8_ENCODING)) + s.doneInit = true +} + +// Finish completes serialization by emitting a STREAM_END event. +func (s *Serializer) Finish() { + s.Emitter.OpenEnded = false + s.emit(NewStreamEndEvent()) +} + // node serializes a Node tree into YAML events. -// This is the core of the serializer stage - it walks the tree and produces events. -func (r *Representer) node(node *Node, tail string) { +// This is the core of the serializer stage - it walks the tree and produces +// events. +func (s *Serializer) node(node *Node, tail string) { // Zero nodes behave as nil. if node.Kind == 0 && node.IsZero() { - r.nilv() + s.emitScalar("null", "", "", PLAIN_SCALAR_STYLE, nil, nil, nil, nil) return } - // If the tag was not explicitly requested, and dropping it won't change the - // implicit tag of the value, don't include it in the presentation. + // Tags have been processed by Desolver: + // - Empty tag = can be inferred or style handles it + // - Non-empty tag = emit explicitly + // Style has also been set by Desolver for quoting needs tag := node.Tag - stag := shortTag(tag) var forceQuoting bool - if tag != "" && node.Style&TaggedStyle == 0 { - if node.Kind == ScalarNode { - if stag == strTag && node.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0 { - tag = "" - } else { - rtag, _ := resolve("", node.Value) - if rtag == stag && stag != mergeTag { - tag = "" - } else if stag == strTag { - tag = "" - forceQuoting = true - } - } - } else { - var rtag string - switch node.Kind { - case MappingNode: - rtag = mapTag - case SequenceNode: - rtag = seqTag - } - if rtag == stag { - tag = "" - } + if tag == "" && node.Kind == ScalarNode { + // Empty tag with quoting style means the string type needs to + // be preserved + if node.Style&(SingleQuotedStyle|DoubleQuotedStyle|LiteralStyle|FoldedStyle) != 0 { + forceQuoting = true } } switch node.Kind { case DocumentNode: - event := NewDocumentStartEvent(noVersionDirective, noTagDirective, !r.explicitStart) + event := NewDocumentStartEvent(noVersionDirective, noTagDirective, !s.explicitStart) event.HeadComment = []byte(node.HeadComment) - r.emit(event) + s.emit(event) for _, node := range node.Content { - r.node(node, "") + s.node(node, "") } - event = NewDocumentEndEvent(!r.explicitEnd) + event = NewDocumentEndEvent(!s.explicitEnd) event.FootComment = []byte(node.FootComment) - r.emit(event) + s.emit(event) case SequenceNode: style := BLOCK_SEQUENCE_STYLE // Use flow style if explicitly requested or if it's a simple // collection (scalar-only contents that fit within line width, // enabled via WithFlowSimpleCollections) - if node.Style&FlowStyle != 0 || r.isSimpleCollection(node) { + if node.Style&FlowStyle != 0 || s.isSimpleCollection(node) { style = FLOW_SEQUENCE_STYLE } event := NewSequenceStartEvent([]byte(node.Anchor), []byte(longTag(tag)), tag == "", style) event.HeadComment = []byte(node.HeadComment) - r.emit(event) + s.emit(event) for _, node := range node.Content { - r.node(node, "") + s.node(node, "") } event = NewSequenceEndEvent() event.LineComment = []byte(node.LineComment) event.FootComment = []byte(node.FootComment) - r.emit(event) + s.emit(event) case MappingNode: style := BLOCK_MAPPING_STYLE // Use flow style if explicitly requested or if it's a simple // collection (scalar-only contents that fit within line width, // enabled via WithFlowSimpleCollections) - if node.Style&FlowStyle != 0 || r.isSimpleCollection(node) { + if node.Style&FlowStyle != 0 || s.isSimpleCollection(node) { style = FLOW_MAPPING_STYLE } event := NewMappingStartEvent([]byte(node.Anchor), []byte(longTag(tag)), tag == "", style) event.TailComment = []byte(tail) event.HeadComment = []byte(node.HeadComment) - r.emit(event) + s.emit(event) - // The tail logic below moves the foot comment of prior keys to the following key, - // since the value for each key may be a nested structure and the foot needs to be - // processed only the entirety of the value is streamed. The last tail is processed - // with the mapping end event. + // The tail logic below moves the foot comment of prior keys to + // the following key, since the value for each key may be a + // nested structure and the foot needs to be processed only the + // entirety of the value is streamed. The last tail is + // processed with the mapping end event. var tail string for i := 0; i+1 < len(node.Content); i += 2 { k := node.Content[i] @@ -110,34 +169,35 @@ func (r *Representer) node(node *Node, tail string) { kopy.FootComment = "" k = &kopy } - r.node(k, tail) + s.node(k, tail) tail = foot v := node.Content[i+1] - r.node(v, "") + s.node(v, "") } event = NewMappingEndEvent() event.TailComment = []byte(tail) event.LineComment = []byte(node.LineComment) event.FootComment = []byte(node.FootComment) - r.emit(event) + s.emit(event) case AliasNode: event := NewAliasEvent([]byte(node.Value)) event.HeadComment = []byte(node.HeadComment) event.LineComment = []byte(node.LineComment) event.FootComment = []byte(node.FootComment) - r.emit(event) + s.emit(event) case ScalarNode: value := node.Value if !utf8.ValidString(value) { + stag := shortTag(tag) if stag == binaryTag { - failf("explicitly tagged !!binary data must be base64-encoded") + failDumpf(SerializerStage, "explicitly tagged !!binary data must be base64-encoded") } if stag != "" { - failf("cannot marshal invalid UTF-8 data as %s", stag) + failDumpf(SerializerStage, "cannot marshal invalid UTF-8 data as %s", stag) } // It can't be represented directly as YAML so use a binary tag // and represent it as base64. @@ -158,19 +218,67 @@ func (r *Representer) node(node *Node, tail string) { case strings.Contains(value, "\n"): style = LITERAL_SCALAR_STYLE case forceQuoting: - style = r.quotePreference.ScalarStyle() + style = s.quotePreference.ScalarStyle() } - r.emitScalar(value, node.Anchor, tag, style, []byte(node.HeadComment), []byte(node.LineComment), []byte(node.FootComment), []byte(tail)) + s.emitScalar(value, node.Anchor, tag, style, []byte(node.HeadComment), []byte(node.LineComment), []byte(node.FootComment), []byte(tail)) default: - failf("cannot represent node with unknown kind %d", node.Kind) + failDumpf(SerializerStage, "cannot represent node with unknown kind %d", node.Kind) + } +} + +// emit sends an event to the underlying emitter. +func (s *Serializer) emit(event Event) { + s.must(s.Emitter.Emit(&event)) +} + +// must panics if the given error is non-nil, routing to the appropriate stage. +func (s *Serializer) must(err error) { + if err == nil { + return + } + var ee EmitterError + if errors.As(err, &ee) { + failDumpf(EmitterStage, "%s", ee.Message) + } + var we WriterError + if errors.As(err, &we) { + // Unwrap to get the original I/O error, stripping the + // "write error: " prefix that WriterError adds internally. + cause := we.Err + if unwrapped := errors.Unwrap(we.Err); unwrapped != nil { + cause = unwrapped + } + failDump(WriterStage, cause) + } + msg := err.Error() + if msg == "" { + msg = fmt.Sprintf("unknown problem generating YAML content with %T", err) + } + failDumpf(SerializerStage, "%s", msg) +} + +// emitScalar emits a scalar event with the given value, anchor, tag, style, +// and associated comments. +func (s *Serializer) emitScalar( + value, anchor, tag string, style ScalarStyle, head, line, foot, tail []byte, +) { + implicit := tag == "" + if !implicit { + tag = longTag(tag) } + event := NewScalarEvent([]byte(anchor), []byte(tag), []byte(value), implicit, implicit, style) + event.HeadComment = head + event.LineComment = line + event.FootComment = foot + event.TailComment = tail + s.emit(event) } // isSimpleCollection checks if a node contains only scalar values and would // fit within the line width when rendered in flow style. -func (r *Representer) isSimpleCollection(node *Node) bool { - if !r.flowSimpleCollections { +func (s *Serializer) isSimpleCollection(node *Node) bool { + if !s.flowSimpleCollections { return false } if node.Kind != SequenceNode && node.Kind != MappingNode { @@ -183,8 +291,8 @@ func (r *Representer) isSimpleCollection(node *Node) bool { } } // Estimate flow style length - estimatedLen := r.estimateFlowLength(node) - width := r.lineWidth + estimatedLen := s.estimateFlowLength(node) + width := s.lineWidth if width <= 0 { width = 80 // Default width if not set } @@ -192,7 +300,7 @@ func (r *Representer) isSimpleCollection(node *Node) bool { } // estimateFlowLength estimates the character length of a node in flow style. -func (r *Representer) estimateFlowLength(node *Node) int { +func (s *Serializer) estimateFlowLength(node *Node) int { if node.Kind == SequenceNode { // [item1, item2, ...] = 2 + sum(len(items)) + 2*(len-1) length := 2 // [] @@ -217,3 +325,98 @@ func (r *Representer) estimateFlowLength(node *Node) int { } return 0 } + +// NewStreamStartEvent creates a new STREAM-START event. +func NewStreamStartEvent(encoding Encoding) Event { + return Event{ + Type: STREAM_START_EVENT, + encoding: encoding, + } +} + +// NewStreamEndEvent creates a new STREAM-END event. +func NewStreamEndEvent() Event { + return Event{ + Type: STREAM_END_EVENT, + } +} + +// NewDocumentStartEvent creates a new DOCUMENT-START event. +func NewDocumentStartEvent(version_directive *VersionDirective, tag_directives []TagDirective, implicit bool) Event { + return Event{ + Type: DOCUMENT_START_EVENT, + versionDirective: version_directive, + tagDirectives: tag_directives, + Implicit: implicit, + } +} + +// NewDocumentEndEvent creates a new DOCUMENT-END event. +func NewDocumentEndEvent(implicit bool) Event { + return Event{ + Type: DOCUMENT_END_EVENT, + Implicit: implicit, + } +} + +// NewAliasEvent creates a new ALIAS event. +func NewAliasEvent(anchor []byte) Event { + return Event{ + Type: ALIAS_EVENT, + Anchor: anchor, + } +} + +// NewScalarEvent creates a new SCALAR event. +func NewScalarEvent(anchor, tag, value []byte, plain_implicit, quoted_implicit bool, style ScalarStyle) Event { + return Event{ + Type: SCALAR_EVENT, + Anchor: anchor, + Tag: tag, + Value: value, + Implicit: plain_implicit, + quoted_implicit: quoted_implicit, + Style: Style(style), + } +} + +// NewSequenceStartEvent creates a new SEQUENCE-START event. +func NewSequenceStartEvent(anchor, tag []byte, implicit bool, style SequenceStyle) Event { + return Event{ + Type: SEQUENCE_START_EVENT, + Anchor: anchor, + Tag: tag, + Implicit: implicit, + Style: Style(style), + } +} + +// NewSequenceEndEvent creates a new SEQUENCE-END event. +func NewSequenceEndEvent() Event { + return Event{ + Type: SEQUENCE_END_EVENT, + } +} + +// NewMappingStartEvent creates a new MAPPING-START event. +func NewMappingStartEvent(anchor, tag []byte, implicit bool, style MappingStyle) Event { + return Event{ + Type: MAPPING_START_EVENT, + Anchor: anchor, + Tag: tag, + Implicit: implicit, + Style: Style(style), + } +} + +// NewMappingEndEvent creates a new MAPPING-END event. +func NewMappingEndEvent() Event { + return Event{ + Type: MAPPING_END_EVENT, + } +} + +// Delete an event object. +func (e *Event) Delete() { + *e = Event{} +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/structmeta.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/structmeta.go new file mode 100644 index 0000000..70c6630 --- /dev/null +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/structmeta.go @@ -0,0 +1,250 @@ +// Copyright 2011-2019 Canonical Ltd +// Copyright 2025 The go-yaml Project Contributors +// SPDX-License-Identifier: Apache-2.0 + +// Struct metadata extraction for YAML marshaling/unmarshaling. +// +// This file analyzes Go struct types to build mappings between YAML keys and +// struct fields. It parses struct tags like `yaml:"name,omitempty,flow,inline"` +// and caches the results for efficient repeated access. +// +// Used by: +// - Constructor: maps YAML keys to struct fields when unmarshaling +// - Representer: maps struct fields to YAML keys when marshaling +// +// Key types: +// - structInfo: cached metadata about a struct type +// - fieldInfo: metadata about a single struct field +// - getStructInfo(): analyzes a struct type and returns cached metadata + +package libyaml + +import ( + "errors" + "fmt" + "reflect" + "strings" + "sync" +) + +// structInfo holds cached information about a struct's YAML-relevant fields. +type structInfo struct { + FieldsMap map[string]fieldInfo + FieldsList []fieldInfo + + // InlineMap is the number of the field in the struct that + // contains an ,inline map, or -1 if there's none. + InlineMap int + + // InlineConstructors holds indexes to inlined fields that + // contain constructor values. + InlineConstructors [][]int +} + +// fieldInfo holds information about a single struct field. +type fieldInfo struct { + Key string + Num int + OmitEmpty bool + Flow bool + // Id holds the unique field identifier, so we can cheaply + // check for field duplicates without maintaining an extra map. + Id int + + // Inline holds the field index if the field is part of an inlined struct. + Inline []int +} + +// structMap caches struct reflection information. +// fieldMapMutex protects access to structMap. +// constructorType holds the [reflect.Type] for the constructor interface. +var ( + structMap = make(map[reflect.Type]*structInfo) + fieldMapMutex sync.RWMutex + constructorType reflect.Type +) + +// constructor interface is defined here to detect types that implement +// UnmarshalYAML during struct reflection. +type constructor interface { + UnmarshalYAML(value *Node) error +} + +// init initializes the constructorType variable with the [reflect.Type] of constructor interface. +func init() { + var v constructor + constructorType = reflect.ValueOf(&v).Elem().Type() +} + +// hasConstructYAMLMethod checks if a type has an UnmarshalYAML method +// that takes a *Node from an allowlisted v3 yaml package. This detects +// v3 backward-compatible Unmarshaler implementations whose Node type +// can't be checked via interface assertion from this package. +func hasConstructYAMLMethod(t reflect.Type) bool { + method, found := t.MethodByName("UnmarshalYAML") + if !found { + return false + } + + // Check signature: func(*T) UnmarshalYAML(*Node) error + mtype := method.Type + if mtype.NumIn() != 2 || mtype.NumOut() != 1 { + return false + } + + // First param is receiver (already checked by MethodByName) + // Second param should be a pointer to a Node-like struct + paramType := mtype.In(1) + if paramType.Kind() != reflect.Ptr { + return false + } + + elemType := paramType.Elem() + if elemType.Kind() != reflect.Struct || elemType.Name() != "Node" || !isYAMLNodePkg(elemType.PkgPath()) { + return false + } + + // Return type should be error + retType := mtype.Out(0) + if retType.Kind() != reflect.Interface || retType.Name() != "error" { + return false + } + + return true +} + +func isYAMLNodePkg(pkg string) bool { + switch pkg { + case "gopkg.in/yaml.v3", "go.yaml.in/yaml/v3": + return true + } + return false +} + +// getStructInfo returns cached information about a struct type's fields. +// It parses struct tags and builds a map of field names to field info. +func getStructInfo(st reflect.Type) (*structInfo, error) { + fieldMapMutex.RLock() + sinfo, found := structMap[st] + fieldMapMutex.RUnlock() + if found { + return sinfo, nil + } + + n := st.NumField() + fieldsMap := make(map[string]fieldInfo) + fieldsList := make([]fieldInfo, 0, n) + inlineMap := -1 + inlineConstructors := [][]int(nil) + for i := 0; i != n; i++ { + field := st.Field(i) + if field.PkgPath != "" && !field.Anonymous { + continue // Private field + } + + info := fieldInfo{Num: i} + + tag := field.Tag.Get("yaml") + if tag == "" && !strings.Contains(string(field.Tag), ":") { + tag = string(field.Tag) + } + if tag == "-" { + continue + } + + inline := false + fields := strings.Split(tag, ",") + if len(fields) > 1 { + for _, flag := range fields[1:] { + switch flag { + case "omitempty": + info.OmitEmpty = true + case "flow": + info.Flow = true + case "inline": + inline = true + default: + return nil, fmt.Errorf("unsupported flag %q in tag %q of type %s", flag, tag, st) + } + } + tag = fields[0] + } + + if inline { + switch field.Type.Kind() { + case reflect.Map: + if inlineMap >= 0 { + return nil, errors.New("multiple ,inline maps in struct " + st.String()) + } + if field.Type.Key() != reflect.TypeOf("") { + return nil, errors.New("option ,inline needs a map with string keys in struct " + st.String()) + } + inlineMap = info.Num + case reflect.Struct, reflect.Pointer: + ftype := field.Type + for ftype.Kind() == reflect.Pointer { + ftype = ftype.Elem() + } + if ftype.Kind() != reflect.Struct { + return nil, errors.New("option ,inline may only be used on a struct or map field") + } + // Check for both libyaml.constructor and yaml.Unmarshaler (by method name) + if reflect.PointerTo(ftype).Implements(constructorType) || hasConstructYAMLMethod(reflect.PointerTo(ftype)) { + inlineConstructors = append(inlineConstructors, []int{i}) + } else { + sinfo, err := getStructInfo(ftype) + if err != nil { + return nil, err + } + for _, index := range sinfo.InlineConstructors { + inlineConstructors = append(inlineConstructors, append([]int{i}, index...)) + } + for _, finfo := range sinfo.FieldsList { + if _, found := fieldsMap[finfo.Key]; found { + msg := "duplicated key '" + finfo.Key + "' in struct " + st.String() + return nil, errors.New(msg) + } + if finfo.Inline == nil { + finfo.Inline = []int{i, finfo.Num} + } else { + finfo.Inline = append([]int{i}, finfo.Inline...) + } + finfo.Id = len(fieldsList) + fieldsMap[finfo.Key] = finfo + fieldsList = append(fieldsList, finfo) + } + } + default: + return nil, errors.New("option ,inline may only be used on a struct or map field") + } + continue + } + + if tag != "" { + info.Key = tag + } else { + info.Key = strings.ToLower(field.Name) + } + + if _, found = fieldsMap[info.Key]; found { + msg := "duplicated key '" + info.Key + "' in struct " + st.String() + return nil, errors.New(msg) + } + + info.Id = len(fieldsList) + fieldsList = append(fieldsList, info) + fieldsMap[info.Key] = info + } + + sinfo = &structInfo{ + FieldsMap: fieldsMap, + FieldsList: fieldsList, + InlineMap: inlineMap, + InlineConstructors: inlineConstructors, + } + + fieldMapMutex.Lock() + structMap[st] = sinfo + fieldMapMutex.Unlock() + return sinfo, nil +} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/yaml.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/yaml.go index f9f4f1f..04a401a 100644 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/yaml.go +++ b/vendor/go.yaml.in/yaml/v4/internal/libyaml/yaml.go @@ -11,7 +11,6 @@ package libyaml import ( "fmt" - "io" "strings" ) @@ -39,6 +38,7 @@ func (t *TagDirective) GetHandle() string { return string(t.handle) } // GetPrefix returns the tag prefix. func (t *TagDirective) GetPrefix() string { return string(t.prefix) } +// Encoding represents the character encoding of a YAML stream. type Encoding int // The stream encoding. @@ -51,6 +51,7 @@ const ( UTF16BE_ENCODING // The UTF-16-BE encoding with BOM. ) +// LineBreak represents the line break style used in YAML output. type LineBreak int // Line break types. @@ -63,6 +64,7 @@ const ( CRLN_BREAK // Use CR LN for line breaks (DOS style). ) +// QuoteStyle represents the preferred quote style for scalar values. type QuoteStyle int // Quote style types for required quoting. @@ -82,6 +84,7 @@ func (q QuoteStyle) ScalarStyle() ScalarStyle { return SINGLE_QUOTED_SCALAR_STYLE } +// ErrorType represents the category of error that occurred during processing. type ErrorType int // Many bad things could happen with the parser and emitter. @@ -101,10 +104,11 @@ const ( // Mark holds the pointer position. type Mark struct { Index int // The position index. - Line int // The position line (1-indexed). - Column int // The position column (0-indexed internally, displayed as 1-indexed). + Line int // The position line (1-indexed; 0 means unknown). + Column int // The position column (1-indexed; 0 means unknown). } +// String returns a human-readable string representation of the position mark. func (m Mark) String() string { var builder strings.Builder if m.Line == 0 { @@ -112,17 +116,60 @@ func (m Mark) String() string { } fmt.Fprintf(&builder, "line %d", m.Line) - if m.Column != 0 { - fmt.Fprintf(&builder, ", column %d", m.Column+1) + if m.Column > 0 { + fmt.Fprintf(&builder, ", column %d", m.Column) } return builder.String() } +// shortString returns a compact position string. +// Returns "" when Line is 0 (position not known). +// When Column is 0 (unknown), it is omitted from output ("L{line}"); +// otherwise it is displayed as "L{line}.C{col}". +func (m Mark) shortString() string { + if m.Line == 0 { + return "" + } + if m.Column > 0 { + return fmt.Sprintf("L%d.C%d", m.Line, m.Column) + } + return fmt.Sprintf("L%d", m.Line) +} + +// rangeString formats a position range from start mark m to end mark. +// Both marks use shortString for their individual display. +// When marks are on the same line: +// - Both Column==0: just "L2" (unknown columns, no range shown) +// - Both Column>0: "L2.C6-C7" (compact column range) +// - Mixed columns: "L1.C4-L1" (full start with line-only end) +// +// When marks are on different lines: "L1.C8-L2.C3" +func (m Mark) rangeString(end Mark) string { + start := m.shortString() + if m.Line == end.Line { + if m.Column == 0 && end.Column == 0 { + // Same line, unknown columns: just "L2" + return start + } + if m.Column > 0 && end.Column > 0 { + if m.Column == end.Column { + // Same position: just "L2.C6" + return start + } + // Same line with columns: "L2.C6-C7" + return fmt.Sprintf("%s-C%d", start, end.Column) + } + } + return fmt.Sprintf("%s-%s", start, end.shortString()) +} + // Node Styles +// styleInt is the underlying type for style constants. type styleInt int8 +// ScalarStyle represents the formatting style of a scalar value. type ScalarStyle styleInt // Scalar styles. @@ -155,6 +202,7 @@ func (style ScalarStyle) String() string { } } +// SequenceStyle represents the formatting style of a sequence node. type SequenceStyle styleInt // Sequence styles. @@ -166,6 +214,7 @@ const ( FLOW_SEQUENCE_STYLE // The flow sequence style. ) +// MappingStyle represents the formatting style of a mapping node. type MappingStyle styleInt // Mapping styles. @@ -179,6 +228,7 @@ const ( // Tokens +// TokenType represents the type of a scanned token. type TokenType int // Token types. @@ -215,6 +265,7 @@ const ( COMMENT_TOKEN // A COMMENT token. ) +// String returns a string representation of the token type. func (tt TokenType) String() string { switch tt { case NO_TOKEN: @@ -297,6 +348,7 @@ type Token struct { // Events +// EventType represents the type of a parsing or emitting event. type EventType int8 // Event types. @@ -317,6 +369,7 @@ const ( TAIL_COMMENT_EVENT ) +// eventStrings maps EventType constants to their string representations. var eventStrings = []string{ NO_EVENT: "none", STREAM_START_EVENT: "stream start", @@ -332,6 +385,7 @@ var eventStrings = []string{ TAIL_COMMENT_EVENT: "tail comment", } +// String returns a string representation of the event type. func (e EventType) String() string { if e < 0 || int(e) >= len(eventStrings) { return fmt.Sprintf("unknown event %d", e) @@ -382,9 +436,14 @@ type Event struct { Style Style } -func (e *Event) ScalarStyle() ScalarStyle { return ScalarStyle(e.Style) } +// ScalarStyle returns the style of a scalar event. +func (e *Event) ScalarStyle() ScalarStyle { return ScalarStyle(e.Style) } + +// SequenceStyle returns the style of a sequence event. func (e *Event) SequenceStyle() SequenceStyle { return SequenceStyle(e.Style) } -func (e *Event) MappingStyle() MappingStyle { return MappingStyle(e.Style) } + +// MappingStyle returns the style of a mapping event. +func (e *Event) MappingStyle() MappingStyle { return MappingStyle(e.Style) } // GetEncoding returns the stream encoding (for STREAM_START_EVENT). func (e *Event) GetEncoding() Encoding { return e.encoding } @@ -396,7 +455,6 @@ func (e *Event) GetVersionDirective() *VersionDirective { return e.versionDirect func (e *Event) GetTagDirectives() []TagDirective { return e.tagDirectives } // Nodes - const ( NULL_TAG = "tag:yaml.org,2002:null" // The tag !!null with the only possible value: null. BOOL_TAG = "tag:yaml.org,2002:bool" // The tag !!bool with the values: true and false. @@ -416,419 +474,3 @@ const ( DEFAULT_SEQUENCE_TAG = SEQ_TAG // The default sequence tag is !!seq. DEFAULT_MAPPING_TAG = MAP_TAG // The default mapping tag is !!map. ) - -type NodeType int - -// Node types. -const ( - // An empty node. - NO_NODE NodeType = iota - - SCALAR_NODE // A scalar node. - SEQUENCE_NODE // A sequence node. - MAPPING_NODE // A mapping node. -) - -// NodeItem represents an element of a sequence node. -type NodeItem int - -// NodePair represents an element of a mapping node. -type NodePair struct { - key int // The key of the element. - value int // The value of the element. -} - -// parserNode represents a single node in the YAML document tree. -type parserNode struct { - typ NodeType // The node type. - tag []byte // The node tag. - - // The node data. - - // The scalar parameters (for SCALAR_NODE). - scalar struct { - value []byte // The scalar value. - length int // The length of the scalar value. - style ScalarStyle // The scalar style. - } - - // The sequence parameters (for YAML_SEQUENCE_NODE). - sequence struct { - items_data []NodeItem // The stack of sequence items. - style SequenceStyle // The sequence style. - } - - // The mapping parameters (for MAPPING_NODE). - mapping struct { - pairs_data []NodePair // The stack of mapping pairs (key, value). - pairs_start *NodePair // The beginning of the stack. - pairs_end *NodePair // The end of the stack. - pairs_top *NodePair // The top of the stack. - style MappingStyle // The mapping style. - } - - start_mark Mark // The beginning of the node. - end_mark Mark // The end of the node. -} - -// Document structure. -type Document struct { - // The document nodes. - nodes []parserNode - - // The version directive. - version_directive *VersionDirective - - // The list of tag directives. - tag_directives_data []TagDirective - tag_directives_start int // The beginning of the tag directives list. - tag_directives_end int // The end of the tag directives list. - - start_implicit int // Is the document start indicator implicit? - end_implicit int // Is the document end indicator implicit? - - // The start/end of the document. - start_mark, end_mark Mark -} - -// ReadHandler is called when the [Parser] needs to read more bytes from the -// source. The handler should write not more than size bytes to the buffer. -// The number of written bytes should be set to the size_read variable. -// -// [in,out] data A pointer to an application data specified by -// -// yamlParser.setInput(). -// -// [out] buffer The buffer to write the data from the source. -// [in] size The size of the buffer. -// [out] size_read The actual number of bytes read from the source. -// -// On success, the handler should return 1. If the handler failed, -// the returned value should be 0. On EOF, the handler should set the -// size_read to 0 and return 1. -type ReadHandler func(parser *Parser, buffer []byte) (n int, err error) - -// SimpleKey holds information about a potential simple key. -type SimpleKey struct { - flow_level int // What flow level is the key at? - required bool // Is a simple key required? - token_number int // The number of the token. - mark Mark // The position mark. -} - -// ParserState represents the state of the parser. -type ParserState int - -const ( - PARSE_STREAM_START_STATE ParserState = iota - - PARSE_IMPLICIT_DOCUMENT_START_STATE // Expect the beginning of an implicit document. - PARSE_DOCUMENT_START_STATE // Expect DOCUMENT-START. - PARSE_DOCUMENT_CONTENT_STATE // Expect the content of a document. - PARSE_DOCUMENT_END_STATE // Expect DOCUMENT-END. - PARSE_BLOCK_NODE_STATE // Expect a block node. - PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a block sequence. - PARSE_BLOCK_SEQUENCE_ENTRY_STATE // Expect an entry of a block sequence. - PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE // Expect an entry of an indentless sequence. - PARSE_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. - PARSE_BLOCK_MAPPING_KEY_STATE // Expect a block mapping key. - PARSE_BLOCK_MAPPING_VALUE_STATE // Expect a block mapping value. - PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE // Expect the first entry of a flow sequence. - PARSE_FLOW_SEQUENCE_ENTRY_STATE // Expect an entry of a flow sequence. - PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE // Expect a key of an ordered mapping. - PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE // Expect a value of an ordered mapping. - PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE // Expect the and of an ordered mapping entry. - PARSE_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. - PARSE_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. - PARSE_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. - PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE // Expect an empty value of a flow mapping. - PARSE_END_STATE // Expect nothing. -) - -func (ps ParserState) String() string { - switch ps { - case PARSE_STREAM_START_STATE: - return "PARSE_STREAM_START_STATE" - case PARSE_IMPLICIT_DOCUMENT_START_STATE: - return "PARSE_IMPLICIT_DOCUMENT_START_STATE" - case PARSE_DOCUMENT_START_STATE: - return "PARSE_DOCUMENT_START_STATE" - case PARSE_DOCUMENT_CONTENT_STATE: - return "PARSE_DOCUMENT_CONTENT_STATE" - case PARSE_DOCUMENT_END_STATE: - return "PARSE_DOCUMENT_END_STATE" - case PARSE_BLOCK_NODE_STATE: - return "PARSE_BLOCK_NODE_STATE" - case PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE: - return "PARSE_BLOCK_SEQUENCE_FIRST_ENTRY_STATE" - case PARSE_BLOCK_SEQUENCE_ENTRY_STATE: - return "PARSE_BLOCK_SEQUENCE_ENTRY_STATE" - case PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE: - return "PARSE_INDENTLESS_SEQUENCE_ENTRY_STATE" - case PARSE_BLOCK_MAPPING_FIRST_KEY_STATE: - return "PARSE_BLOCK_MAPPING_FIRST_KEY_STATE" - case PARSE_BLOCK_MAPPING_KEY_STATE: - return "PARSE_BLOCK_MAPPING_KEY_STATE" - case PARSE_BLOCK_MAPPING_VALUE_STATE: - return "PARSE_BLOCK_MAPPING_VALUE_STATE" - case PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE: - return "PARSE_FLOW_SEQUENCE_FIRST_ENTRY_STATE" - case PARSE_FLOW_SEQUENCE_ENTRY_STATE: - return "PARSE_FLOW_SEQUENCE_ENTRY_STATE" - case PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE: - return "PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_KEY_STATE" - case PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE: - return "PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_VALUE_STATE" - case PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE: - return "PARSE_FLOW_SEQUENCE_ENTRY_MAPPING_END_STATE" - case PARSE_FLOW_MAPPING_FIRST_KEY_STATE: - return "PARSE_FLOW_MAPPING_FIRST_KEY_STATE" - case PARSE_FLOW_MAPPING_KEY_STATE: - return "PARSE_FLOW_MAPPING_KEY_STATE" - case PARSE_FLOW_MAPPING_VALUE_STATE: - return "PARSE_FLOW_MAPPING_VALUE_STATE" - case PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE: - return "PARSE_FLOW_MAPPING_EMPTY_VALUE_STATE" - case PARSE_END_STATE: - return "PARSE_END_STATE" - } - return "" -} - -// AliasData holds information about aliases. -type AliasData struct { - anchor []byte // The anchor. - index int // The node id. - mark Mark // The anchor mark. -} - -// Parser structure holds all information about the current -// state of the parser. -type Parser struct { - lastError error - - // Reader stuff - read_handler ReadHandler // Read handler. - - input_reader io.Reader // File input data. - input []byte // String input data. - input_pos int - - eof bool // EOF flag - - buffer []byte // The working buffer. - buffer_pos int // The current position of the buffer. - - unread int // The number of unread characters in the buffer. - - newlines int // The number of line breaks since last non-break/non-blank character - - raw_buffer []byte // The raw buffer. - raw_buffer_pos int // The current position of the buffer. - - encoding Encoding // The input encoding. - - offset int // The offset of the current position (in bytes). - mark Mark // The mark of the current position. - - // Comments - - HeadComment []byte // The current head comments - LineComment []byte // The current line comments - FootComment []byte // The current foot comments - tail_comment []byte // Foot comment that happens at the end of a block. - stem_comment []byte // Comment in item preceding a nested structure (list inside list item, etc) - - comments []Comment // The folded comments for all parsed tokens - comments_head int - - // Scanner stuff - - stream_start_produced bool // Have we started to scan the input stream? - stream_end_produced bool // Have we reached the end of the input stream? - - flow_level int // The number of unclosed '[' and '{' indicators. - - tokens []Token // The tokens queue. - tokens_head int // The head of the tokens queue. - tokens_parsed int // The number of tokens fetched from the queue. - token_available bool // Does the tokens queue contain a token ready for dequeueing. - - indent int // The current indentation level. - indents []int // The indentation levels stack. - - simple_key_allowed bool // May a simple key occur at the current position? - simple_key_possible bool // Is the current simple key possible? - simple_key SimpleKey // The current simple key. - simple_key_stack []SimpleKey // The stack of simple keys. - - // Parser stuff - - state ParserState // The current parser state. - states []ParserState // The parser states stack. - marks []Mark // The stack of marks. - tag_directives []TagDirective // The list of TAG directives. - - // Representer stuff - - aliases []AliasData // The alias data. - - document *Document // The currently parsed document. -} - -type Comment struct { - ScanMark Mark // Position where scanning for comments started - TokenMark Mark // Position after which tokens will be associated with this comment - StartMark Mark // Position of '#' comment mark - EndMark Mark // Position where comment terminated - - Head []byte - Line []byte - Foot []byte -} - -// Emitter Definitions - -// WriteHandler is called when the [Emitter] needs to flush the accumulated -// characters to the output. The handler should write @a size bytes of the -// @a buffer to the output. -// -// @param[in,out] data A pointer to an application data specified by -// -// yamlEmitter.setOutput(). -// -// @param[in] buffer The buffer with bytes to be written. -// @param[in] size The size of the buffer. -// -// @returns On success, the handler should return @c 1. If the handler failed, -// the returned value should be @c 0. -type WriteHandler func(emitter *Emitter, buffer []byte) error - -type EmitterState int - -// The emitter states. -const ( - // Expect STREAM-START. - EMIT_STREAM_START_STATE EmitterState = iota - - EMIT_FIRST_DOCUMENT_START_STATE // Expect the first DOCUMENT-START or STREAM-END. - EMIT_DOCUMENT_START_STATE // Expect DOCUMENT-START or STREAM-END. - EMIT_DOCUMENT_CONTENT_STATE // Expect the content of a document. - EMIT_DOCUMENT_END_STATE // Expect DOCUMENT-END. - EMIT_FLOW_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a flow sequence. - EMIT_FLOW_SEQUENCE_TRAIL_ITEM_STATE // Expect the next item of a flow sequence, with the comma already written out - EMIT_FLOW_SEQUENCE_ITEM_STATE // Expect an item of a flow sequence. - EMIT_FLOW_MAPPING_FIRST_KEY_STATE // Expect the first key of a flow mapping. - EMIT_FLOW_MAPPING_TRAIL_KEY_STATE // Expect the next key of a flow mapping, with the comma already written out - EMIT_FLOW_MAPPING_KEY_STATE // Expect a key of a flow mapping. - EMIT_FLOW_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a flow mapping. - EMIT_FLOW_MAPPING_VALUE_STATE // Expect a value of a flow mapping. - EMIT_BLOCK_SEQUENCE_FIRST_ITEM_STATE // Expect the first item of a block sequence. - EMIT_BLOCK_SEQUENCE_ITEM_STATE // Expect an item of a block sequence. - EMIT_BLOCK_MAPPING_FIRST_KEY_STATE // Expect the first key of a block mapping. - EMIT_BLOCK_MAPPING_KEY_STATE // Expect the key of a block mapping. - EMIT_BLOCK_MAPPING_SIMPLE_VALUE_STATE // Expect a value for a simple key of a block mapping. - EMIT_BLOCK_MAPPING_VALUE_STATE // Expect a value of a block mapping. - EMIT_END_STATE // Expect nothing. -) - -// Emitter holds all information about the current state of the emitter. -type Emitter struct { - // Writer stuff - - write_handler WriteHandler // Write handler. - - output_buffer *[]byte // String output data. - output_writer io.Writer // File output data. - - buffer []byte // The working buffer. - buffer_pos int // The current position of the buffer. - - encoding Encoding // The stream encoding. - - // Emitter stuff - - canonical bool // If the output is in the canonical style? - BestIndent int // The number of indentation spaces. - best_width int // The preferred width of the output lines. - unicode bool // Allow unescaped non-ASCII characters? - line_break LineBreak // The preferred line break. - quotePreference QuoteStyle // Preferred quote style when quoting is required. - - state EmitterState // The current emitter state. - states []EmitterState // The stack of states. - - events []Event // The event queue. - events_head int // The head of the event queue. - - indents []int // The stack of indentation levels. - - tag_directives []TagDirective // The list of tag directives. - - indent int // The current indentation level. - - CompactSequenceIndent bool // Is '- ' is considered part of the indentation for sequence elements? - - flow_level int // The current flow level. - - root_context bool // Is it the document root context? - sequence_context bool // Is it a sequence context? - mapping_context bool // Is it a mapping context? - simple_key_context bool // Is it a simple mapping key context? - - line int // The current line. - column int // The current column. - whitespace bool // If the last character was a whitespace? - indention bool // If the last character was an indentation character (' ', '-', '?', ':')? - OpenEnded bool // If an explicit document end is required? - - space_above bool // Is there's an empty line above? - foot_indent int // The indent used to write the foot comment above, or -1 if none. - - // Anchor analysis. - anchor_data struct { - anchor []byte // The anchor value. - alias bool // Is it an alias? - } - - // Tag analysis. - tag_data struct { - handle []byte // The tag handle. - suffix []byte // The tag suffix. - } - - // Scalar analysis. - scalar_data struct { - value []byte // The scalar value. - multiline bool // Does the scalar contain line breaks? - flow_plain_allowed bool // Can the scalar be expressed in the flow plain style? - block_plain_allowed bool // Can the scalar be expressed in the block plain style? - single_quoted_allowed bool // Can the scalar be expressed in the single quoted style? - block_allowed bool // Can the scalar be expressed in the literal or folded styles? - style ScalarStyle // The output style. - } - - // Comments - HeadComment []byte - LineComment []byte - FootComment []byte - TailComment []byte - - key_line_comment []byte - - // Representer stuff - - opened bool // If the stream was already opened? - closed bool // If the stream was already closed? - - // The information associated with the document nodes. - anchors *struct { - references int // The number of references. - anchor int // The anchor id. - serialized bool // If the node has been emitted? - } - - last_anchor_id int // The last assigned anchor id. - - document *Document // The currently emitted document. -} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/yamldatatest_loader.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/yamldatatest_loader.go deleted file mode 100644 index 5ca2ff0..0000000 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/yamldatatest_loader.go +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright 2025 The go-yaml Project Contributors -// SPDX-License-Identifier: Apache-2.0 - -// YAML test data loading utilities. -// Provides helper functions for loading and processing YAML test data, -// including scalar coercion. - -package libyaml - -import ( - "errors" - "fmt" - "io" - "strings" -) - -// coerceScalar converts a YAML scalar string to an appropriate Go type -func coerceScalar(value string) any { - // Try bool and null - switch value { - case "true": - return true - case "false": - return false - case "null": - return nil - } - - // Try hex int (0x or 0X prefix) - needed for test data byte arrays - var intVal int - if _, err := fmt.Sscanf(strings.ToLower(value), "0x%x", &intVal); err == nil { - return intVal - } - - // Try float (must check before int because %d will parse "1.5" as "1") - if strings.Contains(value, ".") { - var floatVal float64 - if _, err := fmt.Sscanf(value, "%f", &floatVal); err == nil { - return floatVal - } - } - - // Try decimal int - use int64 to handle large values on 32-bit systems - var int64Val int64 - if _, err := fmt.Sscanf(value, "%d", &int64Val); err == nil { - // Return as int if it fits, otherwise int64 - if int64Val == int64(int(int64Val)) { - return int(int64Val) - } - return int64Val - } - - // Default to string - return value -} - -// LoadYAML parses YAML data using the native libyaml Parser. -// This function is exported so it can be used by other packages for data-driven testing. -// It returns a generic interface{} which is typically: -// - map[string]interface{} for YAML mappings -// - []interface{} for YAML sequences -// - scalar values, resolved according to the following rules: -// - Booleans: "true" and "false" are returned as bool (true/false). -// - Nulls: "null" is returned as nil. -// - Floats: values containing "." are parsed as float64. -// - Decimal integers: values matching integer format are parsed as int. -// - All other values are returned as string. -// -// This scalar resolution behavior matches the implementation in coerceScalar. -func LoadYAML(data []byte) (any, error) { - parser := NewParser() - parser.SetInputString(data) - defer parser.Delete() - - type stackEntry struct { - container any // map[string]interface{} or []interface{} - key string // for maps: current key waiting for value - } - - var stack []stackEntry - var root any - - for { - var event Event - if err := parser.Parse(&event); err != nil { - if errors.Is(err, io.EOF) { - break - } - return nil, err - } - - switch event.Type { - case STREAM_END_EVENT: - // End of stream, we're done - return root, nil - - case STREAM_START_EVENT, DOCUMENT_START_EVENT: - // Structural markers, no action needed - - case MAPPING_START_EVENT: - newMap := make(map[string]any) - stack = append(stack, stackEntry{container: newMap}) - - case MAPPING_END_EVENT: - if len(stack) > 0 { - popped := stack[len(stack)-1] - stack = stack[:len(stack)-1] - - // Add completed map to parent or set as root - if len(stack) == 0 { - root = popped.container - } else { - parent := &stack[len(stack)-1] - if m, ok := parent.container.(map[string]any); ok { - m[parent.key] = popped.container - parent.key = "" // Reset key after use - } else if s, ok := parent.container.([]any); ok { - parent.container = append(s, popped.container) - } - } - } - - case SEQUENCE_START_EVENT: - newSlice := make([]any, 0) - stack = append(stack, stackEntry{container: newSlice}) - - case SEQUENCE_END_EVENT: - if len(stack) > 0 { - popped := stack[len(stack)-1] - stack = stack[:len(stack)-1] - - // Add completed slice to parent or set as root - if len(stack) == 0 { - root = popped.container - } else { - parent := &stack[len(stack)-1] - if m, ok := parent.container.(map[string]any); ok { - m[parent.key] = popped.container - parent.key = "" // Reset key after use - } else if s, ok := parent.container.([]any); ok { - parent.container = append(s, popped.container) - } - } - } - - case SCALAR_EVENT: - value := string(event.Value) - // Only coerce plain (unquoted) scalars - isQuoted := ScalarStyle(event.Style) != PLAIN_SCALAR_STYLE - - if len(stack) == 0 { - // Scalar at root level - if isQuoted { - root = value - } else { - root = coerceScalar(value) - } - } else { - parent := &stack[len(stack)-1] - if m, ok := parent.container.(map[string]any); ok { - if parent.key == "" { - // This scalar is a key - keep as string, don't coerce - parent.key = value - } else { - // This scalar is a value - if isQuoted { - m[parent.key] = value - } else { - m[parent.key] = coerceScalar(value) - } - parent.key = "" - } - } else if s, ok := parent.container.([]any); ok { - // Add to sequence - if isQuoted { - parent.container = append(s, value) - } else { - parent.container = append(s, coerceScalar(value)) - } - } - } - - case DOCUMENT_END_EVENT: - // Document end marker, continue processing - - case ALIAS_EVENT, TAIL_COMMENT_EVENT: - // For now, skip aliases and comments (not used in test data) - } - } - - return root, nil -} diff --git a/vendor/go.yaml.in/yaml/v4/internal/libyaml/yamlprivate.go b/vendor/go.yaml.in/yaml/v4/internal/libyaml/yamlprivate.go deleted file mode 100644 index d23af7d..0000000 --- a/vendor/go.yaml.in/yaml/v4/internal/libyaml/yamlprivate.go +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright 2006-2010 Kirill Simonov -// Copyright 2011-2019 Canonical Ltd -// Copyright 2025 The go-yaml Project Contributors -// SPDX-License-Identifier: Apache-2.0 AND MIT - -// Internal constants and buffer sizes. -// Defines buffer sizes, stack sizes, and other internal configuration -// constants for libyaml. - -package libyaml - -const ( - // The size of the input raw buffer. - input_raw_buffer_size = 512 - - // The size of the input buffer. - // It should be possible to decode the whole raw buffer. - input_buffer_size = input_raw_buffer_size * 3 - - // The size of the output buffer. - output_buffer_size = 128 - - // The size of other stacks and queues. - initial_stack_size = 16 - initial_queue_size = 16 - initial_string_size = 16 -) - -// Check if the character at the specified position is an alphabetical -// character, a digit, '_', or '-'. -func isAlpha(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'Z' || - b[i] >= 'a' && b[i] <= 'z' || b[i] == '_' || b[i] == '-' -} - -// Check if the character at the specified position is a flow indicator as -// defined by spec production [23] c-flow-indicator ::= -// c-collect-entry | c-sequence-start | c-sequence-end | -// c-mapping-start | c-mapping-end -func isFlowIndicator(b []byte, i int) bool { - return b[i] == '[' || b[i] == ']' || - b[i] == '{' || b[i] == '}' || b[i] == ',' -} - -// Check if the character at the specified position is valid for anchor names -// as defined by spec production [102] ns-anchor-char ::= ns-char - -// c-flow-indicator. -// This includes all printable characters except: CR, LF, BOM, space, tab, '[', -// ']', '{', '}', ','. -// We further limit it to ascii chars only, which is a subset of the spec -// production but is usually what most people expect. -func isAnchorChar(b []byte, i int) bool { - if isColon(b, i) { - // [Go] we exclude colons from anchor/alias names. - // - // A colon is a valid anchor character according to the YAML 1.2 specification, - // but it can lead to ambiguity. - // https://github.com/yaml/go-yaml/issues/109 - // - // Also, it would have been a breaking change to support it, as go.yaml.in/yaml/v3 ignores it. - // Supporting it could lead to unexpected behavior. - return false - } - - return isPrintable(b, i) && - !isLineBreak(b, i) && - !isBlank(b, i) && - !isBOM(b, i) && - !isFlowIndicator(b, i) && - isASCII(b, i) -} - -// isColon checks whether the character at the specified position is a colon. -func isColon(b []byte, i int) bool { - return b[i] == ':' -} - -// Check if the character at the specified position is valid in a tag URI. -// -// The set of valid characters is: -// -// '0'-'9', 'A'-'Z', 'a'-'z', '_', '-', ';', '/', '?', ':', '@', '&', -// '=', '+', '$', '.', '!', '~', '*', '\'', '(', ')', '%'. -// -// If verbatim is true, flow indicators (',', '[', ']', '{', '}') are also -// allowed. -func isTagURIChar(b []byte, i int, verbatim bool) bool { - c := b[i] - // isAlpha covers: 0-9, A-Z, a-z, _, - - if isAlpha(b, i) { - return true - } - // Check special URI characters - switch c { - case ';', '/', '?', ':', '@', '&', '=', '+', '$', '.', '!', '~', '*', '\'', '(', ')', '%': - return true - case ',', '[', ']', '{', '}': - return verbatim - } - return false -} - -// Check if the character at the specified position is a digit. -func isDigit(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' -} - -// Get the value of a digit. -func asDigit(b []byte, i int) int { - return int(b[i]) - '0' -} - -// Check if the character at the specified position is a hex-digit. -func isHex(b []byte, i int) bool { - return b[i] >= '0' && b[i] <= '9' || b[i] >= 'A' && b[i] <= 'F' || - b[i] >= 'a' && b[i] <= 'f' -} - -// Get the value of a hex-digit. -func asHex(b []byte, i int) int { - bi := b[i] - if bi >= 'A' && bi <= 'F' { - return int(bi) - 'A' + 10 - } - if bi >= 'a' && bi <= 'f' { - return int(bi) - 'a' + 10 - } - return int(bi) - '0' -} - -// Check if the character is ASCII. -func isASCII(b []byte, i int) bool { - return b[i] <= 0x7F -} - -// Check if the character at the start of the buffer can be printed unescaped. -func isPrintable(b []byte, i int) bool { - return ((b[i] == 0x0A) || // . == #x0A - (b[i] >= 0x20 && b[i] <= 0x7E) || // #x20 <= . <= #x7E - (b[i] == 0xC2 && b[i+1] >= 0xA0) || // #0xA0 <= . <= #xD7FF - (b[i] > 0xC2 && b[i] < 0xED) || - (b[i] == 0xED && b[i+1] < 0xA0) || - (b[i] == 0xEE) || - (b[i] == 0xEF && // #xE000 <= . <= #xFFFD - !(b[i+1] == 0xBB && b[i+2] == 0xBF) && // && . != #xFEFF - !(b[i+1] == 0xBF && (b[i+2] == 0xBE || b[i+2] == 0xBF)))) -} - -// Check if the character at the specified position is NUL. -func isZeroChar(b []byte, i int) bool { - return b[i] == 0x00 -} - -// Check if the beginning of the buffer is a BOM. -func isBOM(b []byte, i int) bool { - return b[0] == 0xEF && b[1] == 0xBB && b[2] == 0xBF -} - -// Check if the character at the specified position is space. -func isSpace(b []byte, i int) bool { - return b[i] == ' ' -} - -// Check if the character at the specified position is tab. -func isTab(b []byte, i int) bool { - return b[i] == '\t' -} - -// Check if the character at the specified position is blank (space or tab). -func isBlank(b []byte, i int) bool { - // return isSpace(b, i) || isTab(b, i) - return b[i] == ' ' || b[i] == '\t' -} - -// Check if the character at the specified position is a line break. -func isLineBreak(b []byte, i int) bool { - return (b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9) // PS (#x2029) -} - -func isCRLF(b []byte, i int) bool { - return b[i] == '\r' && b[i+1] == '\n' -} - -// Check if the character is a line break or NUL. -func isBreakOrZero(b []byte, i int) bool { - // return isLineBreak(b, i) || isZeroChar(b, i) - return ( - // isBreak: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - // isZeroChar: - b[i] == 0) -} - -// Check if the character is a line break, space, or NUL. -func isSpaceOrZero(b []byte, i int) bool { - // return isSpace(b, i) || isBreakOrZero(b, i) - return ( - // isSpace: - b[i] == ' ' || - // isBreakOrZero: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - b[i] == 0) -} - -// Check if the character is a line break, space, tab, or NUL. -func isBlankOrZero(b []byte, i int) bool { - // return isBlank(b, i) || isBreakOrZero(b, i) - return ( - // isBlank: - b[i] == ' ' || b[i] == '\t' || - // isBreakOrZero: - b[i] == '\r' || // CR (#xD) - b[i] == '\n' || // LF (#xA) - b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) - b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029) - b[i] == 0) -} - -// Determine the width of the character. -func width(b byte) int { - // Don't replace these by a switch without first - // confirming that it is being inlined. - if b&0x80 == 0x00 { - return 1 - } - if b&0xE0 == 0xC0 { - return 2 - } - if b&0xF0 == 0xE0 { - return 3 - } - if b&0xF8 == 0xF0 { - return 4 - } - return 0 -} diff --git a/vendor/go.yaml.in/yaml/v4/node.go b/vendor/go.yaml.in/yaml/v4/node.go new file mode 100644 index 0000000..b78a50e --- /dev/null +++ b/vendor/go.yaml.in/yaml/v4/node.go @@ -0,0 +1,98 @@ +package yaml + +import "go.yaml.in/yaml/v4/internal/libyaml" + +// ----------------------------------------------------------------------------- +// Node-related type aliases and constants +// ----------------------------------------------------------------------------- +type ( + // Node represents an element in the YAML document hierarchy. + // While documents are typically encoded and decoded into higher level + // types, such as structs and maps, Node is an intermediate representation + // that allows detailed control over the content being decoded or encoded. + // + // It's worth noting that although Node offers access into details such as + // line numbers, columns, and comments, the content when re-encoded will + // not have its original textual representation preserved. + // An effort is made to render the data pleasantly, and to preserve + // comments near the data they describe, though. + // + // Values that make use of the Node type interact with the yaml package in + // the same way any other type would do, by encoding and decoding yaml data + // directly or indirectly into them. + // + // For example: + // + // var person struct { + // Name string + // Address yaml.Node + // } + // err := yaml.Unmarshal(data, &person) + // + // Or by itself: + // + // var person Node + // err := yaml.Unmarshal(data, &person) + Node = libyaml.Node + + // Kind represents the type of YAML node. + Kind = libyaml.Kind + + // Style represents the formatting style of a YAML node. + Style = libyaml.Style + + // Marshaler interface may be implemented by types to customize their + // behavior when being marshaled into a YAML document. + Marshaler = libyaml.Marshaler + + // Unmarshaler is the interface implemented by types that can unmarshal + // a YAML description of themselves. + Unmarshaler = libyaml.Unmarshaler + + // IsZeroer is used to check whether an object is zero to determine whether + // it should be omitted when marshaling with the ,omitempty flag. + // One notable implementation is [time.Time]. + IsZeroer = libyaml.IsZeroer +) + +// Kind constants define the different types of YAML nodes. +const ( + // DocumentNode represents the root of a YAML document. + DocumentNode = libyaml.DocumentNode + + // SequenceNode represents a YAML sequence (list). + SequenceNode = libyaml.SequenceNode + + // MappingNode represents a YAML mapping (dictionary). + MappingNode = libyaml.MappingNode + + // ScalarNode represents a YAML scalar value. + ScalarNode = libyaml.ScalarNode + + // AliasNode represents a reference to an anchored node. + AliasNode = libyaml.AliasNode + + // StreamNode represents a container for multiple YAML documents. + StreamNode = libyaml.StreamNode +) + +// Style constants define different formatting styles for YAML nodes. +const ( + // TaggedStyle explicitly shows the tag on the node. + TaggedStyle = libyaml.TaggedStyle + + // DoubleQuotedStyle uses double quotes for scalar values. + DoubleQuotedStyle = libyaml.DoubleQuotedStyle + + // SingleQuotedStyle uses single quotes for scalar values. + SingleQuotedStyle = libyaml.SingleQuotedStyle + + // LiteralStyle uses literal block scalar style (|). + LiteralStyle = libyaml.LiteralStyle + + // FoldedStyle uses folded block scalar style (>). + FoldedStyle = libyaml.FoldedStyle + + // FlowStyle uses flow style (inline) formatting. + FlowStyle = libyaml.FlowStyle +) diff --git a/vendor/go.yaml.in/yaml/v4/plugin.go b/vendor/go.yaml.in/yaml/v4/plugin.go new file mode 100644 index 0000000..4f5b4a3 --- /dev/null +++ b/vendor/go.yaml.in/yaml/v4/plugin.go @@ -0,0 +1,25 @@ +// Copyright 2026 The go-yaml Project Contributors +// SPDX-License-Identifier: Apache-2.0 + +package yaml + +// LimitPlugin configures safety limits for YAML parsing. +// +// When registered, CheckDepth is called on each nesting depth increase, +// and CheckAlias is called on each alias expansion to detect excessive +// aliasing. +// +// Example usage: +// +// import "go.yaml.in/yaml/v4/plugin/limit" +// loader := yaml.NewLoader(data, yaml.WithPlugin(limit.New(limit.AliasNone()))) +type LimitPlugin interface { + // CheckDepth is called when the parser increases nesting depth. + // depth is the current nesting level; ctx.Kind is "flow" or "block". + // Return an error to abort parsing. + CheckDepth(depth int, ctx *DepthContext) error + + // CheckAlias is called during alias expansion. + // Return an error to abort construction. + CheckAlias(aliasCount, constructCount int) error +} diff --git a/vendor/go.yaml.in/yaml/v4/plugin/limit/plugin.go b/vendor/go.yaml.in/yaml/v4/plugin/limit/plugin.go new file mode 100644 index 0000000..be9703e --- /dev/null +++ b/vendor/go.yaml.in/yaml/v4/plugin/limit/plugin.go @@ -0,0 +1,191 @@ +// Copyright 2026 The go-yaml Project Contributors +// SPDX-License-Identifier: Apache-2.0 + +// Package limit provides a configurable safety limit plugin for go-yaml. +// +// The limit plugin controls the maximum nesting depth and alias expansion +// ratio during YAML parsing. +// By default, go-yaml enforces conservative limits to prevent DoS attacks. +// This plugin lets you relax or tighten those limits for your use case. +// +// # Usage +// +// import ( +// "go.yaml.in/yaml/v4" +// "go.yaml.in/yaml/v4/plugin/limit" +// ) +// +// // Default limits +// loader := yaml.NewLoader(data, yaml.WithPlugin(limit.New())) +// +// // Disable alias checking (e.g. for 11,000 programmatic aliases) +// loader := yaml.NewLoader(data, yaml.WithPlugin(limit.New(limit.AliasNone()))) +// +// // Custom depth limit +// loader := yaml.NewLoader(data, yaml.WithPlugin(limit.New(limit.DepthValue(50)))) +// +// # Third-Party Plugins +// +// You can implement [yaml.LimitPlugin] directly instead of using this package: +// +// type StrictLimit struct{} +// func (s *StrictLimit) CheckDepth(depth int, ctx *yaml.DepthContext) error { ... } +// func (s *StrictLimit) CheckAlias(aliasCount, constructCount int) error { ... } +// yaml.NewLoader(data, yaml.WithPlugin(&StrictLimit{})) +package limit + +import ( + "fmt" + + "go.yaml.in/yaml/v4/internal/libyaml" +) + +// DepthContext is an alias for the type used in depth check callbacks. +// See [yaml.DepthContext] for field documentation. +type DepthContext = libyaml.DepthContext + +// Plugin implements configurable safety limits for YAML parsing. +type Plugin struct { + depthLimit *int + depthDisabled bool + depthFn func(int, *DepthContext) error + aliasLimit *int + aliasDisabled bool + aliasFn func(int, int) error +} + +// Option configures a [Plugin]. +type Option func(*Plugin) + +// New creates a limit plugin with the given options. +// With no options, it uses the same defaults as the bare go-yaml library. +func New(opts ...Option) *Plugin { + p := &Plugin{} + for _, o := range opts { + o(p) + } + return p +} + +// DepthValue sets a maximum nesting depth (both flow and block). +func DepthValue(n int) Option { + return func(p *Plugin) { + p.depthLimit = &n + p.depthDisabled = false + p.depthFn = nil + } +} + +// DepthNone disables depth checking entirely. +func DepthNone() Option { + return func(p *Plugin) { + p.depthDisabled = true + p.depthLimit = nil + p.depthFn = nil + } +} + +// DepthFunc sets a custom depth check function. +func DepthFunc(fn func(depth int, ctx *DepthContext) error) Option { + return func(p *Plugin) { + p.depthFn = fn + p.depthLimit = nil + p.depthDisabled = false + } +} + +// AliasValue sets a simple alias expansion count threshold. +func AliasValue(n int) Option { + return func(p *Plugin) { + p.aliasLimit = &n + p.aliasDisabled = false + p.aliasFn = nil + } +} + +// AliasNone disables alias checking entirely. +func AliasNone() Option { + return func(p *Plugin) { + p.aliasDisabled = true + p.aliasLimit = nil + p.aliasFn = nil + } +} + +// AliasFunc sets a custom alias check function. +func AliasFunc(fn func(aliasCount, constructCount int) error) Option { + return func(p *Plugin) { + p.aliasFn = fn + p.aliasLimit = nil + p.aliasDisabled = false + } +} + +// CheckDepth implements [yaml.LimitPlugin]. +func (p *Plugin) CheckDepth(depth int, ctx *DepthContext) error { + if p.depthFn != nil { + return p.depthFn(depth, ctx) + } + if p.depthDisabled { + return nil + } + if p.depthLimit != nil { + if depth > *p.depthLimit { + return fmt.Errorf("exceeded max depth of %d", *p.depthLimit) + } + return nil + } + return libyaml.DefaultDepthCheck(depth, ctx) +} + +// CheckAlias implements [yaml.LimitPlugin]. +func (p *Plugin) CheckAlias(aliasCount, constructCount int) error { + if p.aliasFn != nil { + return p.aliasFn(aliasCount, constructCount) + } + if p.aliasDisabled { + return nil + } + if p.aliasLimit != nil { + if aliasCount > *p.aliasLimit { + return fmt.Errorf("exceeded max alias count of %d", *p.aliasLimit) + } + return nil + } + return libyaml.DefaultAliasCheck(aliasCount, constructCount) +} + +// NewFromYAML creates a limit plugin from a YAML config map. +// Keys: "depth" (int or null), "alias" (int or null). +// Null values disable the corresponding check. +// Omitted keys use defaults. +func NewFromYAML(cfg map[string]any) (*Plugin, error) { + var opts []Option + for key, val := range cfg { + switch key { + case "depth": + if val == nil { + opts = append(opts, DepthNone()) + } else { + n, ok := val.(int) + if !ok { + return nil, fmt.Errorf("limit: depth must be int or null, got %T", val) + } + opts = append(opts, DepthValue(n)) + } + case "alias": + if val == nil { + opts = append(opts, AliasNone()) + } else { + n, ok := val.(int) + if !ok { + return nil, fmt.Errorf("limit: alias must be int or null, got %T", val) + } + opts = append(opts, AliasValue(n)) + } + default: + return nil, fmt.Errorf("limit: unknown key %q", key) + } + } + return New(opts...), nil +} diff --git a/vendor/go.yaml.in/yaml/v4/yaml.go b/vendor/go.yaml.in/yaml/v4/yaml.go index 684d660..b003171 100644 --- a/vendor/go.yaml.in/yaml/v4/yaml.go +++ b/vendor/go.yaml.in/yaml/v4/yaml.go @@ -9,15 +9,12 @@ // https://github.com/yaml/go-yaml // // This file contains: -// - Version presets (V2, V3, V4) +// - Version preset functions (WithV2Defaults, WithV3Defaults, WithV4Defaults) // - Options API (WithIndent, WithKnownFields, etc.) // - Type and constant re-exports from internal/libyaml // - Helper functions for struct field handling +// - Load/Dump API (Load, Dump, Loader, Dumper) // - Classic APIs (Decoder, Encoder, Unmarshal, Marshal) -// -// For the main API, see: -// - loader.go: Load, Loader -// - dumper.go: Dump, Dumper package yaml @@ -25,11 +22,9 @@ import ( "errors" "fmt" "io" - "reflect" - "strings" - "sync" "go.yaml.in/yaml/v4/internal/libyaml" + "go.yaml.in/yaml/v4/plugin/limit" ) //----------------------------------------------------------------------------- @@ -37,92 +32,218 @@ import ( //----------------------------------------------------------------------------- // Usage: -// yaml.Dump(&data, yaml.V3) -// yaml.Dump(&data, yaml.V3, yaml.WithIndent(2), yaml.WithCompactSeqIndent()) - -// V2 defaults: -var V2 = Options( - WithIndent(2), - WithCompactSeqIndent(false), - WithLineWidth(80), - WithUnicode(true), - WithUniqueKeys(true), - WithQuotePreference(QuoteLegacy), -) +// yaml.Dump(&data, yaml.WithV3Defaults()) +// yaml.Dump(&data, yaml.WithV3Defaults(), yaml.WithIndent(2), yaml.WithCompactSeqIndent()) + +// WithV2Defaults returns V2-compatible default options. +func WithV2Defaults() Option { + return Options( + WithIndent(2), + WithCompactSeqIndent(false), + WithLineWidth(80), + WithUnicode(true), + WithUniqueKeys(true), + WithQuotePreference(QuoteLegacy), + WithPlugin(limit.New()), + ) +} -// V3 defaults: -var V3 = Options( - WithIndent(4), - WithCompactSeqIndent(false), - WithLineWidth(80), - WithUnicode(true), - WithUniqueKeys(true), - WithQuotePreference(QuoteLegacy), -) +// WithV3Defaults returns V3-compatible default options. +func WithV3Defaults() Option { + return Options( + WithIndent(4), + WithCompactSeqIndent(false), + WithLineWidth(80), + WithUnicode(true), + WithUniqueKeys(true), + WithQuotePreference(QuoteLegacy), + WithPlugin(limit.New()), + ) +} -// V4 defaults: -var V4 = Options( - WithIndent(2), - WithCompactSeqIndent(true), - WithLineWidth(80), - WithUnicode(true), - WithUniqueKeys(true), - WithQuotePreference(QuoteSingle), -) +// WithV4Defaults returns the current V4 default options. +func WithV4Defaults() Option { + return Options( + WithIndent(2), + WithCompactSeqIndent(true), + WithLineWidth(80), + WithUnicode(true), + WithUniqueKeys(true), + WithQuotePreference(QuoteSingle), + WithPlugin(limit.New()), + ) +} //----------------------------------------------------------------------------- // Options //----------------------------------------------------------------------------- // Option allows configuring YAML loading and dumping operations. -// Re-exported from internal/libyaml. type Option = libyaml.Option +// Option configuration functions var ( - // WithIndent sets indentation spaces (2-9). - // See internal/libyaml.WithIndent. + // WithIndent sets the number of spaces to use for indentation when + // dumping YAML content. + // + // Valid values are 2-9. Common choices: 2 (compact), 4 (readable). WithIndent = libyaml.WithIndent - // WithCompactSeqIndent configures '- ' as part of indentation. - // See internal/libyaml.WithCompactSeqIndent. + + // WithCompactSeqIndent configures whether the sequence indicator '- ' is + // considered part of the indentation when dumping YAML content. + // + // If compact is true, '- ' is treated as part of the indentation. + // If compact is false, '- ' is not treated as part of the indentation. + // When called without arguments, defaults to true. WithCompactSeqIndent = libyaml.WithCompactSeqIndent - // WithKnownFields enables strict field checking during loading. - // See internal/libyaml.WithKnownFields. + + // WithKnownFields enables or disables strict field checking during YAML + // loading. + // + // When enabled, loading will return an error if the YAML input contains + // fields that do not correspond to any fields in the target struct. + // When called without arguments, defaults to true. WithKnownFields = libyaml.WithKnownFields - // WithSingleDocument only processes first document in stream. - // See internal/libyaml.WithSingleDocument. + + // WithSingleDocument configures the Loader to only process the first + // document in a YAML stream. After the first document is loaded, + // subsequent calls to Load will return [io.EOF]. + // + // When called without arguments, defaults to true. + // + // This is useful when you expect exactly one document and want behavior + // similar to Unmarshal. WithSingleDocument = libyaml.WithSingleDocument - // WithStreamNodes enables stream boundary nodes when loading. - // See internal/libyaml.WithStreamNodes. + + // WithStreamNodes enables returning stream boundary nodes when loading + // YAML. + // + // When enabled, Loader.Load returns an interleaved sequence of + // StreamNode and DocumentNode values: + // + // [StreamNode, DocNode, StreamNode, DocNode, ..., StreamNode] + // + // StreamNodes contain metadata about the stream including: + // - Encoding (UTF-8, UTF-16LE, UTF-16BE) + // - YAML version directive (%YAML) + // - Tag directives (%TAG) + // - Position information (Line, Column) + // + // An empty YAML stream returns a single StreamNode. + // When called without arguments, defaults to true. + // + // The default is false. WithStreamNodes = libyaml.WithStreamNodes - // WithAllDocuments enables multi-document mode for Load and Dump. - // See internal/libyaml.WithAllDocuments. + + // WithAllDocuments enables multi-document mode for Load and Dump + // operations. + // + // When used with Load, the target must be a pointer to a slice. + // All documents in the YAML stream will be decoded into the slice. + // Zero documents results in an empty slice (no error). + // + // When used with Dump, the input must be a slice. + // Each element will be encoded as a separate YAML document + // with "---" separators. + // + // When called without arguments, defaults to true. + // + // The default is false (single-document mode). WithAllDocuments = libyaml.WithAllDocuments - // WithLineWidth sets preferred line width for output. - // See internal/libyaml.WithLineWidth. + + // WithLineWidth sets the preferred line width for YAML output. + // + // When encoding long strings, the encoder will attempt to wrap them at + // this width using literal block style (|). Set to -1 or 0 for unlimited + // width. + // + // The default is 80 characters. WithLineWidth = libyaml.WithLineWidth - // WithUnicode controls non-ASCII characters in output. - // See internal/libyaml.WithUnicode. + + // WithUnicode controls whether non-ASCII characters are allowed in YAML + // output. + // + // When true, non-ASCII characters appear as-is (e.g., "café"). + // When false, non-ASCII characters are escaped (e.g., "caf\u00e9"). + // When called without arguments, defaults to true. + // + // The default is true. WithUnicode = libyaml.WithUnicode - // WithUniqueKeys enables duplicate key detection. - // See internal/libyaml.WithUniqueKeys. + + // WithUniqueKeys enables or disables duplicate key detection during YAML + // loading. + // + // When enabled, loading will return an error if the YAML input contains + // duplicate keys in any mapping. This is a security feature that prevents + // key override attacks. + // When called without arguments, defaults to true. + // + // The default is true. WithUniqueKeys = libyaml.WithUniqueKeys + // WithCanonical forces canonical YAML output format. - // See internal/libyaml.WithCanonical. + // + // When enabled, the encoder outputs strictly canonical YAML with explicit + // tags for all values. This produces verbose output primarily useful for + // debugging and YAML spec compliance testing. + // When called without arguments, defaults to true. + // + // The default is false. WithCanonical = libyaml.WithCanonical - // WithLineBreak sets line ending style for output. - // See internal/libyaml.WithLineBreak. + + // WithLineBreak sets the line ending style for YAML output. + // + // Available options: + // - LineBreakLN: Unix-style \n (default) + // - LineBreakCR: Old Mac-style \r + // - LineBreakCRLN: Windows-style \r\n + // + // The default is LineBreakLN. WithLineBreak = libyaml.WithLineBreak - // WithExplicitStart controls document start markers (---). - // See internal/libyaml.WithExplicitStart. + + // WithExplicitStart controls whether document start markers (---) are + // always emitted. + // + // When true, every document begins with an explicit "---" marker. + // When false (default), the marker is omitted for the first document. + // When called without arguments, defaults to true. WithExplicitStart = libyaml.WithExplicitStart - // WithExplicitEnd controls document end markers (...). - // See internal/libyaml.WithExplicitEnd. + + // WithExplicitEnd controls whether document end markers (...) are always + // emitted. + // + // When true, every document ends with an explicit "..." marker. + // When false (default), the marker is omitted. + // When called without arguments, defaults to true. WithExplicitEnd = libyaml.WithExplicitEnd - // WithFlowSimpleCollections controls flow style for simple collections. - // See internal/libyaml.WithFlowSimpleCollections. + + // WithFlowSimpleCollections controls whether simple collections use flow + // style. + // + // When true, sequences and mappings containing only scalar values (no + // nested collections) are rendered in flow style if they fit within the + // line width. + // Example: {name: test, count: 42} or [a, b, c] + // When called without arguments, defaults to true. + // + // When false (default), all collections use block style. WithFlowSimpleCollections = libyaml.WithFlowSimpleCollections - // WithQuotePreference sets preferred quote style when quoting is required. - // See internal/libyaml.WithQuotePreference. + + // WithQuotePreference sets the preferred quote style for strings that + // require quoting. + // + // This option only affects strings that require quoting per the YAML spec. + // Plain strings that don't need quoting remain unquoted regardless of this + // setting. Quoting is required for: + // - Strings that look like other YAML types (true, false, null, 123, etc.) + // - Strings with leading/trailing whitespace + // - Strings containing special YAML syntax characters + // - Empty strings in certain contexts + // + // Quote styles: + // - QuoteSingle: Use single quotes (v4 default) + // - QuoteDouble: Use double quotes + // - QuoteLegacy: Legacy v2/v3 behavior (mixed quoting) WithQuotePreference = libyaml.WithQuotePreference ) @@ -132,12 +253,55 @@ var ( // // Example: // -// opts := yaml.Options(yaml.V4, yaml.WithIndent(3)) +// opts := yaml.Options(yaml.WithV4Defaults(), yaml.WithIndent(3)) // yaml.Dump(&data, opts) func Options(opts ...Option) Option { return libyaml.CombineOptions(opts...) } +// DepthKind represents the type of nesting (flow or block). +type DepthKind = libyaml.DepthKind + +// DepthKind constants for nesting depth checks. +const ( + DepthKindFlow = libyaml.DepthKindFlow + DepthKindBlock = libyaml.DepthKindBlock +) + +// DepthContext holds context about a nesting depth check. +type DepthContext = libyaml.DepthContext + +// WithPlugin registers one or more plugins for YAML processing. +// +// Plugins extend the YAML library with custom processing logic. +// Each plugin implements one or more plugin interfaces. +// Currently supported plugin types: +// - LimitPlugin: Controls depth and alias expansion limits +// +// Example: +// +// import "go.yaml.in/yaml/v4/plugin/limit" +// loader := yaml.NewLoader(data, yaml.WithPlugin(limit.New(limit.AliasNone()))) +// +// Plugins use public types and can be implemented by external packages. +func WithPlugin(plugins ...any) Option { + return func(o *libyaml.Options) error { + for _, p := range plugins { + registered := false + if lp, ok := p.(LimitPlugin); ok { + o.DepthCheck = lp.CheckDepth + o.AliasCheck = lp.CheckAlias + registered = true + } + // Future plugin types add cases here (non-exclusive if) + if !registered { + return fmt.Errorf("yaml: unsupported plugin type: %T", p) + } + } + return nil + } +} + // OptsYAML parses a YAML string containing option settings and returns // an Option that can be combined with other options using Options(). // @@ -154,6 +318,12 @@ func Options(opts ...Option) Option { // - known-fields (bool) // - single-document (bool) // - unique-keys (bool) +// - plugin (map of plugin name to config) +// +// The plugin field configures plugins by name. Each key is a plugin +// name and the value is its configuration map (or null for defaults). +// Currently supported: "limit" with keys "depth" and "alias" (int +// or null to disable). // // Only fields specified in the YAML will override other options when // combined. Unspecified fields won't affect other options. @@ -163,22 +333,26 @@ func Options(opts ...Option) Option { // opts, err := yaml.OptsYAML(` // indent: 3 // known-fields: true +// plugin: +// limit: +// depth: 50 // `) // yaml.Dump(&data, yaml.Options(V4, opts)) func OptsYAML(yamlStr string) (Option, error) { var cfg struct { - Indent *int `yaml:"indent"` - CompactSeqIndent *bool `yaml:"compact-seq-indent"` - LineWidth *int `yaml:"line-width"` - Unicode *bool `yaml:"unicode"` - Canonical *bool `yaml:"canonical"` - LineBreak *string `yaml:"line-break"` - ExplicitStart *bool `yaml:"explicit-start"` - ExplicitEnd *bool `yaml:"explicit-end"` - FlowSimpleCollections *bool `yaml:"flow-simple-coll"` - KnownFields *bool `yaml:"known-fields"` - SingleDocument *bool `yaml:"single-document"` - UniqueKeys *bool `yaml:"unique-keys"` + Indent *int `yaml:"indent"` + CompactSeqIndent *bool `yaml:"compact-seq-indent"` + LineWidth *int `yaml:"line-width"` + Unicode *bool `yaml:"unicode"` + Canonical *bool `yaml:"canonical"` + LineBreak *string `yaml:"line-break"` + ExplicitStart *bool `yaml:"explicit-start"` + ExplicitEnd *bool `yaml:"explicit-end"` + FlowSimpleCollections *bool `yaml:"flow-simple-coll"` + KnownFields *bool `yaml:"known-fields"` + SingleDocument *bool `yaml:"single-document"` + UniqueKeys *bool `yaml:"unique-keys"` + Plugin map[string]any `yaml:"plugin"` } if err := Load([]byte(yamlStr), &cfg, WithKnownFields()); err != nil { return nil, err @@ -232,6 +406,28 @@ func OptsYAML(yamlStr string) (Option, error) { } } + for name, val := range cfg.Plugin { + switch name { + case "limit": + var cfgMap map[string]any + switch v := val.(type) { + case nil: + cfgMap = map[string]any{} + case map[string]any: + cfgMap = v + default: + return nil, fmt.Errorf("yaml: plugin %q value must be a mapping or null", name) + } + p, err := limit.NewFromYAML(cfgMap) + if err != nil { + return nil, err + } + optList = append(optList, WithPlugin(p)) + default: + return nil, fmt.Errorf("yaml: unknown plugin %q", name) + } + } + return Options(optList...), nil } @@ -239,60 +435,77 @@ func OptsYAML(yamlStr string) (Option, error) { // Type and constant re-exports //----------------------------------------------------------------------------- -type ( - // Node represents a YAML node in the document tree. - // See internal/libyaml.Node. - Node = libyaml.Node - // Kind identifies the type of a YAML node. - // See internal/libyaml.Kind. - Kind = libyaml.Kind - // Style controls the presentation of a YAML node. - // See internal/libyaml.Style. - Style = libyaml.Style - // Marshaler is implemented by types with custom YAML marshaling. - // See internal/libyaml.Marshaler. - Marshaler = libyaml.Marshaler - // IsZeroer is implemented by types that can report if they're zero. - // See internal/libyaml.IsZeroer. - IsZeroer = libyaml.IsZeroer -) - -// Unmarshaler is the interface implemented by types -// that can unmarshal a YAML description of themselves. -type Unmarshaler interface { - UnmarshalYAML(node *Node) error -} - // Re-export stream-related types type ( + Stream = libyaml.Stream VersionDirective = libyaml.StreamVersionDirective - TagDirective = libyaml.StreamTagDirective - Encoding = libyaml.Encoding + + // TagDirective represents a YAML %TAG directive for stream nodes. + TagDirective = libyaml.StreamTagDirective + + // Encoding represents the character encoding of a YAML stream. + Encoding = libyaml.Encoding ) -// Re-export encoding constants +// Encoding constants for YAML stream encoding const ( - EncodingAny = libyaml.ANY_ENCODING - EncodingUTF8 = libyaml.UTF8_ENCODING + // EncodingAny lets the parser choose the encoding. + EncodingAny = libyaml.ANY_ENCODING + + // EncodingUTF8 is the default UTF-8 encoding. + EncodingUTF8 = libyaml.UTF8_ENCODING + + // EncodingUTF16LE is UTF-16-LE encoding with BOM. EncodingUTF16LE = libyaml.UTF16LE_ENCODING + + // EncodingUTF16BE is UTF-16-BE encoding with BOM. EncodingUTF16BE = libyaml.UTF16BE_ENCODING ) -// Re-export error types -type ( +// Stage identifies the processing stage where an error occurred during YAML +// loading or dumping. +type Stage = libyaml.Stage +// Stage constants for YAML processing pipeline. +const ( + // Load stages + ReaderStage = libyaml.ReaderStage // Input reading and encoding + ScannerStage = libyaml.ScannerStage // Tokenization + ParserStage = libyaml.ParserStage // Event stream parsing + ComposerStage = libyaml.ComposerStage // Node tree construction + ResolverStage = libyaml.ResolverStage // Tag resolution + ConstructorStage = libyaml.ConstructorStage // Go value construction + + // Dump stages + RepresenterStage = libyaml.RepresenterStage // Go value to Node tree + SerializerStage = libyaml.SerializerStage // Node tree to events + EmitterStage = libyaml.EmitterStage // Events to YAML bytes + WriterStage = libyaml.WriterStage // Output writing +) + +// Mark represents a position in the YAML document. +type Mark = libyaml.Mark + +// Error types for YAML loading and dumping +type ( // LoadError represents an error encountered while decoding a YAML document. // // It contains details about the location in the document where the error - // occurred, as well as a descriptive message. - LoadError = libyaml.ConstructError + // occurred, as well as the processing stage that generated it. + LoadError = libyaml.LoadError // LoadErrors is returned when one or more fields cannot be properly decoded. // // It contains multiple *[LoadError] instances with details about each error. LoadErrors = libyaml.LoadErrors - // TypeError is an obsolete error type retained for compatibility. + // DumpError represents an error that occurred while dumping a YAML document. + // + // It identifies the processing stage where the error occurred and provides + // an optional underlying cause via Unwrap. + DumpError = libyaml.DumpError + + // TypeError is a legacy error type retained for compatibility. // // Deprecated: Use [LoadErrors] instead. // @@ -300,25 +513,13 @@ type ( TypeError = libyaml.TypeError ) -// Re-export Kind constants -const ( - DocumentNode = libyaml.DocumentNode - SequenceNode = libyaml.SequenceNode - MappingNode = libyaml.MappingNode - ScalarNode = libyaml.ScalarNode - AliasNode = libyaml.AliasNode - StreamNode = libyaml.StreamNode -) +// NewLoadError creates a LoadError with an underlying cause error. +// The cause is accessible via Unwrap for use with [errors.Is] and [errors.As]. +var NewLoadError = libyaml.NewLoadError -// Re-export Style constants -const ( - TaggedStyle = libyaml.TaggedStyle - DoubleQuotedStyle = libyaml.DoubleQuotedStyle - SingleQuotedStyle = libyaml.SingleQuotedStyle - LiteralStyle = libyaml.LiteralStyle - FoldedStyle = libyaml.FoldedStyle - FlowStyle = libyaml.FlowStyle -) +// NewDumpError creates a DumpError with an underlying cause error. +// The cause is accessible via Unwrap for use with [errors.Is] and [errors.As]. +var NewDumpError = libyaml.NewDumpError // LineBreak represents the line ending style for YAML output. type LineBreak = libyaml.LineBreak @@ -341,180 +542,37 @@ const ( ) //----------------------------------------------------------------------------- -// Helper functions +// Load/Dump API //----------------------------------------------------------------------------- -// The code in this section was copied from mgo/bson. +// Advanced streaming API types +type ( + // Loader reads and loads YAML values from an input stream with + // configurable options. + Loader = libyaml.Loader -var ( - structMap = make(map[reflect.Type]*structInfo) - fieldMapMutex sync.RWMutex - unmarshalerType reflect.Type + // Dumper writes YAML values to an output stream with configurable options. + Dumper = libyaml.Dumper ) -// structInfo holds details for the serialization of fields of -// a given struct. -type structInfo struct { - FieldsMap map[string]fieldInfo - FieldsList []fieldInfo - - // InlineMap is the number of the field in the struct that - // contains an ,inline map, or -1 if there's none. - InlineMap int - - // InlineUnmarshalers holds indexes to inlined fields that - // contain unmarshaler values. - InlineUnmarshalers [][]int +// NewLoader returns a new Loader that reads from r with the given options. +func NewLoader(r io.Reader, opts ...Option) (*Loader, error) { + return libyaml.NewLoader(r, opts...) } -type fieldInfo struct { - Key string - Num int - OmitEmpty bool - Flow bool - // Id holds the unique field identifier, so we can cheaply - // check for field duplicates without maintaining an extra map. - Id int - - // Inline holds the field index if the field is part of an inlined struct. - Inline []int +// NewDumper returns a new Dumper that writes to w with the given options. +func NewDumper(w io.Writer, opts ...Option) (*Dumper, error) { + return libyaml.NewDumper(w, opts...) } -func getStructInfo(st reflect.Type) (*structInfo, error) { - fieldMapMutex.RLock() - sinfo, found := structMap[st] - fieldMapMutex.RUnlock() - if found { - return sinfo, nil - } - - n := st.NumField() - fieldsMap := make(map[string]fieldInfo) - fieldsList := make([]fieldInfo, 0, n) - inlineMap := -1 - inlineUnmarshalers := [][]int(nil) - for i := 0; i != n; i++ { - field := st.Field(i) - if field.PkgPath != "" && !field.Anonymous { - continue // Private field - } - - info := fieldInfo{Num: i} - - tag := field.Tag.Get("yaml") - if tag == "" && !strings.Contains(string(field.Tag), ":") { - tag = string(field.Tag) - } - if tag == "-" { - continue - } - - inline := false - fields := strings.Split(tag, ",") - if len(fields) > 1 { - for _, flag := range fields[1:] { - switch flag { - case "omitempty": - info.OmitEmpty = true - case "flow": - info.Flow = true - case "inline": - inline = true - default: - return nil, fmt.Errorf("unsupported flag %q in tag %q of type %s", flag, tag, st) - } - } - tag = fields[0] - } - - if inline { - switch field.Type.Kind() { - case reflect.Map: - if inlineMap >= 0 { - return nil, errors.New("multiple ,inline maps in struct " + st.String()) - } - if field.Type.Key() != reflect.TypeOf("") { - return nil, errors.New("option ,inline needs a map with string keys in struct " + st.String()) - } - inlineMap = info.Num - case reflect.Struct, reflect.Pointer: - ftype := field.Type - for ftype.Kind() == reflect.Pointer { - ftype = ftype.Elem() - } - if ftype.Kind() != reflect.Struct { - return nil, errors.New("option ,inline may only be used on a struct or map field") - } - if reflect.PointerTo(ftype).Implements(unmarshalerType) { - inlineUnmarshalers = append(inlineUnmarshalers, []int{i}) - } else { - sinfo, err := getStructInfo(ftype) - if err != nil { - return nil, err - } - for _, index := range sinfo.InlineUnmarshalers { - inlineUnmarshalers = append(inlineUnmarshalers, append([]int{i}, index...)) - } - for _, finfo := range sinfo.FieldsList { - if _, found := fieldsMap[finfo.Key]; found { - msg := "duplicated key '" + finfo.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - if finfo.Inline == nil { - finfo.Inline = []int{i, finfo.Num} - } else { - finfo.Inline = append([]int{i}, finfo.Inline...) - } - finfo.Id = len(fieldsList) - fieldsMap[finfo.Key] = finfo - fieldsList = append(fieldsList, finfo) - } - } - default: - return nil, errors.New("option ,inline may only be used on a struct or map field") - } - continue - } - - if tag != "" { - info.Key = tag - } else { - info.Key = strings.ToLower(field.Name) - } - - if _, found = fieldsMap[info.Key]; found { - msg := "duplicated key '" + info.Key + "' in struct " + st.String() - return nil, errors.New(msg) - } - - info.Id = len(fieldsList) - fieldsList = append(fieldsList, info) - fieldsMap[info.Key] = info - } - - sinfo = &structInfo{ - FieldsMap: fieldsMap, - FieldsList: fieldsList, - InlineMap: inlineMap, - InlineUnmarshalers: inlineUnmarshalers, - } - - fieldMapMutex.Lock() - structMap[st] = sinfo - fieldMapMutex.Unlock() - return sinfo, nil +// Load loads YAML document(s) with the given options. +func Load(in []byte, out any, opts ...Option) error { + return libyaml.Load(in, out, opts...) } -var noWriter io.Writer - -func handleErr(err *error) { - if v := recover(); v != nil { - if e, ok := v.(*libyaml.YAMLError); ok { - *err = e.Err - } else { - panic(v) - } - } +// Dump encodes a value to YAML with the given options. +func Dump(in any, opts ...Option) (out []byte, err error) { + return libyaml.Dump(in, opts...) } //----------------------------------------------------------------------------- @@ -523,8 +581,7 @@ func handleErr(err *error) { // A Decoder reads and decodes YAML values from an input stream. type Decoder struct { - composer *libyaml.Composer - knownFields bool + loader *Loader } // NewDecoder returns a new decoder that reads from r. @@ -532,15 +589,15 @@ type Decoder struct { // The decoder introduces its own buffering and may read // data from r beyond the YAML values requested. func NewDecoder(r io.Reader) *Decoder { - return &Decoder{ - composer: libyaml.NewComposerFromReader(r), - } + // NewLoader won't return error with WithV3Defaults() and withFromLegacy + loader, _ := NewLoader(r, WithV3Defaults(), withFromLegacy()) + return &Decoder{loader: loader} } // KnownFields ensures that the keys in decoded mappings to // exist as fields in the struct being decoded into. func (dec *Decoder) KnownFields(enable bool) { - dec.knownFields = enable + dec.loader.SetKnownFields(enable) } // Decode reads the next YAML-encoded value from its input @@ -548,37 +605,22 @@ func (dec *Decoder) KnownFields(enable bool) { // // See the documentation for Unmarshal for details about the // conversion of YAML into a Go value. -func (dec *Decoder) Decode(v any) (err error) { - d := libyaml.NewConstructor(libyaml.DefaultOptions) - d.KnownFields = dec.knownFields - defer handleErr(&err) - node := dec.composer.Parse() - if node == nil { - return io.EOF - } - out := reflect.ValueOf(v) - if out.Kind() == reflect.Pointer && !out.IsNil() { - out = out.Elem() - } - d.Construct(node, out) - if len(d.TypeErrors) > 0 { - return &LoadErrors{Errors: d.TypeErrors} - } - return nil +func (dec *Decoder) Decode(v any) error { + return dec.loader.Load(v) } // An Encoder writes YAML values to an output stream. type Encoder struct { - encoder *libyaml.Representer + dumper *Dumper } // NewEncoder returns a new encoder that writes to w. // The Encoder should be closed after use to flush all data // to w. func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ - encoder: libyaml.NewRepresenter(w, libyaml.DefaultOptions), - } + // NewDumper won't return an error when using WithV3Defaults() + dumper, _ := NewDumper(w, WithV3Defaults()) + return &Encoder{dumper: dumper} } // Encode writes the YAML encoding of v to the stream. @@ -588,36 +630,29 @@ func NewEncoder(w io.Writer) *Encoder { // // See the documentation for Marshal for details about the conversion of Go // values to YAML. -func (e *Encoder) Encode(v any) (err error) { - defer handleErr(&err) - e.encoder.MarshalDoc("", reflect.ValueOf(v)) - return nil +func (e *Encoder) Encode(v any) error { + return e.dumper.Dump(v) } // SetIndent changes the used indentation used when encoding. func (e *Encoder) SetIndent(spaces int) { - if spaces < 0 { - panic("yaml: cannot indent to a negative number of spaces") - } - e.encoder.Indent = spaces + e.dumper.SetIndent(spaces) } // CompactSeqIndent makes it so that '- ' is considered part of the indentation. func (e *Encoder) CompactSeqIndent() { - e.encoder.Emitter.CompactSequenceIndent = true + e.dumper.SetCompactSeqIndent(true) } // DefaultSeqIndent makes it so that '- ' is not considered part of the indentation. func (e *Encoder) DefaultSeqIndent() { - e.encoder.Emitter.CompactSequenceIndent = false + e.dumper.SetCompactSeqIndent(false) } // Close closes the encoder by writing any remaining data. // It does not write a stream terminating string "...". -func (e *Encoder) Close() (err error) { - defer handleErr(&err) - e.encoder.Finish() - return nil +func (e *Encoder) Close() error { + return e.dumper.Close() } // Unmarshal decodes the first document found within the in byte slice @@ -654,28 +689,17 @@ func (e *Encoder) Close() (err error) { // See the documentation of Marshal for the format of tags and a list of // supported tag options. func Unmarshal(in []byte, out any) (err error) { - return unmarshal(in, out, V3) + return Load(in, out, WithV3Defaults(), withFromLegacy()) } -func unmarshal(in []byte, out any, opts ...Option) (err error) { - defer handleErr(&err) - o, err := libyaml.ApplyOptions(opts...) - if err != nil { - return err - } - - // Check if out implements yaml.Unmarshaler - if u, ok := out.(Unmarshaler); ok { - p := libyaml.NewComposer(in) - defer p.Destroy() - node := p.Parse() - if node != nil { - return u.UnmarshalYAML(node) - } +// withFromLegacy is a private option that indicates this call is from +// a legacy API (Unmarshal/Decoder). It enables Unmarshaler interface +// checking and allows trailing content for backward compatibility. +func withFromLegacy() Option { + return func(o *libyaml.Options) error { + o.FromLegacy = true return nil } - - return libyaml.Construct(in, out, o) } // Marshal serializes the value provided into a YAML document. The structure @@ -722,11 +746,6 @@ func unmarshal(in []byte, out any, opts ...Option) (err error) { // yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" // yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" func Marshal(in any) (out []byte, err error) { - defer handleErr(&err) - e := libyaml.NewRepresenter(noWriter, libyaml.DefaultOptions) - defer e.Destroy() - e.MarshalDoc("", reflect.ValueOf(in)) - e.Finish() - out = e.Out - return out, err + // Use WithV3Defaults() with unlimited line width to match legacy DefaultOptions + return Dump(in, WithV3Defaults(), WithLineWidth(-1)) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 1c12eed..a78519a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -8,7 +8,7 @@ github.com/bahlo/generic-list-go # github.com/buger/jsonparser v1.1.2 ## explicit; go 1.13 github.com/buger/jsonparser -# github.com/cloudbase/garm-provider-common v0.1.9 +# github.com/cloudbase/garm-provider-common v0.1.10-0.20261111212522-a63fbe8afd51 ## explicit; go 1.25.0 github.com/cloudbase/garm-provider-common/cloudconfig github.com/cloudbase/garm-provider-common/defaults @@ -19,8 +19,8 @@ github.com/cloudbase/garm-provider-common/execution/v0.1.0 github.com/cloudbase/garm-provider-common/execution/v0.1.1 github.com/cloudbase/garm-provider-common/params github.com/cloudbase/garm-provider-common/util -# github.com/felixge/httpsnoop v1.0.4 -## explicit; go 1.13 +# github.com/felixge/httpsnoop v1.1.0 +## explicit; go 1.25 github.com/felixge/httpsnoop # github.com/gofrs/uuid/v5 v5.4.0 ## explicit; go 1.19 @@ -57,10 +57,10 @@ github.com/gorilla/handlers # github.com/invopop/jsonschema v0.14.0 ## explicit; go 1.24 github.com/invopop/jsonschema -# github.com/mattn/go-isatty v0.0.21 +# github.com/mattn/go-isatty v0.0.22 ## explicit; go 1.21 github.com/mattn/go-isatty -# github.com/minio/sio v0.4.3 +# github.com/minio/sio v0.5.1 ## explicit; go 1.24.0 github.com/minio/sio # github.com/pb33f/ordered-map/v2 v2.3.1 @@ -94,10 +94,11 @@ github.com/xeipuuv/gojsonschema # go.yaml.in/yaml/v3 v3.0.5 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# go.yaml.in/yaml/v4 v4.0.0-rc.4 +# go.yaml.in/yaml/v4 v4.0.0-rc.6 ## explicit; go 1.18 go.yaml.in/yaml/v4 go.yaml.in/yaml/v4/internal/libyaml +go.yaml.in/yaml/v4/plugin/limit # golang.org/x/crypto v0.55.0 ## explicit; go 1.25.0 golang.org/x/crypto/bcrypt From dba62302320ba6214c84bc77122f4c70ddcb0ffb Mon Sep 17 00:00:00 2001 From: Christopher Bartz Date: Mon, 16 Nov 2026 14:48:40 +0000 Subject: [PATCH 2/2] test(provider): cover tools selection for every supported architecture --- provider/spec_test.go | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/provider/spec_test.go b/provider/spec_test.go index 3239f23..7395fd4 100644 --- a/provider/spec_test.go +++ b/provider/spec_test.go @@ -20,6 +20,7 @@ import ( "github.com/cloudbase/garm-provider-common/cloudconfig" "github.com/cloudbase/garm-provider-common/params" + "github.com/cloudbase/garm-provider-common/util" "github.com/gophercloud/gophercloud/v2/openstack/compute/v2/servers" "github.com/stretchr/testify/assert" @@ -557,6 +558,62 @@ func TestNewMachineSpec(t *testing.T) { assert.Equal(t, expectedOutput, spec) } +// TestNewMachineSpecSelectsToolsForArch checks that the machine spec takes +// the runner tools matching the requested architecture from the list GARM +// passes, including architectures whose tools only third parties publish. +func TestNewMachineSpecSelectsToolsForArch(t *testing.T) { + // TestNewMachineSpec replaces DefaultToolFetch with a stub; use the real one. + DefaultToolFetch = util.GetTools + cfg := &config.Config{ + Cloud: "mycloud", + Credentials: config.Credentials{ + Clouds: "../testdata/clouds.yaml", + }, + DefaultNetworkID: "network", + } + tools := []params.RunnerApplicationDownload{} + for _, arch := range []string{"x64", "arm64", "arm", "ppc64le", "s390x"} { + tools = append(tools, params.RunnerApplicationDownload{ + OS: Ptr("linux"), + Architecture: Ptr(arch), + DownloadURL: Ptr("https://example.com/actions-runner-linux-" + arch + ".tar.gz"), + Filename: Ptr("actions-runner-linux-" + arch + ".tar.gz"), + }) + } + + tests := []struct { + osArch params.OSArch + wantArch string + }{ + {osArch: params.Amd64, wantArch: "x64"}, + {osArch: params.Arm64, wantArch: "arm64"}, + {osArch: params.Arm, wantArch: "arm"}, + {osArch: params.Ppc64le, wantArch: "ppc64le"}, + {osArch: params.S390x, wantArch: "s390x"}, + } + + for _, tt := range tests { + t.Run(string(tt.osArch), func(t *testing.T) { + data := params.BootstrapInstance{ + Name: "test-instance", + OSArch: tt.osArch, + OSType: params.Linux, + Flavor: "m1.small", + Image: "ubuntu-24.04", + Tools: tools, + PoolID: "test-pool", + } + + spec, err := NewMachineSpec(data, cfg, "controllerID") + assert.NoError(t, err) + if assert.NotNil(t, spec) { + assert.Equal(t, tt.wantArch, spec.Tools.GetArchitecture()) + assert.Equal(t, string(tt.osArch), spec.Properties["os_arch"]) + } + }) + } +} + func TestGetBootFromVolumeOpts(t *testing.T) { srvOpts := servers.CreateOpts{ Name: "runner",