From a910a6022cd6f51c886b42443f08ada9ee548040 Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Tue, 9 Apr 2019 19:30:50 -0400 Subject: Update deps Signed-off-by: Dave Henderson --- vendor/github.com/aws/aws-sdk-go/NOTICE.txt | 2 +- .../github.com/aws/aws-sdk-go/aws/awsutil/equal.go | 2 +- .../credentials/stscreds/assume_role_provider.go | 5 +- .../aws/aws-sdk-go/aws/ec2metadata/api.go | 9 +- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 76 +- .../aws/aws-sdk-go/aws/request/retryer.go | 1 + vendor/github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go | 7 +- .../github.com/aws/aws-sdk-go/service/ec2/api.go | 3004 +++++++- .../github.com/aws/aws-sdk-go/service/ssm/api.go | 875 ++- .../aws/aws-sdk-go/service/ssm/errors.go | 7 + .../github.com/aws/aws-sdk-go/service/sts/api.go | 3 + .../aws/aws-sdk-go/service/sts/customizations.go | 12 - vendor/github.com/fullsailor/pkcs7/ber.go | 6 +- vendor/github.com/hashicorp/consul/api/agent.go | 55 +- vendor/github.com/hashicorp/consul/api/api.go | 2 +- .../hashicorp/consul/api/prepared_query.go | 5 + .../consul/ui-v2/lib/block-slots/LICENSE.md | 21 + .../github.com/hashicorp/go-cleanhttp/handlers.go | 23 +- .../hashicorp/go-retryablehttp/client.go | 12 +- vendor/github.com/hashicorp/vault/api/client.go | 49 +- .../hashicorp/vault/api/output_string.go | 4 +- vendor/github.com/hashicorp/vault/api/secret.go | 1 + .../hashicorp/vault/helper/consts/agent.go | 5 + .../hashicorp/vault/helper/consts/replication.go | 30 + vendor/github.com/pierrec/lz4/reader.go | 3 + vendor/github.com/spf13/afero/unionFile.go | 10 +- vendor/github.com/ugorji/go/codec/0_importpath.go | 7 + vendor/github.com/ugorji/go/codec/0doc.go | 2 +- vendor/github.com/ugorji/go/codec/binc.go | 3 +- vendor/github.com/ugorji/go/codec/cbor.go | 6 +- vendor/github.com/ugorji/go/codec/decode.go | 61 +- vendor/github.com/ugorji/go/codec/encode.go | 242 +- .../ugorji/go/codec/fast-path.generated.go | 8064 ++++++++------------ .../ugorji/go/codec/gen-helper.generated.go | 16 +- vendor/github.com/ugorji/go/codec/gen.go | 8 +- vendor/github.com/ugorji/go/codec/helper.go | 11 +- .../ugorji/go/codec/helper_not_unsafe.go | 7 +- vendor/github.com/ugorji/go/codec/helper_unsafe.go | 7 +- vendor/github.com/ugorji/go/codec/msgpack.go | 127 +- vendor/github.com/ugorji/go/codec/simple.go | 5 +- 41 files changed, 7604 insertions(+), 5193 deletions(-) delete mode 100644 vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go create mode 100644 vendor/github.com/hashicorp/consul/ui-v2/lib/block-slots/LICENSE.md create mode 100644 vendor/github.com/hashicorp/vault/helper/consts/agent.go create mode 100644 vendor/github.com/ugorji/go/codec/0_importpath.go (limited to 'vendor/github.com') diff --git a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt index 5f14d116..899129ec 100644 --- a/vendor/github.com/aws/aws-sdk-go/NOTICE.txt +++ b/vendor/github.com/aws/aws-sdk-go/NOTICE.txt @@ -1,3 +1,3 @@ AWS SDK for Go -Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved. Copyright 2014-2015 Stripe, Inc. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go index 59fa4a55..142a7a01 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/equal.go @@ -15,7 +15,7 @@ func DeepEqual(a, b interface{}) bool { rb := reflect.Indirect(reflect.ValueOf(b)) if raValid, rbValid := ra.IsValid(), rb.IsValid(); !raValid && !rbValid { - // If the elements are both nil, and of the same type the are equal + // If the elements are both nil, and of the same type they are equal // If they are of different types they are not equal return reflect.TypeOf(a) == reflect.TypeOf(b) } else if raValid != rbValid { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index 4108e433..0d1b5504 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -80,6 +80,7 @@ package stscreds import ( "fmt" + "os" "time" "github.com/aws/aws-sdk-go/aws" @@ -89,7 +90,7 @@ import ( "github.com/aws/aws-sdk-go/service/sts" ) -// StdinTokenProvider will prompt on stdout and read from stdin for a string value. +// StdinTokenProvider will prompt on stderr and read from stdin for a string value. // An error is returned if reading from stdin fails. // // Use this function go read MFA tokens from stdin. The function makes no attempt @@ -102,7 +103,7 @@ import ( // Will wait forever until something is provided on the stdin. func StdinTokenProvider() (string, error) { var v string - fmt.Printf("Assume Role MFA token code: ") + fmt.Fprintf(os.Stderr, "Assume Role MFA token code: ") _, err := fmt.Scanln(&v) return v, err diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index 88e2fc70..d57a1af5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -24,8 +24,9 @@ func (c *EC2Metadata) GetMetadata(p string) (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) + err := req.Send() - return output.Content, req.Send() + return output.Content, err } // GetUserData returns the userdata that was configured for the service. If @@ -45,8 +46,9 @@ func (c *EC2Metadata) GetUserData() (string, error) { r.Error = awserr.New("NotFoundError", "user-data not found", r.Error) } }) + err := req.Send() - return output.Content, req.Send() + return output.Content, err } // GetDynamicData uses the path provided to request information from the EC2 @@ -61,8 +63,9 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) + err := req.Send() - return output.Content, req.Send() + return output.Content, err } // GetInstanceIdentityDocument retrieves an identity document describing an diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 5d024dc8..d020c66c 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -426,6 +426,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -439,6 +440,7 @@ var awsPartition = partition{ "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, @@ -904,11 +906,21 @@ var awsPartition = partition{ "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, + "comprehendmedical": service{ + + Endpoints: endpoints{ + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -1034,6 +1046,12 @@ var awsPartition = partition{ "docdb": service{ Endpoints: endpoints{ + "eu-central-1": endpoint{ + Hostname: "rds.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, "eu-west-1": endpoint{ Hostname: "rds.eu-west-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1395,10 +1413,11 @@ var awsPartition = partition{ "fsx": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "gamelift": service{ @@ -1614,6 +1633,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, @@ -1736,6 +1756,25 @@ var awsPartition = partition{ "us-east-1": endpoint{}, }, }, + "mediaconnect": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "mediaconvert": service{ Endpoints: endpoints{ @@ -1748,6 +1787,7 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1880,6 +1920,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1905,6 +1946,12 @@ var awsPartition = partition{ Region: "ap-northeast-1", }, }, + "ap-south-1": endpoint{ + Hostname: "rds.ap-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, "ap-southeast-1": endpoint{ Hostname: "rds.ap-southeast-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2517,6 +2564,9 @@ var awsPartition = partition{ "eu-west-2": endpoint{ Protocols: []string{"https"}, }, + "eu-west-3": endpoint{ + Protocols: []string{"https"}, + }, "sa-east-1": endpoint{ Protocols: []string{"https"}, }, @@ -2987,9 +3037,13 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -3640,6 +3694,14 @@ var awsusgovPartition = partition{ }, }, }, + "comprehend": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -4080,6 +4142,12 @@ var awsusgovPartition = partition{ }, }, }, + "waf-regional": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "workspaces": service{ Endpoints: endpoints{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go index 7bc5da78..d0aa54c6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/retryer.go @@ -38,6 +38,7 @@ var throttleCodes = map[string]struct{}{ "ThrottlingException": {}, "RequestLimitExceeded": {}, "RequestThrottled": {}, + "RequestThrottledException": {}, "TooManyRequestsException": {}, // Lambda functions "PriorRequestNotComplete": {}, // Route53 "TransactionInProgressException": {}, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index c1b6a9ef..1d96f9c0 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.17.9" +const SDKVersion = "1.19.11" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go index 9a7ba27a..36ceab08 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/jsonrpc.go @@ -52,9 +52,12 @@ func Build(req *request.Request) { target := req.ClientInfo.TargetPrefix + "." + req.Operation.Name req.HTTPRequest.Header.Add("X-Amz-Target", target) } - if req.ClientInfo.JSONVersion != "" { + + // Only set the content type if one is not already specified and an + // JSONVersion is specified. + if ct, v := req.HTTPRequest.Header.Get("Content-Type"), req.ClientInfo.JSONVersion; len(ct) == 0 && len(v) != 0 { jsonVersion := req.ClientInfo.JSONVersion - req.HTTPRequest.Header.Add("Content-Type", "application/x-amz-json-"+jsonVersion) + req.HTTPRequest.Header.Set("Content-Type", "application/x-amz-json-"+jsonVersion) } } diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index 7b68164e..b086c93e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -10479,6 +10479,12 @@ func (c *EC2) DescribeByoipCidrsRequest(input *DescribeByoipCidrsInput) (req *re Name: opDescribeByoipCidrs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10525,6 +10531,56 @@ func (c *EC2) DescribeByoipCidrsWithContext(ctx aws.Context, input *DescribeByoi return out, req.Send() } +// DescribeByoipCidrsPages iterates over the pages of a DescribeByoipCidrs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeByoipCidrs method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeByoipCidrs operation. +// pageNum := 0 +// err := client.DescribeByoipCidrsPages(params, +// func(page *DescribeByoipCidrsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeByoipCidrsPages(input *DescribeByoipCidrsInput, fn func(*DescribeByoipCidrsOutput, bool) bool) error { + return c.DescribeByoipCidrsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeByoipCidrsPagesWithContext same as DescribeByoipCidrsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeByoipCidrsPagesWithContext(ctx aws.Context, input *DescribeByoipCidrsInput, fn func(*DescribeByoipCidrsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeByoipCidrsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeByoipCidrsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeByoipCidrsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeCapacityReservations = "DescribeCapacityReservations" // DescribeCapacityReservationsRequest generates a "aws/request.Request" representing the @@ -10556,6 +10612,12 @@ func (c *EC2) DescribeCapacityReservationsRequest(input *DescribeCapacityReserva Name: opDescribeCapacityReservations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10600,6 +10662,56 @@ func (c *EC2) DescribeCapacityReservationsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeCapacityReservationsPages iterates over the pages of a DescribeCapacityReservations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeCapacityReservations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeCapacityReservations operation. +// pageNum := 0 +// err := client.DescribeCapacityReservationsPages(params, +// func(page *DescribeCapacityReservationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeCapacityReservationsPages(input *DescribeCapacityReservationsInput, fn func(*DescribeCapacityReservationsOutput, bool) bool) error { + return c.DescribeCapacityReservationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeCapacityReservationsPagesWithContext same as DescribeCapacityReservationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeCapacityReservationsPagesWithContext(ctx aws.Context, input *DescribeCapacityReservationsInput, fn func(*DescribeCapacityReservationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCapacityReservationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCapacityReservationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeCapacityReservationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClassicLinkInstances = "DescribeClassicLinkInstances" // DescribeClassicLinkInstancesRequest generates a "aws/request.Request" representing the @@ -10631,6 +10743,12 @@ func (c *EC2) DescribeClassicLinkInstancesRequest(input *DescribeClassicLinkInst Name: opDescribeClassicLinkInstances, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10677,6 +10795,56 @@ func (c *EC2) DescribeClassicLinkInstancesWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeClassicLinkInstancesPages iterates over the pages of a DescribeClassicLinkInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClassicLinkInstances method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeClassicLinkInstances operation. +// pageNum := 0 +// err := client.DescribeClassicLinkInstancesPages(params, +// func(page *DescribeClassicLinkInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClassicLinkInstancesPages(input *DescribeClassicLinkInstancesInput, fn func(*DescribeClassicLinkInstancesOutput, bool) bool) error { + return c.DescribeClassicLinkInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClassicLinkInstancesPagesWithContext same as DescribeClassicLinkInstancesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeClassicLinkInstancesPagesWithContext(ctx aws.Context, input *DescribeClassicLinkInstancesInput, fn func(*DescribeClassicLinkInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClassicLinkInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClassicLinkInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClassicLinkInstancesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnAuthorizationRules = "DescribeClientVpnAuthorizationRules" // DescribeClientVpnAuthorizationRulesRequest generates a "aws/request.Request" representing the @@ -10708,6 +10876,12 @@ func (c *EC2) DescribeClientVpnAuthorizationRulesRequest(input *DescribeClientVp Name: opDescribeClientVpnAuthorizationRules, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10751,6 +10925,56 @@ func (c *EC2) DescribeClientVpnAuthorizationRulesWithContext(ctx aws.Context, in return out, req.Send() } +// DescribeClientVpnAuthorizationRulesPages iterates over the pages of a DescribeClientVpnAuthorizationRules operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnAuthorizationRules method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeClientVpnAuthorizationRules operation. +// pageNum := 0 +// err := client.DescribeClientVpnAuthorizationRulesPages(params, +// func(page *DescribeClientVpnAuthorizationRulesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnAuthorizationRulesPages(input *DescribeClientVpnAuthorizationRulesInput, fn func(*DescribeClientVpnAuthorizationRulesOutput, bool) bool) error { + return c.DescribeClientVpnAuthorizationRulesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnAuthorizationRulesPagesWithContext same as DescribeClientVpnAuthorizationRulesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeClientVpnAuthorizationRulesPagesWithContext(ctx aws.Context, input *DescribeClientVpnAuthorizationRulesInput, fn func(*DescribeClientVpnAuthorizationRulesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnAuthorizationRulesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnAuthorizationRulesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnAuthorizationRulesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnConnections = "DescribeClientVpnConnections" // DescribeClientVpnConnectionsRequest generates a "aws/request.Request" representing the @@ -10782,6 +11006,12 @@ func (c *EC2) DescribeClientVpnConnectionsRequest(input *DescribeClientVpnConnec Name: opDescribeClientVpnConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10826,6 +11056,56 @@ func (c *EC2) DescribeClientVpnConnectionsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeClientVpnConnectionsPages iterates over the pages of a DescribeClientVpnConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnConnections method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeClientVpnConnections operation. +// pageNum := 0 +// err := client.DescribeClientVpnConnectionsPages(params, +// func(page *DescribeClientVpnConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnConnectionsPages(input *DescribeClientVpnConnectionsInput, fn func(*DescribeClientVpnConnectionsOutput, bool) bool) error { + return c.DescribeClientVpnConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnConnectionsPagesWithContext same as DescribeClientVpnConnectionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeClientVpnConnectionsPagesWithContext(ctx aws.Context, input *DescribeClientVpnConnectionsInput, fn func(*DescribeClientVpnConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnConnectionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnEndpoints = "DescribeClientVpnEndpoints" // DescribeClientVpnEndpointsRequest generates a "aws/request.Request" representing the @@ -10857,6 +11137,12 @@ func (c *EC2) DescribeClientVpnEndpointsRequest(input *DescribeClientVpnEndpoint Name: opDescribeClientVpnEndpoints, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10900,6 +11186,56 @@ func (c *EC2) DescribeClientVpnEndpointsWithContext(ctx aws.Context, input *Desc return out, req.Send() } +// DescribeClientVpnEndpointsPages iterates over the pages of a DescribeClientVpnEndpoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnEndpoints method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeClientVpnEndpoints operation. +// pageNum := 0 +// err := client.DescribeClientVpnEndpointsPages(params, +// func(page *DescribeClientVpnEndpointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnEndpointsPages(input *DescribeClientVpnEndpointsInput, fn func(*DescribeClientVpnEndpointsOutput, bool) bool) error { + return c.DescribeClientVpnEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnEndpointsPagesWithContext same as DescribeClientVpnEndpointsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeClientVpnEndpointsPagesWithContext(ctx aws.Context, input *DescribeClientVpnEndpointsInput, fn func(*DescribeClientVpnEndpointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnEndpointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnEndpointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnEndpointsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnRoutes = "DescribeClientVpnRoutes" // DescribeClientVpnRoutesRequest generates a "aws/request.Request" representing the @@ -10931,6 +11267,12 @@ func (c *EC2) DescribeClientVpnRoutesRequest(input *DescribeClientVpnRoutesInput Name: opDescribeClientVpnRoutes, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -10974,6 +11316,56 @@ func (c *EC2) DescribeClientVpnRoutesWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeClientVpnRoutesPages iterates over the pages of a DescribeClientVpnRoutes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnRoutes method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeClientVpnRoutes operation. +// pageNum := 0 +// err := client.DescribeClientVpnRoutesPages(params, +// func(page *DescribeClientVpnRoutesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnRoutesPages(input *DescribeClientVpnRoutesInput, fn func(*DescribeClientVpnRoutesOutput, bool) bool) error { + return c.DescribeClientVpnRoutesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnRoutesPagesWithContext same as DescribeClientVpnRoutesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeClientVpnRoutesPagesWithContext(ctx aws.Context, input *DescribeClientVpnRoutesInput, fn func(*DescribeClientVpnRoutesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnRoutesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnRoutesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnRoutesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeClientVpnTargetNetworks = "DescribeClientVpnTargetNetworks" // DescribeClientVpnTargetNetworksRequest generates a "aws/request.Request" representing the @@ -11005,6 +11397,12 @@ func (c *EC2) DescribeClientVpnTargetNetworksRequest(input *DescribeClientVpnTar Name: opDescribeClientVpnTargetNetworks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11048,6 +11446,56 @@ func (c *EC2) DescribeClientVpnTargetNetworksWithContext(ctx aws.Context, input return out, req.Send() } +// DescribeClientVpnTargetNetworksPages iterates over the pages of a DescribeClientVpnTargetNetworks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeClientVpnTargetNetworks method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeClientVpnTargetNetworks operation. +// pageNum := 0 +// err := client.DescribeClientVpnTargetNetworksPages(params, +// func(page *DescribeClientVpnTargetNetworksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeClientVpnTargetNetworksPages(input *DescribeClientVpnTargetNetworksInput, fn func(*DescribeClientVpnTargetNetworksOutput, bool) bool) error { + return c.DescribeClientVpnTargetNetworksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeClientVpnTargetNetworksPagesWithContext same as DescribeClientVpnTargetNetworksPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeClientVpnTargetNetworksPagesWithContext(ctx aws.Context, input *DescribeClientVpnTargetNetworksInput, fn func(*DescribeClientVpnTargetNetworksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeClientVpnTargetNetworksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeClientVpnTargetNetworksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeClientVpnTargetNetworksOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeConversionTasks = "DescribeConversionTasks" // DescribeConversionTasksRequest generates a "aws/request.Request" representing the @@ -11311,6 +11759,12 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysRequest(input *DescribeEgressOnl Name: opDescribeEgressOnlyInternetGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11354,6 +11808,56 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysWithContext(ctx aws.Context, inp return out, req.Send() } +// DescribeEgressOnlyInternetGatewaysPages iterates over the pages of a DescribeEgressOnlyInternetGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeEgressOnlyInternetGateways method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeEgressOnlyInternetGateways operation. +// pageNum := 0 +// err := client.DescribeEgressOnlyInternetGatewaysPages(params, +// func(page *DescribeEgressOnlyInternetGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeEgressOnlyInternetGatewaysPages(input *DescribeEgressOnlyInternetGatewaysInput, fn func(*DescribeEgressOnlyInternetGatewaysOutput, bool) bool) error { + return c.DescribeEgressOnlyInternetGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeEgressOnlyInternetGatewaysPagesWithContext same as DescribeEgressOnlyInternetGatewaysPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeEgressOnlyInternetGatewaysPagesWithContext(ctx aws.Context, input *DescribeEgressOnlyInternetGatewaysInput, fn func(*DescribeEgressOnlyInternetGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeEgressOnlyInternetGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeEgressOnlyInternetGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeEgressOnlyInternetGatewaysOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeElasticGpus = "DescribeElasticGpus" // DescribeElasticGpusRequest generates a "aws/request.Request" representing the @@ -11683,6 +12187,12 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re Name: opDescribeFleets, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11726,6 +12236,56 @@ func (c *EC2) DescribeFleetsWithContext(ctx aws.Context, input *DescribeFleetsIn return out, req.Send() } +// DescribeFleetsPages iterates over the pages of a DescribeFleets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFleets method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeFleets operation. +// pageNum := 0 +// err := client.DescribeFleetsPages(params, +// func(page *DescribeFleetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFleetsPages(input *DescribeFleetsInput, fn func(*DescribeFleetsOutput, bool) bool) error { + return c.DescribeFleetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFleetsPagesWithContext same as DescribeFleetsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeFleetsPagesWithContext(ctx aws.Context, input *DescribeFleetsInput, fn func(*DescribeFleetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFleetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFleetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeFleetsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeFlowLogs = "DescribeFlowLogs" // DescribeFlowLogsRequest generates a "aws/request.Request" representing the @@ -11757,6 +12317,12 @@ func (c *EC2) DescribeFlowLogsRequest(input *DescribeFlowLogsInput) (req *reques Name: opDescribeFlowLogs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11802,6 +12368,56 @@ func (c *EC2) DescribeFlowLogsWithContext(ctx aws.Context, input *DescribeFlowLo return out, req.Send() } +// DescribeFlowLogsPages iterates over the pages of a DescribeFlowLogs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFlowLogs method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeFlowLogs operation. +// pageNum := 0 +// err := client.DescribeFlowLogsPages(params, +// func(page *DescribeFlowLogsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFlowLogsPages(input *DescribeFlowLogsInput, fn func(*DescribeFlowLogsOutput, bool) bool) error { + return c.DescribeFlowLogsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFlowLogsPagesWithContext same as DescribeFlowLogsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeFlowLogsPagesWithContext(ctx aws.Context, input *DescribeFlowLogsInput, fn func(*DescribeFlowLogsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFlowLogsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFlowLogsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeFlowLogsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeFpgaImageAttribute = "DescribeFpgaImageAttribute" // DescribeFpgaImageAttributeRequest generates a "aws/request.Request" representing the @@ -11907,6 +12523,12 @@ func (c *EC2) DescribeFpgaImagesRequest(input *DescribeFpgaImagesInput) (req *re Name: opDescribeFpgaImages, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -11952,6 +12574,56 @@ func (c *EC2) DescribeFpgaImagesWithContext(ctx aws.Context, input *DescribeFpga return out, req.Send() } +// DescribeFpgaImagesPages iterates over the pages of a DescribeFpgaImages operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFpgaImages method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeFpgaImages operation. +// pageNum := 0 +// err := client.DescribeFpgaImagesPages(params, +// func(page *DescribeFpgaImagesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFpgaImagesPages(input *DescribeFpgaImagesInput, fn func(*DescribeFpgaImagesOutput, bool) bool) error { + return c.DescribeFpgaImagesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFpgaImagesPagesWithContext same as DescribeFpgaImagesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeFpgaImagesPagesWithContext(ctx aws.Context, input *DescribeFpgaImagesInput, fn func(*DescribeFpgaImagesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFpgaImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFpgaImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeFpgaImagesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeHostReservationOfferings = "DescribeHostReservationOfferings" // DescribeHostReservationOfferingsRequest generates a "aws/request.Request" representing the @@ -11983,6 +12655,12 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva Name: opDescribeHostReservationOfferings, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12034,6 +12712,56 @@ func (c *EC2) DescribeHostReservationOfferingsWithContext(ctx aws.Context, input return out, req.Send() } +// DescribeHostReservationOfferingsPages iterates over the pages of a DescribeHostReservationOfferings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeHostReservationOfferings method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeHostReservationOfferings operation. +// pageNum := 0 +// err := client.DescribeHostReservationOfferingsPages(params, +// func(page *DescribeHostReservationOfferingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeHostReservationOfferingsPages(input *DescribeHostReservationOfferingsInput, fn func(*DescribeHostReservationOfferingsOutput, bool) bool) error { + return c.DescribeHostReservationOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeHostReservationOfferingsPagesWithContext same as DescribeHostReservationOfferingsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeHostReservationOfferingsPagesWithContext(ctx aws.Context, input *DescribeHostReservationOfferingsInput, fn func(*DescribeHostReservationOfferingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHostReservationOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHostReservationOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHostReservationOfferingsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeHostReservations = "DescribeHostReservations" // DescribeHostReservationsRequest generates a "aws/request.Request" representing the @@ -12065,6 +12793,12 @@ func (c *EC2) DescribeHostReservationsRequest(input *DescribeHostReservationsInp Name: opDescribeHostReservations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12108,6 +12842,56 @@ func (c *EC2) DescribeHostReservationsWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeHostReservationsPages iterates over the pages of a DescribeHostReservations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeHostReservations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeHostReservations operation. +// pageNum := 0 +// err := client.DescribeHostReservationsPages(params, +// func(page *DescribeHostReservationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeHostReservationsPages(input *DescribeHostReservationsInput, fn func(*DescribeHostReservationsOutput, bool) bool) error { + return c.DescribeHostReservationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeHostReservationsPagesWithContext same as DescribeHostReservationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeHostReservationsPagesWithContext(ctx aws.Context, input *DescribeHostReservationsInput, fn func(*DescribeHostReservationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHostReservationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHostReservationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHostReservationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeHosts = "DescribeHosts" // DescribeHostsRequest generates a "aws/request.Request" representing the @@ -12139,6 +12923,12 @@ func (c *EC2) DescribeHostsRequest(input *DescribeHostsInput) (req *request.Requ Name: opDescribeHosts, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12186,6 +12976,56 @@ func (c *EC2) DescribeHostsWithContext(ctx aws.Context, input *DescribeHostsInpu return out, req.Send() } +// DescribeHostsPages iterates over the pages of a DescribeHosts operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeHosts method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeHosts operation. +// pageNum := 0 +// err := client.DescribeHostsPages(params, +// func(page *DescribeHostsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeHostsPages(input *DescribeHostsInput, fn func(*DescribeHostsOutput, bool) bool) error { + return c.DescribeHostsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeHostsPagesWithContext same as DescribeHostsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeHostsPagesWithContext(ctx aws.Context, input *DescribeHostsInput, fn func(*DescribeHostsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeHostsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeHostsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeHostsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" // DescribeIamInstanceProfileAssociationsRequest generates a "aws/request.Request" representing the @@ -12217,6 +13057,12 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamIn Name: opDescribeIamInstanceProfileAssociations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12260,6 +13106,56 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsWithContext(ctx aws.Context, return out, req.Send() } +// DescribeIamInstanceProfileAssociationsPages iterates over the pages of a DescribeIamInstanceProfileAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeIamInstanceProfileAssociations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeIamInstanceProfileAssociations operation. +// pageNum := 0 +// err := client.DescribeIamInstanceProfileAssociationsPages(params, +// func(page *DescribeIamInstanceProfileAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeIamInstanceProfileAssociationsPages(input *DescribeIamInstanceProfileAssociationsInput, fn func(*DescribeIamInstanceProfileAssociationsOutput, bool) bool) error { + return c.DescribeIamInstanceProfileAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeIamInstanceProfileAssociationsPagesWithContext same as DescribeIamInstanceProfileAssociationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeIamInstanceProfileAssociationsPagesWithContext(ctx aws.Context, input *DescribeIamInstanceProfileAssociationsInput, fn func(*DescribeIamInstanceProfileAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeIamInstanceProfileAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeIamInstanceProfileAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeIamInstanceProfileAssociationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeIdFormat = "DescribeIdFormat" // DescribeIdFormatRequest generates a "aws/request.Request" representing the @@ -12628,6 +13524,12 @@ func (c *EC2) DescribeImportImageTasksRequest(input *DescribeImportImageTasksInp Name: opDescribeImportImageTasks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12672,6 +13574,56 @@ func (c *EC2) DescribeImportImageTasksWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeImportImageTasksPages iterates over the pages of a DescribeImportImageTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeImportImageTasks method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeImportImageTasks operation. +// pageNum := 0 +// err := client.DescribeImportImageTasksPages(params, +// func(page *DescribeImportImageTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeImportImageTasksPages(input *DescribeImportImageTasksInput, fn func(*DescribeImportImageTasksOutput, bool) bool) error { + return c.DescribeImportImageTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeImportImageTasksPagesWithContext same as DescribeImportImageTasksPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeImportImageTasksPagesWithContext(ctx aws.Context, input *DescribeImportImageTasksInput, fn func(*DescribeImportImageTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeImportImageTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImportImageTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeImportImageTasksOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeImportSnapshotTasks = "DescribeImportSnapshotTasks" // DescribeImportSnapshotTasksRequest generates a "aws/request.Request" representing the @@ -12703,6 +13655,12 @@ func (c *EC2) DescribeImportSnapshotTasksRequest(input *DescribeImportSnapshotTa Name: opDescribeImportSnapshotTasks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12746,6 +13704,56 @@ func (c *EC2) DescribeImportSnapshotTasksWithContext(ctx aws.Context, input *Des return out, req.Send() } +// DescribeImportSnapshotTasksPages iterates over the pages of a DescribeImportSnapshotTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeImportSnapshotTasks method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeImportSnapshotTasks operation. +// pageNum := 0 +// err := client.DescribeImportSnapshotTasksPages(params, +// func(page *DescribeImportSnapshotTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeImportSnapshotTasksPages(input *DescribeImportSnapshotTasksInput, fn func(*DescribeImportSnapshotTasksOutput, bool) bool) error { + return c.DescribeImportSnapshotTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeImportSnapshotTasksPagesWithContext same as DescribeImportSnapshotTasksPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeImportSnapshotTasksPagesWithContext(ctx aws.Context, input *DescribeImportSnapshotTasksInput, fn func(*DescribeImportSnapshotTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeImportSnapshotTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImportSnapshotTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeImportSnapshotTasksOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeInstanceAttribute = "DescribeInstanceAttribute" // DescribeInstanceAttributeRequest generates a "aws/request.Request" representing the @@ -12855,6 +13863,12 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc Name: opDescribeInstanceCreditSpecifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12921,6 +13935,56 @@ func (c *EC2) DescribeInstanceCreditSpecificationsWithContext(ctx aws.Context, i return out, req.Send() } +// DescribeInstanceCreditSpecificationsPages iterates over the pages of a DescribeInstanceCreditSpecifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInstanceCreditSpecifications method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeInstanceCreditSpecifications operation. +// pageNum := 0 +// err := client.DescribeInstanceCreditSpecificationsPages(params, +// func(page *DescribeInstanceCreditSpecificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeInstanceCreditSpecificationsPages(input *DescribeInstanceCreditSpecificationsInput, fn func(*DescribeInstanceCreditSpecificationsOutput, bool) bool) error { + return c.DescribeInstanceCreditSpecificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInstanceCreditSpecificationsPagesWithContext same as DescribeInstanceCreditSpecificationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeInstanceCreditSpecificationsPagesWithContext(ctx aws.Context, input *DescribeInstanceCreditSpecificationsInput, fn func(*DescribeInstanceCreditSpecificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstanceCreditSpecificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceCreditSpecificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInstanceCreditSpecificationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeInstanceStatus = "DescribeInstanceStatus" // DescribeInstanceStatusRequest generates a "aws/request.Request" representing the @@ -13248,6 +14312,12 @@ func (c *EC2) DescribeInternetGatewaysRequest(input *DescribeInternetGatewaysInp Name: opDescribeInternetGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13291,6 +14361,56 @@ func (c *EC2) DescribeInternetGatewaysWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeInternetGatewaysPages iterates over the pages of a DescribeInternetGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInternetGateways method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeInternetGateways operation. +// pageNum := 0 +// err := client.DescribeInternetGatewaysPages(params, +// func(page *DescribeInternetGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeInternetGatewaysPages(input *DescribeInternetGatewaysInput, fn func(*DescribeInternetGatewaysOutput, bool) bool) error { + return c.DescribeInternetGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInternetGatewaysPagesWithContext same as DescribeInternetGatewaysPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeInternetGatewaysPagesWithContext(ctx aws.Context, input *DescribeInternetGatewaysInput, fn func(*DescribeInternetGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInternetGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInternetGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeInternetGatewaysOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeKeyPairs = "DescribeKeyPairs" // DescribeKeyPairsRequest generates a "aws/request.Request" representing the @@ -13399,6 +14519,12 @@ func (c *EC2) DescribeLaunchTemplateVersionsRequest(input *DescribeLaunchTemplat Name: opDescribeLaunchTemplateVersions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13443,6 +14569,56 @@ func (c *EC2) DescribeLaunchTemplateVersionsWithContext(ctx aws.Context, input * return out, req.Send() } +// DescribeLaunchTemplateVersionsPages iterates over the pages of a DescribeLaunchTemplateVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLaunchTemplateVersions method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeLaunchTemplateVersions operation. +// pageNum := 0 +// err := client.DescribeLaunchTemplateVersionsPages(params, +// func(page *DescribeLaunchTemplateVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeLaunchTemplateVersionsPages(input *DescribeLaunchTemplateVersionsInput, fn func(*DescribeLaunchTemplateVersionsOutput, bool) bool) error { + return c.DescribeLaunchTemplateVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeLaunchTemplateVersionsPagesWithContext same as DescribeLaunchTemplateVersionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeLaunchTemplateVersionsPagesWithContext(ctx aws.Context, input *DescribeLaunchTemplateVersionsInput, fn func(*DescribeLaunchTemplateVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLaunchTemplateVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLaunchTemplateVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLaunchTemplateVersionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeLaunchTemplates = "DescribeLaunchTemplates" // DescribeLaunchTemplatesRequest generates a "aws/request.Request" representing the @@ -13474,6 +14650,12 @@ func (c *EC2) DescribeLaunchTemplatesRequest(input *DescribeLaunchTemplatesInput Name: opDescribeLaunchTemplates, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13517,6 +14699,56 @@ func (c *EC2) DescribeLaunchTemplatesWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeLaunchTemplatesPages iterates over the pages of a DescribeLaunchTemplates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLaunchTemplates method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeLaunchTemplates operation. +// pageNum := 0 +// err := client.DescribeLaunchTemplatesPages(params, +// func(page *DescribeLaunchTemplatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeLaunchTemplatesPages(input *DescribeLaunchTemplatesInput, fn func(*DescribeLaunchTemplatesOutput, bool) bool) error { + return c.DescribeLaunchTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeLaunchTemplatesPagesWithContext same as DescribeLaunchTemplatesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeLaunchTemplatesPagesWithContext(ctx aws.Context, input *DescribeLaunchTemplatesInput, fn func(*DescribeLaunchTemplatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLaunchTemplatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLaunchTemplatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeLaunchTemplatesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeMovingAddresses = "DescribeMovingAddresses" // DescribeMovingAddressesRequest generates a "aws/request.Request" representing the @@ -13548,6 +14780,12 @@ func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput Name: opDescribeMovingAddresses, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13593,6 +14831,56 @@ func (c *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeMovingAddressesPages iterates over the pages of a DescribeMovingAddresses operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeMovingAddresses method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeMovingAddresses operation. +// pageNum := 0 +// err := client.DescribeMovingAddressesPages(params, +// func(page *DescribeMovingAddressesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeMovingAddressesPages(input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool) error { + return c.DescribeMovingAddressesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeMovingAddressesPagesWithContext same as DescribeMovingAddressesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeMovingAddressesPagesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeMovingAddressesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMovingAddressesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeMovingAddressesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeNatGateways = "DescribeNatGateways" // DescribeNatGatewaysRequest generates a "aws/request.Request" representing the @@ -13754,6 +15042,12 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req * Name: opDescribeNetworkAcls, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13800,6 +15094,56 @@ func (c *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNet return out, req.Send() } +// DescribeNetworkAclsPages iterates over the pages of a DescribeNetworkAcls operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNetworkAcls method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeNetworkAcls operation. +// pageNum := 0 +// err := client.DescribeNetworkAclsPages(params, +// func(page *DescribeNetworkAclsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNetworkAclsPages(input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool) error { + return c.DescribeNetworkAclsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNetworkAclsPagesWithContext same as DescribeNetworkAclsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkAclsPagesWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkAclsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkAclsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNetworkAclsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" // DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the @@ -13906,6 +15250,12 @@ func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkI Name: opDescribeNetworkInterfacePermissions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -13949,6 +15299,56 @@ func (c *EC2) DescribeNetworkInterfacePermissionsWithContext(ctx aws.Context, in return out, req.Send() } +// DescribeNetworkInterfacePermissionsPages iterates over the pages of a DescribeNetworkInterfacePermissions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNetworkInterfacePermissions method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeNetworkInterfacePermissions operation. +// pageNum := 0 +// err := client.DescribeNetworkInterfacePermissionsPages(params, +// func(page *DescribeNetworkInterfacePermissionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNetworkInterfacePermissionsPages(input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool) error { + return c.DescribeNetworkInterfacePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeNetworkInterfacePermissionsPagesWithContext same as DescribeNetworkInterfacePermissionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkInterfacePermissionsPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkInterfacePermissionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkInterfacePermissionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeNetworkInterfacePermissionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" // DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the @@ -14186,6 +15586,12 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req * Name: opDescribePrefixLists, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -14234,6 +15640,56 @@ func (c *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePre return out, req.Send() } +// DescribePrefixListsPages iterates over the pages of a DescribePrefixLists operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePrefixLists method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribePrefixLists operation. +// pageNum := 0 +// err := client.DescribePrefixListsPages(params, +// func(page *DescribePrefixListsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribePrefixListsPages(input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool) error { + return c.DescribePrefixListsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePrefixListsPagesWithContext same as DescribePrefixListsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribePrefixListsPagesWithContext(ctx aws.Context, input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePrefixListsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePrefixListsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePrefixListsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribePrincipalIdFormat = "DescribePrincipalIdFormat" // DescribePrincipalIdFormatRequest generates a "aws/request.Request" representing the @@ -14265,6 +15721,12 @@ func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatI Name: opDescribePrincipalIdFormat, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -14322,6 +15784,56 @@ func (c *EC2) DescribePrincipalIdFormatWithContext(ctx aws.Context, input *Descr return out, req.Send() } +// DescribePrincipalIdFormatPages iterates over the pages of a DescribePrincipalIdFormat operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePrincipalIdFormat method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribePrincipalIdFormat operation. +// pageNum := 0 +// err := client.DescribePrincipalIdFormatPages(params, +// func(page *DescribePrincipalIdFormatOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribePrincipalIdFormatPages(input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool) error { + return c.DescribePrincipalIdFormatPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePrincipalIdFormatPagesWithContext same as DescribePrincipalIdFormatPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribePrincipalIdFormatPagesWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePrincipalIdFormatInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePrincipalIdFormatRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePrincipalIdFormatOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribePublicIpv4Pools = "DescribePublicIpv4Pools" // DescribePublicIpv4PoolsRequest generates a "aws/request.Request" representing the @@ -14353,6 +15865,12 @@ func (c *EC2) DescribePublicIpv4PoolsRequest(input *DescribePublicIpv4PoolsInput Name: opDescribePublicIpv4Pools, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -14396,6 +15914,56 @@ func (c *EC2) DescribePublicIpv4PoolsWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribePublicIpv4PoolsPages iterates over the pages of a DescribePublicIpv4Pools operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribePublicIpv4Pools method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribePublicIpv4Pools operation. +// pageNum := 0 +// err := client.DescribePublicIpv4PoolsPages(params, +// func(page *DescribePublicIpv4PoolsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribePublicIpv4PoolsPages(input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool) error { + return c.DescribePublicIpv4PoolsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribePublicIpv4PoolsPagesWithContext same as DescribePublicIpv4PoolsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribePublicIpv4PoolsPagesWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribePublicIpv4PoolsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribePublicIpv4PoolsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribePublicIpv4PoolsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeRegions = "DescribeRegions" // DescribeRegionsRequest generates a "aws/request.Request" representing the @@ -15091,6 +16659,12 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeSchedu Name: opDescribeScheduledInstanceAvailability, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -15142,6 +16716,56 @@ func (c *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, return out, req.Send() } +// DescribeScheduledInstanceAvailabilityPages iterates over the pages of a DescribeScheduledInstanceAvailability operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledInstanceAvailability method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeScheduledInstanceAvailability operation. +// pageNum := 0 +// err := client.DescribeScheduledInstanceAvailabilityPages(params, +// func(page *DescribeScheduledInstanceAvailabilityOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeScheduledInstanceAvailabilityPages(input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool) error { + return c.DescribeScheduledInstanceAvailabilityPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeScheduledInstanceAvailabilityPagesWithContext same as DescribeScheduledInstanceAvailabilityPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeScheduledInstanceAvailabilityPagesWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledInstanceAvailabilityInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledInstanceAvailabilityRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScheduledInstanceAvailabilityOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeScheduledInstances = "DescribeScheduledInstances" // DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the @@ -15173,6 +16797,12 @@ func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstance Name: opDescribeScheduledInstances, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -15216,6 +16846,56 @@ func (c *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *Desc return out, req.Send() } +// DescribeScheduledInstancesPages iterates over the pages of a DescribeScheduledInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledInstances method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeScheduledInstances operation. +// pageNum := 0 +// err := client.DescribeScheduledInstancesPages(params, +// func(page *DescribeScheduledInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeScheduledInstancesPages(input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool) error { + return c.DescribeScheduledInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeScheduledInstancesPagesWithContext same as DescribeScheduledInstancesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeScheduledInstancesPagesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeScheduledInstancesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" // DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the @@ -16074,6 +17754,12 @@ func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceReq Name: opDescribeSpotInstanceRequests, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16133,6 +17819,56 @@ func (c *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeSpotInstanceRequestsPages iterates over the pages of a DescribeSpotInstanceRequests operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeSpotInstanceRequests method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeSpotInstanceRequests operation. +// pageNum := 0 +// err := client.DescribeSpotInstanceRequestsPages(params, +// func(page *DescribeSpotInstanceRequestsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeSpotInstanceRequestsPages(input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool) error { + return c.DescribeSpotInstanceRequestsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeSpotInstanceRequestsPagesWithContext same as DescribeSpotInstanceRequestsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeSpotInstanceRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeSpotInstanceRequestsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeSpotInstanceRequestsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" // DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the @@ -16301,6 +18037,12 @@ func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGro Name: opDescribeStaleSecurityGroups, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16347,6 +18089,56 @@ func (c *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *Des return out, req.Send() } +// DescribeStaleSecurityGroupsPages iterates over the pages of a DescribeStaleSecurityGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeStaleSecurityGroups method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeStaleSecurityGroups operation. +// pageNum := 0 +// err := client.DescribeStaleSecurityGroupsPages(params, +// func(page *DescribeStaleSecurityGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeStaleSecurityGroupsPages(input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool) error { + return c.DescribeStaleSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeStaleSecurityGroupsPagesWithContext same as DescribeStaleSecurityGroupsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeStaleSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStaleSecurityGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStaleSecurityGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeStaleSecurityGroupsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeSubnets = "DescribeSubnets" // DescribeSubnetsRequest generates a "aws/request.Request" representing the @@ -16588,6 +18380,12 @@ func (c *EC2) DescribeTransitGatewayAttachmentsRequest(input *DescribeTransitGat Name: opDescribeTransitGatewayAttachments, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16634,6 +18432,56 @@ func (c *EC2) DescribeTransitGatewayAttachmentsWithContext(ctx aws.Context, inpu return out, req.Send() } +// DescribeTransitGatewayAttachmentsPages iterates over the pages of a DescribeTransitGatewayAttachments operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayAttachments method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeTransitGatewayAttachments operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayAttachmentsPages(params, +// func(page *DescribeTransitGatewayAttachmentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayAttachmentsPages(input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayAttachmentsPagesWithContext same as DescribeTransitGatewayAttachmentsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayAttachmentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayAttachmentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewayAttachmentsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeTransitGatewayRouteTables = "DescribeTransitGatewayRouteTables" // DescribeTransitGatewayRouteTablesRequest generates a "aws/request.Request" representing the @@ -16665,6 +18513,12 @@ func (c *EC2) DescribeTransitGatewayRouteTablesRequest(input *DescribeTransitGat Name: opDescribeTransitGatewayRouteTables, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16709,6 +18563,56 @@ func (c *EC2) DescribeTransitGatewayRouteTablesWithContext(ctx aws.Context, inpu return out, req.Send() } +// DescribeTransitGatewayRouteTablesPages iterates over the pages of a DescribeTransitGatewayRouteTables operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayRouteTables method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeTransitGatewayRouteTables operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayRouteTablesPages(params, +// func(page *DescribeTransitGatewayRouteTablesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayRouteTablesPages(input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool) error { + return c.DescribeTransitGatewayRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayRouteTablesPagesWithContext same as DescribeTransitGatewayRouteTablesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayRouteTablesPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayRouteTablesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayRouteTablesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewayRouteTablesOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeTransitGatewayVpcAttachments = "DescribeTransitGatewayVpcAttachments" // DescribeTransitGatewayVpcAttachmentsRequest generates a "aws/request.Request" representing the @@ -16740,6 +18644,12 @@ func (c *EC2) DescribeTransitGatewayVpcAttachmentsRequest(input *DescribeTransit Name: opDescribeTransitGatewayVpcAttachments, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16784,6 +18694,56 @@ func (c *EC2) DescribeTransitGatewayVpcAttachmentsWithContext(ctx aws.Context, i return out, req.Send() } +// DescribeTransitGatewayVpcAttachmentsPages iterates over the pages of a DescribeTransitGatewayVpcAttachments operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayVpcAttachments method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeTransitGatewayVpcAttachments operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayVpcAttachmentsPages(params, +// func(page *DescribeTransitGatewayVpcAttachmentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayVpcAttachmentsPages(input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayVpcAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayVpcAttachmentsPagesWithContext same as DescribeTransitGatewayVpcAttachmentsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayVpcAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayVpcAttachmentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayVpcAttachmentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewayVpcAttachmentsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeTransitGateways = "DescribeTransitGateways" // DescribeTransitGatewaysRequest generates a "aws/request.Request" representing the @@ -16815,6 +18775,12 @@ func (c *EC2) DescribeTransitGatewaysRequest(input *DescribeTransitGatewaysInput Name: opDescribeTransitGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -16859,6 +18825,56 @@ func (c *EC2) DescribeTransitGatewaysWithContext(ctx aws.Context, input *Describ return out, req.Send() } +// DescribeTransitGatewaysPages iterates over the pages of a DescribeTransitGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGateways method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeTransitGateways operation. +// pageNum := 0 +// err := client.DescribeTransitGatewaysPages(params, +// func(page *DescribeTransitGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewaysPages(input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool) error { + return c.DescribeTransitGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewaysPagesWithContext same as DescribeTransitGatewaysPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewaysPagesWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewaysInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewaysRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeTransitGatewaysOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVolumeAttribute = "DescribeVolumeAttribute" // DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the @@ -17273,6 +19289,12 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica Name: opDescribeVolumesModifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17329,6 +19351,56 @@ func (c *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *De return out, req.Send() } +// DescribeVolumesModificationsPages iterates over the pages of a DescribeVolumesModifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVolumesModifications method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVolumesModifications operation. +// pageNum := 0 +// err := client.DescribeVolumesModificationsPages(params, +// func(page *DescribeVolumesModificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVolumesModificationsPages(input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool) error { + return c.DescribeVolumesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVolumesModificationsPagesWithContext same as DescribeVolumesModificationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVolumesModificationsPagesWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVolumesModificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesModificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVolumesModificationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcAttribute = "DescribeVpcAttribute" // DescribeVpcAttributeRequest generates a "aws/request.Request" representing the @@ -17509,6 +19581,12 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL Name: opDescribeVpcClassicLinkDnsSupport, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17558,6 +19636,56 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input return out, req.Send() } +// DescribeVpcClassicLinkDnsSupportPages iterates over the pages of a DescribeVpcClassicLinkDnsSupport operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcClassicLinkDnsSupport method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcClassicLinkDnsSupport operation. +// pageNum := 0 +// err := client.DescribeVpcClassicLinkDnsSupportPages(params, +// func(page *DescribeVpcClassicLinkDnsSupportOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcClassicLinkDnsSupportPages(input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error { + return c.DescribeVpcClassicLinkDnsSupportPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcClassicLinkDnsSupportPagesWithContext same as DescribeVpcClassicLinkDnsSupportPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcClassicLinkDnsSupportPagesWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcClassicLinkDnsSupportInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcClassicLinkDnsSupportRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcClassicLinkDnsSupportOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications" // DescribeVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the @@ -17589,6 +19717,12 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeV Name: opDescribeVpcEndpointConnectionNotifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17633,6 +19767,56 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsWithContext(ctx aws.Cont return out, req.Send() } +// DescribeVpcEndpointConnectionNotificationsPages iterates over the pages of a DescribeVpcEndpointConnectionNotifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointConnectionNotifications method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcEndpointConnectionNotifications operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointConnectionNotificationsPages(params, +// func(page *DescribeVpcEndpointConnectionNotificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointConnectionNotificationsPages(input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error { + return c.DescribeVpcEndpointConnectionNotificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointConnectionNotificationsPagesWithContext same as DescribeVpcEndpointConnectionNotificationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointConnectionNotificationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointConnectionNotificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointConnectionNotificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointConnectionNotificationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" // DescribeVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the @@ -17664,6 +19848,12 @@ func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointCo Name: opDescribeVpcEndpointConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17708,6 +19898,56 @@ func (c *EC2) DescribeVpcEndpointConnectionsWithContext(ctx aws.Context, input * return out, req.Send() } +// DescribeVpcEndpointConnectionsPages iterates over the pages of a DescribeVpcEndpointConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointConnections method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcEndpointConnections operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointConnectionsPages(params, +// func(page *DescribeVpcEndpointConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointConnectionsPages(input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool) error { + return c.DescribeVpcEndpointConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointConnectionsPagesWithContext same as DescribeVpcEndpointConnectionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointConnectionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations" // DescribeVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the @@ -17739,6 +19979,12 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpc Name: opDescribeVpcEndpointServiceConfigurations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17782,6 +20028,56 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsWithContext(ctx aws.Contex return out, req.Send() } +// DescribeVpcEndpointServiceConfigurationsPages iterates over the pages of a DescribeVpcEndpointServiceConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointServiceConfigurations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcEndpointServiceConfigurations operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointServiceConfigurationsPages(params, +// func(page *DescribeVpcEndpointServiceConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointServiceConfigurationsPages(input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error { + return c.DescribeVpcEndpointServiceConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointServiceConfigurationsPagesWithContext same as DescribeVpcEndpointServiceConfigurationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointServiceConfigurationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointServiceConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointServiceConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointServiceConfigurationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions" // DescribeVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the @@ -17813,6 +20109,12 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEnd Name: opDescribeVpcEndpointServicePermissions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -17857,6 +20159,56 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsWithContext(ctx aws.Context, return out, req.Send() } +// DescribeVpcEndpointServicePermissionsPages iterates over the pages of a DescribeVpcEndpointServicePermissions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointServicePermissions method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcEndpointServicePermissions operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointServicePermissionsPages(params, +// func(page *DescribeVpcEndpointServicePermissionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointServicePermissionsPages(input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool) error { + return c.DescribeVpcEndpointServicePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointServicePermissionsPagesWithContext same as DescribeVpcEndpointServicePermissionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointServicePermissionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointServicePermissionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointServicePermissionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointServicePermissionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" // DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the @@ -17962,6 +20314,12 @@ func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req Name: opDescribeVpcEndpoints, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -18005,6 +20363,56 @@ func (c *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVp return out, req.Send() } +// DescribeVpcEndpointsPages iterates over the pages of a DescribeVpcEndpoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpoints method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcEndpoints operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointsPages(params, +// func(page *DescribeVpcEndpointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointsPages(input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool) error { + return c.DescribeVpcEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcEndpointsPagesWithContext same as DescribeVpcEndpointsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcEndpointsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" // DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the @@ -18036,6 +20444,12 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn Name: opDescribeVpcPeeringConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -18079,6 +20493,56 @@ func (c *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *D return out, req.Send() } +// DescribeVpcPeeringConnectionsPages iterates over the pages of a DescribeVpcPeeringConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcPeeringConnections method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcPeeringConnections operation. +// pageNum := 0 +// err := client.DescribeVpcPeeringConnectionsPages(params, +// func(page *DescribeVpcPeeringConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcPeeringConnectionsPages(input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool) error { + return c.DescribeVpcPeeringConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcPeeringConnectionsPagesWithContext same as DescribeVpcPeeringConnectionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcPeeringConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcPeeringConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcPeeringConnectionsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpcs = "DescribeVpcs" // DescribeVpcsRequest generates a "aws/request.Request" representing the @@ -18110,6 +20574,12 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Reques Name: opDescribeVpcs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -18153,6 +20623,56 @@ func (c *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, return out, req.Send() } +// DescribeVpcsPages iterates over the pages of a DescribeVpcs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcs method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeVpcs operation. +// pageNum := 0 +// err := client.DescribeVpcsPages(params, +// func(page *DescribeVpcsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcsPages(input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool) error { + return c.DescribeVpcsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcsPagesWithContext same as DescribeVpcsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcsPagesWithContext(ctx aws.Context, input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*DescribeVpcsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opDescribeVpnConnections = "DescribeVpnConnections" // DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the @@ -20695,6 +23215,12 @@ func (c *EC2) GetTransitGatewayAttachmentPropagationsRequest(input *GetTransitGa Name: opGetTransitGatewayAttachmentPropagations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -20739,6 +23265,56 @@ func (c *EC2) GetTransitGatewayAttachmentPropagationsWithContext(ctx aws.Context return out, req.Send() } +// GetTransitGatewayAttachmentPropagationsPages iterates over the pages of a GetTransitGatewayAttachmentPropagations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayAttachmentPropagations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetTransitGatewayAttachmentPropagations operation. +// pageNum := 0 +// err := client.GetTransitGatewayAttachmentPropagationsPages(params, +// func(page *GetTransitGatewayAttachmentPropagationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayAttachmentPropagationsPages(input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error { + return c.GetTransitGatewayAttachmentPropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayAttachmentPropagationsPagesWithContext same as GetTransitGatewayAttachmentPropagationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayAttachmentPropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayAttachmentPropagationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayAttachmentPropagationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTransitGatewayAttachmentPropagationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opGetTransitGatewayRouteTableAssociations = "GetTransitGatewayRouteTableAssociations" // GetTransitGatewayRouteTableAssociationsRequest generates a "aws/request.Request" representing the @@ -20770,6 +23346,12 @@ func (c *EC2) GetTransitGatewayRouteTableAssociationsRequest(input *GetTransitGa Name: opGetTransitGatewayRouteTableAssociations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -20814,6 +23396,56 @@ func (c *EC2) GetTransitGatewayRouteTableAssociationsWithContext(ctx aws.Context return out, req.Send() } +// GetTransitGatewayRouteTableAssociationsPages iterates over the pages of a GetTransitGatewayRouteTableAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayRouteTableAssociations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetTransitGatewayRouteTableAssociations operation. +// pageNum := 0 +// err := client.GetTransitGatewayRouteTableAssociationsPages(params, +// func(page *GetTransitGatewayRouteTableAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayRouteTableAssociationsPages(input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error { + return c.GetTransitGatewayRouteTableAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayRouteTableAssociationsPagesWithContext same as GetTransitGatewayRouteTableAssociationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayRouteTableAssociationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayRouteTableAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayRouteTableAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTransitGatewayRouteTableAssociationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opGetTransitGatewayRouteTablePropagations = "GetTransitGatewayRouteTablePropagations" // GetTransitGatewayRouteTablePropagationsRequest generates a "aws/request.Request" representing the @@ -20845,6 +23477,12 @@ func (c *EC2) GetTransitGatewayRouteTablePropagationsRequest(input *GetTransitGa Name: opGetTransitGatewayRouteTablePropagations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -20889,6 +23527,56 @@ func (c *EC2) GetTransitGatewayRouteTablePropagationsWithContext(ctx aws.Context return out, req.Send() } +// GetTransitGatewayRouteTablePropagationsPages iterates over the pages of a GetTransitGatewayRouteTablePropagations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayRouteTablePropagations method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a GetTransitGatewayRouteTablePropagations operation. +// pageNum := 0 +// err := client.GetTransitGatewayRouteTablePropagationsPages(params, +// func(page *GetTransitGatewayRouteTablePropagationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayRouteTablePropagationsPages(input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error { + return c.GetTransitGatewayRouteTablePropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayRouteTablePropagationsPagesWithContext same as GetTransitGatewayRouteTablePropagationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayRouteTablePropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayRouteTablePropagationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayRouteTablePropagationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + cont := true + for p.Next() && cont { + cont = fn(p.Page().(*GetTransitGatewayRouteTablePropagationsOutput), !p.HasNextPage()) + } + return p.Err() +} + const opImportClientVpnClientCertificateRevocationList = "ImportClientVpnClientCertificateRevocationList" // ImportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the @@ -22553,7 +25241,8 @@ func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfa // ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. // // Modifies the specified network interface attribute. You can specify only -// one attribute at a time. +// one attribute at a time. You can use this action to attach and detach security +// groups from an existing EC2 instance. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -31941,7 +34630,10 @@ func (s *CertificateAuthenticationRequest) SetClientRootCertificateChainArn(v st } // Provides authorization for Amazon to bring a specific IP address range to -// a specific AWS account using bring your own IP addresses (BYOIP). +// a specific AWS account using bring your own IP addresses (BYOIP). For more +// information, see Prepare to Bring Your Address Range to Your AWS Account +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip) +// in the Amazon Elastic Compute Cloud User Guide. type CidrAuthorizationContext struct { _ struct{} `type:"structure"` @@ -42850,17 +45542,13 @@ type DescribeClassicLinkInstancesInput struct { // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results of the initial request can be seen by sending another - // request with the returned NextToken value. This value can be between 5 and - // 1000. If MaxResults is given a value larger than 1000, only 1000 results - // are returned. You cannot specify this parameter and the instance IDs parameter - // in the same request. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. // // Constraint: If the value is greater than 1000, we return only 1000 items. MaxResults *int64 `locationName:"maxResults" type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `locationName:"nextToken" type:"string"` } @@ -43785,13 +46473,11 @@ type DescribeEgressOnlyInternetGatewaysInput struct { // One or more egress-only internet gateway IDs. EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" locationNameList:"item" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000. If MaxResults is given - // a value larger than 1000, only 1000 results are returned. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } @@ -43835,7 +46521,8 @@ type DescribeEgressOnlyInternetGatewaysOutput struct { // Information about the egress-only internet gateways. EgressOnlyInternetGateways []*EgressOnlyInternetGateway `locationName:"egressOnlyInternetGatewaySet" locationNameList:"item" type:"list"` - // The token to use to retrieve the next page of results. + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` } @@ -44568,14 +47255,11 @@ type DescribeFlowLogsInput struct { // One or more flow log IDs. FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` - // The maximum number of results to return for the request in a single page. - // The remaining results can be seen by sending another request with the returned - // NextToken value. This value can be between 5 and 1000. If MaxResults is given - // a value larger than 1000, only 1000 results are returned. You cannot specify - // this parameter and the flow log IDs parameter in the same request. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } @@ -44911,7 +47595,7 @@ type DescribeHostReservationOfferingsInput struct { // The remaining results can be seen by sending another request with the returned // nextToken value. This value can be between 5 and 500. If maxResults is given // a larger value than 500, you receive an error. - MaxResults *int64 `type:"integer"` + MaxResults *int64 `min:"5" type:"integer"` // This is the minimum duration of the reservation you'd like to purchase, specified // in seconds. Reservations are available in one-year and three-year terms. @@ -44937,6 +47621,19 @@ func (s DescribeHostReservationOfferingsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeHostReservationOfferingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeHostReservationOfferingsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetFilter sets the Filter field's value. func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput { s.Filter = v @@ -45017,6 +47714,16 @@ type DescribeHostReservationsInput struct { // // * state - The state of the reservation (payment-pending | payment-failed // | active | retired). + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. Filter []*Filter `locationNameList:"Filter" type:"list"` // One or more host reservation IDs. @@ -46834,6 +49541,13 @@ type DescribeInternetGatewaysInput struct { // // Default: Describes all your internet gateways. InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation @@ -46846,6 +49560,19 @@ func (s DescribeInternetGatewaysInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInternetGatewaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInternetGatewaysInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput { s.DryRun = &v @@ -46864,11 +49591,27 @@ func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *Desc return s } +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeInternetGatewaysInput) SetMaxResults(v int64) *DescribeInternetGatewaysInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeInternetGatewaysInput) SetNextToken(v string) *DescribeInternetGatewaysInput { + s.NextToken = &v + return s +} + type DescribeInternetGatewaysOutput struct { _ struct{} `type:"structure"` // Information about one or more internet gateways. InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation @@ -46887,6 +49630,12 @@ func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGatewa return s } +// SetNextToken sets the NextToken field's value. +func (s *DescribeInternetGatewaysOutput) SetNextToken(v string) *DescribeInternetGatewaysOutput { + s.NextToken = &v + return s +} + type DescribeKeyPairsInput struct { _ struct{} `type:"structure"` @@ -47374,18 +50123,14 @@ type DescribeNatGatewaysInput struct { // * vpc-id - The ID of the VPC in which the NAT gateway resides. Filter []*Filter `locationNameList:"Filter" type:"list"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` // One or more NAT gateway IDs. NatGatewayIds []*string `locationName:"NatGatewayId" locationNameList:"item" type:"list"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } @@ -47516,10 +50261,17 @@ type DescribeNetworkAclsInput struct { // * vpc-id - The ID of the VPC for the network ACL. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + // One or more network ACL IDs. // // Default: Describes all your network ACLs. NetworkAclIds []*string `locationName:"NetworkAclId" locationNameList:"item" type:"list"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation @@ -47532,6 +50284,19 @@ func (s DescribeNetworkAclsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNetworkAclsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNetworkAclsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeNetworkAclsInput) SetDryRun(v bool) *DescribeNetworkAclsInput { s.DryRun = &v @@ -47544,17 +50309,33 @@ func (s *DescribeNetworkAclsInput) SetFilters(v []*Filter) *DescribeNetworkAclsI return s } +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeNetworkAclsInput) SetMaxResults(v int64) *DescribeNetworkAclsInput { + s.MaxResults = &v + return s +} + // SetNetworkAclIds sets the NetworkAclIds field's value. func (s *DescribeNetworkAclsInput) SetNetworkAclIds(v []*string) *DescribeNetworkAclsInput { s.NetworkAclIds = v return s } +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkAclsInput) SetNextToken(v string) *DescribeNetworkAclsInput { + s.NextToken = &v + return s +} + type DescribeNetworkAclsOutput struct { _ struct{} `type:"structure"` // Information about one or more network ACLs. NetworkAcls []*NetworkAcl `locationName:"networkAclSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation @@ -47573,6 +50354,12 @@ func (s *DescribeNetworkAclsOutput) SetNetworkAcls(v []*NetworkAcl) *DescribeNet return s } +// SetNextToken sets the NextToken field's value. +func (s *DescribeNetworkAclsOutput) SetNextToken(v string) *DescribeNetworkAclsOutput { + s.NextToken = &v + return s +} + // Contains the parameters for DescribeNetworkInterfaceAttribute. type DescribeNetworkInterfaceAttributeInput struct { _ struct{} `type:"structure"` @@ -48089,16 +50876,11 @@ type DescribePrefixListsInput struct { // * prefix-list-name: The name of a prefix list. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. - // - // Constraint: If the value specified is greater than 1000, we return only 1000 - // items. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token for the next set of items to return. (You received this token from - // a prior call.) + // The token for the next page of results. NextToken *string `type:"string"` // One or more prefix list IDs. @@ -48148,8 +50930,8 @@ func (s *DescribePrefixListsInput) SetPrefixListIds(v []*string) *DescribePrefix type DescribePrefixListsOutput struct { _ struct{} `type:"structure"` - // The token to use when requesting the next set of items. If there are no additional - // items to return, the string is empty. + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. NextToken *string `locationName:"nextToken" type:"string"` // All available prefix lists. @@ -49074,12 +51856,11 @@ type DescribeRouteTablesInput struct { // * vpc-id - The ID of the VPC for the route table. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return in a single call. To retrieve the - // remaining results, make another call with the returned NextToken value. This - // value can be between 5 and 100. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` // One or more route table IDs. @@ -50988,9 +53769,10 @@ type DescribeTagsInput struct { // // * resource-type - The resource type (customer-gateway | dedicated-host // | dhcp-options | elastic-ip | fleet | fpga-image | image | instance | - // internet-gateway | launch-template | natgateway | network-acl | network-interface - // | reserved-instances | route-table | security-group | snapshot | spot-instances-request - // | subnet | volume | vpc | vpc-peering-connection | vpn-connection | vpn-gateway). + // host-reservation | internet-gateway | launch-template | natgateway | network-acl + // | network-interface | reserved-instances | route-table | security-group + // | snapshot | spot-instances-request | subnet | volume | vpc | vpc-peering-connection + // | vpn-connection | vpn-gateway). // // * tag: - The key/value combination of the tag. For example, specify // "tag:Owner" for the filter name and "TeamA" for the filter value to find @@ -52200,13 +54982,11 @@ func (s *DescribeVpcAttributeOutput) SetVpcId(v string) *DescribeVpcAttributeOut type DescribeVpcClassicLinkDnsSupportInput struct { _ struct{} `type:"structure"` - // The maximum number of items to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"` - // The token for the next set of items to return. (You received this token from - // a prior call.) + // The token for the next page of results. NextToken *string `locationName:"nextToken" min:"1" type:"string"` // One or more VPC IDs. @@ -52260,7 +55040,8 @@ func (s *DescribeVpcClassicLinkDnsSupportInput) SetVpcIds(v []*string) *Describe type DescribeVpcClassicLinkDnsSupportOutput struct { _ struct{} `type:"structure"` - // The token to use when requesting the next set of items. + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. NextToken *string `locationName:"nextToken" min:"1" type:"string"` // Information about the ClassicLink DNS support status of the VPCs. @@ -53073,13 +55854,11 @@ type DescribeVpcPeeringConnectionsInput struct { // * vpc-peering-connection-id - The ID of the VPC peering connection. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return for this request. The request returns - // a token that you can specify in a subsequent call to get the next set of - // results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. MaxResults *int64 `min:"5" type:"integer"` - // The token to request the next page of results. (You received this token from - // a prior call.) + // The token for the next page of results. NextToken *string `type:"string"` // One or more VPC peering connection IDs. @@ -53229,6 +56008,13 @@ type DescribeVpcsInput struct { // * vpc-id - The ID of the VPC. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + // One or more VPC IDs. // // Default: Describes all your VPCs. @@ -53245,6 +56031,19 @@ func (s DescribeVpcsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeVpcsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeVpcsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. func (s *DescribeVpcsInput) SetDryRun(v bool) *DescribeVpcsInput { s.DryRun = &v @@ -53257,6 +56056,18 @@ func (s *DescribeVpcsInput) SetFilters(v []*Filter) *DescribeVpcsInput { return s } +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeVpcsInput) SetMaxResults(v int64) *DescribeVpcsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeVpcsInput) SetNextToken(v string) *DescribeVpcsInput { + s.NextToken = &v + return s +} + // SetVpcIds sets the VpcIds field's value. func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput { s.VpcIds = v @@ -53266,6 +56077,10 @@ func (s *DescribeVpcsInput) SetVpcIds(v []*string) *DescribeVpcsInput { type DescribeVpcsOutput struct { _ struct{} `type:"structure"` + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` + // Information about one or more VPCs. Vpcs []*Vpc `locationName:"vpcSet" locationNameList:"item" type:"list"` } @@ -53280,6 +56095,12 @@ func (s DescribeVpcsOutput) GoString() string { return s.String() } +// SetNextToken sets the NextToken field's value. +func (s *DescribeVpcsOutput) SetNextToken(v string) *DescribeVpcsOutput { + s.NextToken = &v + return s +} + // SetVpcs sets the Vpcs field's value. func (s *DescribeVpcsOutput) SetVpcs(v []*Vpc) *DescribeVpcsOutput { s.Vpcs = v @@ -57315,6 +60136,9 @@ type FpgaImage struct { // The date and time the AFI was created. CreateTime *time.Time `locationName:"createTime" type:"timestamp"` + // Indicates whether data retention support is enabled for the AFI. + DataRetentionSupport *bool `locationName:"dataRetentionSupport" type:"boolean"` + // The description of the AFI. Description *string `locationName:"description" type:"string"` @@ -57371,6 +60195,12 @@ func (s *FpgaImage) SetCreateTime(v time.Time) *FpgaImage { return s } +// SetDataRetentionSupport sets the DataRetentionSupport field's value. +func (s *FpgaImage) SetDataRetentionSupport(v bool) *FpgaImage { + s.DataRetentionSupport = &v + return s +} + // SetDescription sets the Description field's value. func (s *FpgaImage) SetDescription(v string) *FpgaImage { s.Description = &v @@ -59057,6 +61887,9 @@ type HostReservation struct { // The state of the reservation. State *string `locationName:"state" type:"string" enum:"ReservationState"` + // Any tags assigned to the Dedicated Host Reservation. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The upfront price of the reservation. UpfrontPrice *string `locationName:"upfrontPrice" type:"string"` } @@ -59143,6 +61976,12 @@ func (s *HostReservation) SetState(v string) *HostReservation { return s } +// SetTags sets the Tags field's value. +func (s *HostReservation) SetTags(v []*Tag) *HostReservation { + s.Tags = v + return s +} + // SetUpfrontPrice sets the UpfrontPrice field's value. func (s *HostReservation) SetUpfrontPrice(v string) *HostReservation { s.UpfrontPrice = &v @@ -85576,6 +88415,30 @@ const ( // InstanceTypeR5dMetal is a InstanceType enum value InstanceTypeR5dMetal = "r5d.metal" + // InstanceTypeR5adLarge is a InstanceType enum value + InstanceTypeR5adLarge = "r5ad.large" + + // InstanceTypeR5adXlarge is a InstanceType enum value + InstanceTypeR5adXlarge = "r5ad.xlarge" + + // InstanceTypeR5ad2xlarge is a InstanceType enum value + InstanceTypeR5ad2xlarge = "r5ad.2xlarge" + + // InstanceTypeR5ad4xlarge is a InstanceType enum value + InstanceTypeR5ad4xlarge = "r5ad.4xlarge" + + // InstanceTypeR5ad8xlarge is a InstanceType enum value + InstanceTypeR5ad8xlarge = "r5ad.8xlarge" + + // InstanceTypeR5ad12xlarge is a InstanceType enum value + InstanceTypeR5ad12xlarge = "r5ad.12xlarge" + + // InstanceTypeR5ad16xlarge is a InstanceType enum value + InstanceTypeR5ad16xlarge = "r5ad.16xlarge" + + // InstanceTypeR5ad24xlarge is a InstanceType enum value + InstanceTypeR5ad24xlarge = "r5ad.24xlarge" + // InstanceTypeX116xlarge is a InstanceType enum value InstanceTypeX116xlarge = "x1.16xlarge" @@ -85858,6 +88721,30 @@ const ( // InstanceTypeM5dMetal is a InstanceType enum value InstanceTypeM5dMetal = "m5d.metal" + // InstanceTypeM5adLarge is a InstanceType enum value + InstanceTypeM5adLarge = "m5ad.large" + + // InstanceTypeM5adXlarge is a InstanceType enum value + InstanceTypeM5adXlarge = "m5ad.xlarge" + + // InstanceTypeM5ad2xlarge is a InstanceType enum value + InstanceTypeM5ad2xlarge = "m5ad.2xlarge" + + // InstanceTypeM5ad4xlarge is a InstanceType enum value + InstanceTypeM5ad4xlarge = "m5ad.4xlarge" + + // InstanceTypeM5ad8xlarge is a InstanceType enum value + InstanceTypeM5ad8xlarge = "m5ad.8xlarge" + + // InstanceTypeM5ad12xlarge is a InstanceType enum value + InstanceTypeM5ad12xlarge = "m5ad.12xlarge" + + // InstanceTypeM5ad16xlarge is a InstanceType enum value + InstanceTypeM5ad16xlarge = "m5ad.16xlarge" + + // InstanceTypeM5ad24xlarge is a InstanceType enum value + InstanceTypeM5ad24xlarge = "m5ad.24xlarge" + // InstanceTypeH12xlarge is a InstanceType enum value InstanceTypeH12xlarge = "h1.2xlarge" @@ -86319,6 +89206,9 @@ const ( // ResourceTypeFpgaImage is a ResourceType enum value ResourceTypeFpgaImage = "fpga-image" + // ResourceTypeHostReservation is a ResourceType enum value + ResourceTypeHostReservation = "host-reservation" + // ResourceTypeImage is a ResourceType enum value ResourceTypeImage = "image" diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go index d495447d..7222e181 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go @@ -3928,7 +3928,7 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input *De // DescribeMaintenanceWindowExecutionTaskInvocations API operation for Amazon Simple Systems Manager (SSM). // // Retrieves the individual task executions (one per target) for a particular -// task executed as part of a Maintenance Window execution. +// task run as part of a Maintenance Window execution. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4014,7 +4014,7 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTasksRequest(input *DescribeMain // DescribeMaintenanceWindowExecutionTasks API operation for Amazon Simple Systems Manager (SSM). // -// For a given Maintenance Window execution, lists the tasks that were executed. +// For a given Maintenance Window execution, lists the tasks that were run. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5872,8 +5872,8 @@ func (c *SSM) GetMaintenanceWindowExecutionRequest(input *GetMaintenanceWindowEx // GetMaintenanceWindowExecution API operation for Amazon Simple Systems Manager (SSM). // -// Retrieves details about a specific task executed as part of a Maintenance -// Window execution. +// Retrieves details about a specific task run as part of a Maintenance Window +// execution. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5959,7 +5959,7 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskRequest(input *GetMaintenanceWind // GetMaintenanceWindowExecutionTask API operation for Amazon Simple Systems Manager (SSM). // -// Retrieves the details about a specific task executed as part of a Maintenance +// Retrieves the details about a specific task run as part of a Maintenance // Window execution. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -6046,7 +6046,7 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskInvocationRequest(input *GetMaint // GetMaintenanceWindowExecutionTaskInvocation API operation for Amazon Simple Systems Manager (SSM). // -// Retrieves a task invocation. A task invocation is a specific task executing +// Retrieves a task invocation. A task invocation is a specific task running // on a specific target. Maintenance Windows report status for all invocations. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -6825,6 +6825,103 @@ func (c *SSM) GetPatchBaselineForPatchGroupWithContext(ctx aws.Context, input *G return out, req.Send() } +const opGetServiceSetting = "GetServiceSetting" + +// GetServiceSettingRequest generates a "aws/request.Request" representing the +// client's request for the GetServiceSetting operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetServiceSetting for more information on using the GetServiceSetting +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetServiceSettingRequest method. +// req, resp := client.GetServiceSettingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetServiceSetting +func (c *SSM) GetServiceSettingRequest(input *GetServiceSettingInput) (req *request.Request, output *GetServiceSettingOutput) { + op := &request.Operation{ + Name: opGetServiceSetting, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetServiceSettingInput{} + } + + output = &GetServiceSettingOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetServiceSetting API operation for Amazon Simple Systems Manager (SSM). +// +// ServiceSetting is an account-level setting for an AWS service. This setting +// defines how a user interacts with or uses a service or a feature of a service. +// For example, if an AWS service charges money to the account based on feature +// or service usage, then the AWS service team might create a default setting +// of "false". This means the user can't use this feature unless they change +// the setting to "true" and intentionally opt in for a paid feature. +// +// Services map a SettingId object to a setting value. AWS services teams define +// the default value for a SettingId. You can't create a new SettingId, but +// you can overwrite the default value if you have the ssm:UpdateServiceSetting +// permission for the setting. Use the UpdateServiceSetting API action to change +// the default setting. Or use the ResetServiceSetting to change the value back +// to the original value defined by the AWS service team. +// +// Query the current service setting for the account. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s +// API operation GetServiceSetting for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInternalServerError "InternalServerError" +// An error occurred on the server side. +// +// * ErrCodeServiceSettingNotFound "ServiceSettingNotFound" +// The specified service setting was not found. Either the service name or the +// setting has not been provisioned by the AWS service team. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetServiceSetting +func (c *SSM) GetServiceSetting(input *GetServiceSettingInput) (*GetServiceSettingOutput, error) { + req, out := c.GetServiceSettingRequest(input) + return out, req.Send() +} + +// GetServiceSettingWithContext is the same as GetServiceSetting with the addition of +// the ability to pass a context and additional request options. +// +// See GetServiceSetting for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSM) GetServiceSettingWithContext(ctx aws.Context, input *GetServiceSettingInput, opts ...request.Option) (*GetServiceSettingOutput, error) { + req, out := c.GetServiceSettingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opLabelParameterVersion = "LabelParameterVersion" // LabelParameterVersionRequest generates a "aws/request.Request" representing the @@ -7221,8 +7318,8 @@ func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) // // An invocation is copy of a command sent to a specific instance. A command // can apply to one or more instances. A command invocation applies to one instance. -// For example, if a user executes SendCommand against three instances, then -// a command invocation is created for each requested instance ID. ListCommandInvocations +// For example, if a user runs SendCommand against three instances, then a command +// invocation is created for each requested instance ID. ListCommandInvocations // provide status about command execution. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -9238,6 +9335,108 @@ func (c *SSM) RemoveTagsFromResourceWithContext(ctx aws.Context, input *RemoveTa return out, req.Send() } +const opResetServiceSetting = "ResetServiceSetting" + +// ResetServiceSettingRequest generates a "aws/request.Request" representing the +// client's request for the ResetServiceSetting operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetServiceSetting for more information on using the ResetServiceSetting +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetServiceSettingRequest method. +// req, resp := client.ResetServiceSettingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ResetServiceSetting +func (c *SSM) ResetServiceSettingRequest(input *ResetServiceSettingInput) (req *request.Request, output *ResetServiceSettingOutput) { + op := &request.Operation{ + Name: opResetServiceSetting, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ResetServiceSettingInput{} + } + + output = &ResetServiceSettingOutput{} + req = c.newRequest(op, input, output) + return +} + +// ResetServiceSetting API operation for Amazon Simple Systems Manager (SSM). +// +// ServiceSetting is an account-level setting for an AWS service. This setting +// defines how a user interacts with or uses a service or a feature of a service. +// For example, if an AWS service charges money to the account based on feature +// or service usage, then the AWS service team might create a default setting +// of "false". This means the user can't use this feature unless they change +// the setting to "true" and intentionally opt in for a paid feature. +// +// Services map a SettingId object to a setting value. AWS services teams define +// the default value for a SettingId. You can't create a new SettingId, but +// you can overwrite the default value if you have the ssm:UpdateServiceSetting +// permission for the setting. Use the GetServiceSetting API action to view +// the current value. Use the UpdateServiceSetting API action to change the +// default setting. +// +// Reset the service setting for the account to the default value as provisioned +// by the AWS service team. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s +// API operation ResetServiceSetting for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInternalServerError "InternalServerError" +// An error occurred on the server side. +// +// * ErrCodeServiceSettingNotFound "ServiceSettingNotFound" +// The specified service setting was not found. Either the service name or the +// setting has not been provisioned by the AWS service team. +// +// * ErrCodeTooManyUpdates "TooManyUpdates" +// There are concurrent updates for a resource that supports one update at a +// time. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ResetServiceSetting +func (c *SSM) ResetServiceSetting(input *ResetServiceSettingInput) (*ResetServiceSettingOutput, error) { + req, out := c.ResetServiceSettingRequest(input) + return out, req.Send() +} + +// ResetServiceSettingWithContext is the same as ResetServiceSetting with the addition of +// the ability to pass a context and additional request options. +// +// See ResetServiceSetting for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSM) ResetServiceSettingWithContext(ctx aws.Context, input *ResetServiceSettingInput, opts ...request.Option) (*ResetServiceSettingOutput, error) { + req, out := c.ResetServiceSettingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opResumeSession = "ResumeSession" // ResumeSessionRequest generates a "aws/request.Request" representing the @@ -9464,7 +9663,7 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, // SendCommand API operation for Amazon Simple Systems Manager (SSM). // -// Executes commands on one or more managed instances. +// Runs commands on one or more managed instances. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9594,7 +9793,7 @@ func (c *SSM) StartAssociationsOnceRequest(input *StartAssociationsOnceInput) (r // StartAssociationsOnce API operation for Amazon Simple Systems Manager (SSM). // -// Use this API action to execute an association immediately and only one time. +// Use this API action to run an association immediately and only one time. // This action can be helpful when troubleshooting associations. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -9876,7 +10075,7 @@ func (c *SSM) StopAutomationExecutionRequest(input *StopAutomationExecutionInput // StopAutomationExecution API operation for Amazon Simple Systems Manager (SSM). // -// Stop an Automation that is currently executing. +// Stop an Automation that is currently running. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -10053,6 +10252,9 @@ func (c *SSM) UpdateAssociationRequest(input *UpdateAssociationInput) (req *requ // Updates an association. You can update the association name and version, // the document version, schedule, parameters, and Amazon S3 output. // +// When you update an association, the association immediately runs against +// the specified targets. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -10911,6 +11113,108 @@ func (c *SSM) UpdatePatchBaselineWithContext(ctx aws.Context, input *UpdatePatch return out, req.Send() } +const opUpdateServiceSetting = "UpdateServiceSetting" + +// UpdateServiceSettingRequest generates a "aws/request.Request" representing the +// client's request for the UpdateServiceSetting operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateServiceSetting for more information on using the UpdateServiceSetting +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateServiceSettingRequest method. +// req, resp := client.UpdateServiceSettingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateServiceSetting +func (c *SSM) UpdateServiceSettingRequest(input *UpdateServiceSettingInput) (req *request.Request, output *UpdateServiceSettingOutput) { + op := &request.Operation{ + Name: opUpdateServiceSetting, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateServiceSettingInput{} + } + + output = &UpdateServiceSettingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateServiceSetting API operation for Amazon Simple Systems Manager (SSM). +// +// ServiceSetting is an account-level setting for an AWS service. This setting +// defines how a user interacts with or uses a service or a feature of a service. +// For example, if an AWS service charges money to the account based on feature +// or service usage, then the AWS service team might create a default setting +// of "false". This means the user can't use this feature unless they change +// the setting to "true" and intentionally opt in for a paid feature. +// +// Services map a SettingId object to a setting value. AWS services teams define +// the default value for a SettingId. You can't create a new SettingId, but +// you can overwrite the default value if you have the ssm:UpdateServiceSetting +// permission for the setting. Use the GetServiceSetting API action to view +// the current value. Or, use the ResetServiceSetting to change the value back +// to the original value defined by the AWS service team. +// +// Update the service setting for the account. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s +// API operation UpdateServiceSetting for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInternalServerError "InternalServerError" +// An error occurred on the server side. +// +// * ErrCodeServiceSettingNotFound "ServiceSettingNotFound" +// The specified service setting was not found. Either the service name or the +// setting has not been provisioned by the AWS service team. +// +// * ErrCodeTooManyUpdates "TooManyUpdates" +// There are concurrent updates for a resource that supports one update at a +// time. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateServiceSetting +func (c *SSM) UpdateServiceSetting(input *UpdateServiceSettingInput) (*UpdateServiceSettingOutput, error) { + req, out := c.UpdateServiceSettingRequest(input) + return out, req.Send() +} + +// UpdateServiceSettingWithContext is the same as UpdateServiceSetting with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateServiceSetting for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSM) UpdateServiceSettingWithContext(ctx aws.Context, input *UpdateServiceSettingInput, opts ...request.Option) (*UpdateServiceSettingOutput, error) { + req, out := c.UpdateServiceSettingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + // An activation registers one or more on-premises servers or virtual machines // (VMs) with AWS so that you can configure those servers or VMs using Run Command. // A server or VM that has been registered with AWS is called a managed instance. @@ -11281,8 +11585,8 @@ type AssociationDescription struct { // set, for example 10%. The default value is 100%, which means all targets // run the association at the same time. // - // If a new instance starts and attempts to execute an association while Systems - // Manager is executing MaxConcurrency associations, the association is allowed + // If a new instance starts and attempts to run an association while Systems + // Manager is running MaxConcurrency associations, the association is allowed // to run. During the next association interval, the new instance will process // its association within the limit specified for MaxConcurrency. MaxConcurrency *string `min:"1" type:"string"` @@ -11975,8 +12279,8 @@ type AssociationVersionInfo struct { // set, for example 10%. The default value is 100%, which means all targets // run the association at the same time. // - // If a new instance starts and attempts to execute an association while Systems - // Manager is executing MaxConcurrency associations, the association is allowed + // If a new instance starts and attempts to run an association while Systems + // Manager is running MaxConcurrency associations, the association is allowed // to run. During the next association interval, the new instance will process // its association within the limit specified for MaxConcurrency. MaxConcurrency *string `min:"1" type:"string"` @@ -12246,10 +12550,10 @@ type AutomationExecution struct { // The execution status of the Automation. AutomationExecutionStatus *string `type:"string" enum:"AutomationExecutionStatus"` - // The action of the currently executing step. + // The action of the step that is currently running. CurrentAction *string `type:"string"` - // The name of the currently executing step. + // The name of the step that is currently running. CurrentStepName *string `type:"string"` // The name of the Automation document used during the execution. @@ -12258,7 +12562,7 @@ type AutomationExecution struct { // The version of the document to use during execution. DocumentVersion *string `type:"string"` - // The Amazon Resource Name (ARN) of the user who executed the automation. + // The Amazon Resource Name (ARN) of the user who ran the automation. ExecutedBy *string `type:"string"` // The time the execution finished. @@ -12298,7 +12602,7 @@ type AutomationExecution struct { ResolvedTargets *ResolvedTargets `type:"structure"` // A list of details about the current state of all steps that comprise an execution. - // An Automation document contains a list of steps that are executed in order. + // An Automation document contains a list of steps that are run in order. StepExecutions []*StepExecution `type:"list"` // A boolean value that indicates if the response contains the full list of @@ -12309,7 +12613,7 @@ type AutomationExecution struct { // The target of the execution. Target *string `type:"string"` - // The combination of AWS Regions and/or AWS accounts where you want to execute + // The combination of AWS Regions and/or AWS accounts where you want to run // the Automation. TargetLocations []*TargetLocation `min:"1" type:"list"` @@ -12555,16 +12859,16 @@ type AutomationExecutionMetadata struct { AutomationExecutionStatus *string `type:"string" enum:"AutomationExecutionStatus"` // Use this filter with DescribeAutomationExecutions. Specify either Local or - // CrossAccount. CrossAccount is an Automation that executes in multiple AWS - // Regions and accounts. For more information, see Concurrently Executing Automations - // in Multiple AWS Regions and Accounts (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) + // CrossAccount. CrossAccount is an Automation that runs in multiple AWS Regions + // and accounts. For more information, see Executing Automations in Multiple + // AWS Regions and Accounts (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) // in the AWS Systems Manager User Guide. AutomationType *string `type:"string" enum:"AutomationType"` - // The action of the currently executing step. + // The action of the step that is currently running. CurrentAction *string `type:"string"` - // The name of the currently executing step. + // The name of the step that is currently running. CurrentStepName *string `type:"string"` // The name of the Automation document used during execution. @@ -12573,7 +12877,7 @@ type AutomationExecutionMetadata struct { // The document version used during the execution. DocumentVersion *string `type:"string"` - // The IAM role ARN of the user who executed the Automation. + // The IAM role ARN of the user who ran the Automation. ExecutedBy *string `type:"string"` // The time the execution finished. This is not populated if the execution is @@ -12974,7 +13278,7 @@ type Command struct { // The number of targets for which the status is Failed or Execution Timed Out. ErrorCount *int64 `type:"integer"` - // If this time is reached and the command has not already started executing, + // If this time is reached and the command has not already started running, // it will not run. Calculated based on the ExpiresAfter user input provided // as part of the SendCommand API. ExpiresAfter *time.Time `type:"timestamp"` @@ -12982,10 +13286,10 @@ type Command struct { // The instance IDs against which this command was requested. InstanceIds []*string `type:"list"` - // The maximum number of instances that are allowed to execute the command at - // the same time. You can specify a number of instances, such as 10, or a percentage + // The maximum number of instances that are allowed to run the command at the + // same time. You can specify a number of instances, such as 10, or a percentage // of instances, such as 10%. The default value is 50. For more information - // about how to use MaxConcurrency, see Executing Commands Using Systems Manager + // about how to use MaxConcurrency, see Running Commands Using Systems Manager // Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) // in the AWS Systems Manager User Guide. MaxConcurrency *string `min:"1" type:"string"` @@ -12993,7 +13297,7 @@ type Command struct { // The maximum number of errors allowed before the system stops sending the // command to additional targets. You can specify a number of errors, such as // 10, or a percentage or errors, such as 10%. The default value is 0. For more - // information about how to use MaxErrors, see Executing Commands Using Systems + // information about how to use MaxErrors, see Running Commands Using Systems // Manager Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html) // in the AWS Systems Manager User Guide. MaxErrors *string `min:"1" type:"string"` @@ -13014,7 +13318,7 @@ type Command struct { // region. OutputS3Region *string `min:"3" type:"string"` - // The parameter values to be inserted in the document when executing the command. + // The parameter values to be inserted in the document when running the command. Parameters map[string][]*string `type:"map"` // The date and time the command was requested. @@ -13040,8 +13344,8 @@ type Command struct { // * In Progress: The command has been sent to at least one instance but // has not reached a final state on all instances. // - // * Success: The command successfully executed on all invocations. This - // is a terminal state. + // * Success: The command successfully ran on all invocations. This is a + // terminal state. // // * Delivery Timed Out: The value of MaxErrors or more command invocations // shows a status of Delivery Timed Out. This is a terminal state. @@ -13061,7 +13365,7 @@ type Command struct { // // * Rate Exceeded: The number of instances targeted by the command exceeded // the account limit for pending invocations. The system has canceled the - // command before executing it on any instance. This is a terminal state. + // command before running it on any instance. This is a terminal state. StatusDetails *string `type:"string"` // The number of targets for the command. @@ -13316,9 +13620,9 @@ func (s *CommandFilter) SetValue(v string) *CommandFilter { // An invocation is copy of a command sent to a specific instance. A command // can apply to one or more instances. A command invocation applies to one instance. -// For example, if a user executes SendCommand against three instances, then -// a command invocation is created for each requested instance ID. A command -// invocation returns status and detail information about a command you executed. +// For example, if a user runs SendCommand against three instances, then a command +// invocation is created for each requested instance ID. A command invocation +// returns status and detail information about a command you ran. type CommandInvocation struct { _ struct{} `type:"structure"` @@ -13577,14 +13881,14 @@ type CommandPlugin struct { // region. OutputS3Region *string `min:"3" type:"string"` - // A numeric response code generated after executing the plugin. + // A numeric response code generated after running the plugin. ResponseCode *int64 `type:"integer"` - // The time the plugin stopped executing. Could stop prematurely if, for example, + // The time the plugin stopped running. Could stop prematurely if, for example, // a cancel command was sent. ResponseFinishDateTime *time.Time `type:"timestamp"` - // The time the plugin started executing. + // The time the plugin started running. ResponseStartDateTime *time.Time `type:"timestamp"` // The URL for the complete text written by the plugin to stderr. If execution @@ -13596,7 +13900,7 @@ type CommandPlugin struct { // is empty. StandardOutputUrl *string `type:"string"` - // The status of this plugin. You can execute a document with multiple plugins. + // The status of this plugin. You can run a document with multiple plugins. Status *string `type:"string" enum:"CommandPluginStatus"` // A detailed status of the plugin execution. StatusDetails includes more information @@ -14384,8 +14688,8 @@ type CreateAssociationBatchRequestEntry struct { // set, for example 10%. The default value is 100%, which means all targets // run the association at the same time. // - // If a new instance starts and attempts to execute an association while Systems - // Manager is executing MaxConcurrency associations, the association is allowed + // If a new instance starts and attempts to run an association while Systems + // Manager is running MaxConcurrency associations, the association is allowed // to run. During the next association interval, the new instance will process // its association within the limit specified for MaxConcurrency. MaxConcurrency *string `min:"1" type:"string"` @@ -14406,7 +14710,7 @@ type CreateAssociationBatchRequestEntry struct { MaxErrors *string `min:"1" type:"string"` // The name of the SSM document that contains the configuration information - // for the instance. You can specify Command, Policy, or Automation documents. + // for the instance. You can specify Command or Automation documents. // // You can specify AWS-predefined documents, documents you created, or a document // that is shared with you from another account. @@ -14587,8 +14891,8 @@ type CreateAssociationInput struct { // set, for example 10%. The default value is 100%, which means all targets // run the association at the same time. // - // If a new instance starts and attempts to execute an association while Systems - // Manager is executing MaxConcurrency associations, the association is allowed + // If a new instance starts and attempts to run an association while Systems + // Manager is running MaxConcurrency associations, the association is allowed // to run. During the next association interval, the new instance will process // its association within the limit specified for MaxConcurrency. MaxConcurrency *string `min:"1" type:"string"` @@ -14609,7 +14913,7 @@ type CreateAssociationInput struct { MaxErrors *string `min:"1" type:"string"` // The name of the SSM document that contains the configuration information - // for the instance. You can specify Command, Policy, or Automation documents. + // for the instance. You can specify Command or Automation documents. // // You can specify AWS-predefined documents, documents you created, or a document // that is shared with you from another account. @@ -14973,10 +15277,10 @@ func (s *CreateDocumentOutput) SetDocumentDescription(v *DocumentDescription) *C type CreateMaintenanceWindowInput struct { _ struct{} `type:"structure"` - // Enables a Maintenance Window task to execute on managed instances, even if - // you have not registered those instances as targets. If enabled, then you - // must specify the unregistered instances (by instance ID) when you register - // a task with the Maintenance Window + // Enables a Maintenance Window task to run on managed instances, even if you + // have not registered those instances as targets. If enabled, then you must + // specify the unregistered instances (by instance ID) when you register a task + // with the Maintenance Window // // If you don't enable this option, then you must specify previously-registered // targets when you register a task with the Maintenance Window. @@ -20289,7 +20593,7 @@ func (s *DocumentKeyValuesFilter) SetValues(v []*string) *DocumentKeyValuesFilte return s } -// Parameters specified in a System Manager document that execute on the server +// Parameters specified in a System Manager document that run on the server // when the command is run. type DocumentParameter struct { _ struct{} `type:"structure"` @@ -20712,7 +21016,7 @@ type GetCommandInvocationOutput struct { // The comment text for the command. Comment *string `type:"string"` - // The name of the document that was executed. For example, AWS-RunShellScript. + // The name of the document that was run. For example, AWS-RunShellScript. DocumentName *string `type:"string"` // The SSM document version used in the request. @@ -20721,22 +21025,22 @@ type GetCommandInvocationOutput struct { // Duration since ExecutionStartDateTime. ExecutionElapsedTime *string `type:"string"` - // The date and time the plugin was finished executing. Date and time are written + // The date and time the plugin was finished running. Date and time are written // in ISO 8601 format. For example, June 7, 2017 is represented as 2017-06-7. // The following sample AWS CLI command uses the InvokedAfter filter. // // aws ssm list-commands --filters key=InvokedAfter,value=2017-06-07T00:00:00Z // - // If the plugin has not started to execute, the string is empty. + // If the plugin has not started to run, the string is empty. ExecutionEndDateTime *string `type:"string"` - // The date and time the plugin started executing. Date and time are written - // in ISO 8601 format. For example, June 7, 2017 is represented as 2017-06-7. - // The following sample AWS CLI command uses the InvokedBefore filter. + // The date and time the plugin started running. Date and time are written in + // ISO 8601 format. For example, June 7, 2017 is represented as 2017-06-7. The + // following sample AWS CLI command uses the InvokedBefore filter. // // aws ssm list-commands --filters key=InvokedBefore,value=2017-06-07T00:00:00Z // - // If the plugin has not started to execute, the string is empty. + // If the plugin has not started to run, the string is empty. ExecutionStartDateTime *string `type:"string"` // The ID of the managed instance targeted by the command. A managed instance @@ -20749,20 +21053,20 @@ type GetCommandInvocationOutput struct { PluginName *string `min:"4" type:"string"` // The error level response code for the plugin script. If the response code - // is -1, then the command has not started executing on the instance, or it - // was not received by the instance. + // is -1, then the command has not started running on the instance, or it was + // not received by the instance. ResponseCode *int64 `type:"integer"` // The first 8,000 characters written by the plugin to stderr. If the command - // has not finished executing, then this string is empty. + // has not finished running, then this string is empty. StandardErrorContent *string `type:"string"` // The URL for the complete text written by the plugin to stderr. If the command - // has not finished executing, then this string is empty. + // has not finished running, then this string is empty. StandardErrorUrl *string `type:"string"` // The first 24,000 characters written by the plugin to stdout. If the command - // has not finished executing, if ExecutionStatus is neither Succeeded nor Failed, + // has not finished running, if ExecutionStatus is neither Succeeded nor Failed, // then this string is empty. StandardOutputContent *string `type:"string"` @@ -20791,24 +21095,24 @@ type GetCommandInvocationOutput struct { // of network issues, the instance was stopped, etc. The system will try // to deliver the command again. // - // * Success: The command or plugin was executed successfully. This is a - // terminal state. + // * Success: The command or plugin was run successfully. This is a terminal + // state. // // * Delivery Timed Out: The command was not delivered to the instance before // the delivery timeout expired. Delivery timeouts do not count against the // parent command's MaxErrors limit, but they do contribute to whether the // parent command status is Success or Incomplete. This is a terminal state. // - // * Execution Timed Out: The command started to execute on the instance, - // but the execution was not complete before the timeout expired. Execution - // timeouts count against the MaxErrors limit of the parent command. This - // is a terminal state. + // * Execution Timed Out: The command started to run on the instance, but + // the execution was not complete before the timeout expired. Execution timeouts + // count against the MaxErrors limit of the parent command. This is a terminal + // state. // - // * Failed: The command wasn't executed successfully on the instance. For - // a plugin, this indicates that the result code was not zero. For a command - // invocation, this indicates that the result code for one or more plugins - // was not zero. Invocation failures count against the MaxErrors limit of - // the parent command. This is a terminal state. + // * Failed: The command wasn't run successfully on the instance. For a plugin, + // this indicates that the result code was not zero. For a command invocation, + // this indicates that the result code for one or more plugins was not zero. + // Invocation failures count against the MaxErrors limit of the parent command. + // This is a terminal state. // // * Canceled: The command was terminated before it was completed. This is // a terminal state. @@ -21646,10 +21950,10 @@ func (s *GetMaintenanceWindowExecutionInput) SetWindowExecutionId(v string) *Get type GetMaintenanceWindowExecutionOutput struct { _ struct{} `type:"structure"` - // The time the Maintenance Window finished executing. + // The time the Maintenance Window finished running. EndTime *time.Time `type:"timestamp"` - // The time the Maintenance Window started executing. + // The time the Maintenance Window started running. StartTime *time.Time `type:"timestamp"` // The status of the Maintenance Window execution. @@ -21849,7 +22153,7 @@ func (s *GetMaintenanceWindowExecutionTaskInvocationInput) SetWindowExecutionId( type GetMaintenanceWindowExecutionTaskInvocationOutput struct { _ struct{} `type:"structure"` - // The time that the task finished executing on the target. + // The time that the task finished running on the target. EndTime *time.Time `type:"timestamp"` // The execution ID. @@ -21862,10 +22166,10 @@ type GetMaintenanceWindowExecutionTaskInvocationOutput struct { // running tasks for these targets in this Maintenance Window. OwnerInformation *string `min:"1" type:"string" sensitive:"true"` - // The parameters used at the time that the task executed. + // The parameters used at the time that the task ran. Parameters *string `type:"string" sensitive:"true"` - // The time that the task started executing on the target. + // The time that the task started running on the target. StartTime *time.Time `type:"timestamp"` // The task status for an invocation. @@ -21987,7 +22291,7 @@ type GetMaintenanceWindowExecutionTaskOutput struct { // The priority of the task. Priority *int64 `type:"integer"` - // The role that was assumed when executing the task. + // The role that was assumed when running the task. ServiceRole *string `type:"string"` // The time the task execution started. @@ -21999,14 +22303,14 @@ type GetMaintenanceWindowExecutionTaskOutput struct { // The details explaining the Status. Only available for certain status values. StatusDetails *string `type:"string"` - // The ARN of the executed task. + // The ARN of the task that ran. TaskArn *string `min:"1" type:"string"` // The ID of the specific task execution in the Maintenance Window task that // was retrieved. TaskExecutionId *string `min:"36" type:"string"` - // The parameters passed to the task when it was executed. + // The parameters passed to the task when it was run. // // TaskParameters has been deprecated. To specify parameters to pass to a task // when it runs, instead use the Parameters option in the TaskInvocationParameters @@ -22020,7 +22324,7 @@ type GetMaintenanceWindowExecutionTaskOutput struct { // Value: an array of strings, each string is between 1 and 255 characters TaskParameters []map[string]*MaintenanceWindowTaskParameterValueExpression `type:"list" sensitive:"true"` - // The type of task executed. + // The type of task that was run. Type *string `type:"string" enum:"MaintenanceWindowTaskType"` // The ID of the Maintenance Window execution that includes the task. @@ -22387,14 +22691,14 @@ type GetMaintenanceWindowTaskOutput struct { // The retrieved task name. Name *string `min:"3" type:"string"` - // The priority of the task when it executes. The lower the number, the higher - // the priority. Tasks that have the same priority are scheduled in parallel. + // The priority of the task when it runs. The lower the number, the higher the + // priority. Tasks that have the same priority are scheduled in parallel. Priority *int64 `type:"integer"` // The IAM service role to assume during task execution. ServiceRoleArn *string `type:"string"` - // The targets where the task should execute. + // The targets where the task should run. Targets []*Target `type:"list"` // The resource that the task used during execution. For RUN_COMMAND and AUTOMATION @@ -22403,10 +22707,10 @@ type GetMaintenanceWindowTaskOutput struct { // is the state machine ARN. TaskArn *string `min:"1" type:"string"` - // The parameters to pass to the task when it executes. + // The parameters to pass to the task when it runs. TaskInvocationParameters *MaintenanceWindowTaskInvocationParameters `type:"structure"` - // The parameters to pass to the task when it executes. + // The parameters to pass to the task when it runs. // // TaskParameters has been deprecated. To specify parameters to pass to a task // when it runs, instead use the Parameters option in the TaskInvocationParameters @@ -22414,7 +22718,7 @@ type GetMaintenanceWindowTaskOutput struct { // for the supported Maintenance Window task types, see MaintenanceWindowTaskInvocationParameters. TaskParameters map[string]*MaintenanceWindowTaskParameterValueExpression `type:"map" sensitive:"true"` - // The type of task to execute. + // The type of task to run. TaskType *string `type:"string" enum:"MaintenanceWindowTaskType"` // The retrieved Maintenance Window ID. @@ -22728,8 +23032,8 @@ type GetParametersByPathInput struct { // If a user has access to a path, then the user can access all levels of that // path. For example, if a user has permission to access path /a, then the user // can also access /a/b. Even if a user has explicitly been denied access in - // IAM for parameter /a, they can still call the GetParametersByPath API action - // recursively and view /a/b. + // IAM for parameter /a/b, they can still call the GetParametersByPath API action + // recursively for /a and view /a/b. Recursive *bool `type:"boolean"` // Retrieve all parameters in a hierarchy with their value decrypted. @@ -23217,6 +23521,72 @@ func (s *GetPatchBaselineOutput) SetSources(v []*PatchSource) *GetPatchBaselineO return s } +// The request body of the GetServiceSetting API action. +type GetServiceSettingInput struct { + _ struct{} `type:"structure"` + + // The ID of the service setting to get. + // + // SettingId is a required field + SettingId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetServiceSettingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceSettingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetServiceSettingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetServiceSettingInput"} + if s.SettingId == nil { + invalidParams.Add(request.NewErrParamRequired("SettingId")) + } + if s.SettingId != nil && len(*s.SettingId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SettingId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSettingId sets the SettingId field's value. +func (s *GetServiceSettingInput) SetSettingId(v string) *GetServiceSettingInput { + s.SettingId = &v + return s +} + +// The query result body of the GetServiceSetting API action. +type GetServiceSettingOutput struct { + _ struct{} `type:"structure"` + + // The query result of the current service setting. + ServiceSetting *ServiceSetting `type:"structure"` +} + +// String returns the string representation +func (s GetServiceSettingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceSettingOutput) GoString() string { + return s.String() +} + +// SetServiceSetting sets the ServiceSetting field's value. +func (s *GetServiceSettingOutput) SetServiceSetting(v *ServiceSetting) *GetServiceSettingOutput { + s.ServiceSetting = v + return s +} + // Status information about the aggregated associations. type InstanceAggregatedAssociationOverview struct { _ struct{} `type:"structure"` @@ -23386,7 +23756,7 @@ type InstanceAssociationStatusInfo struct { // An error code returned by the request to create the association. ErrorCode *string `type:"string"` - // The date the instance association executed. + // The date the instance association ran. ExecutionDate *time.Time `type:"timestamp"` // Summary information about association execution. @@ -23524,7 +23894,7 @@ type InstanceInformation struct { // the latest version is installed on Windows managed instances. IsLatestVersion *bool `type:"boolean"` - // The date the association was last executed. + // The date the association was last run. LastAssociationExecutionDate *time.Time `type:"timestamp"` // The date and time when agent last pinged Systems Manager service. @@ -26410,13 +26780,13 @@ type MaintenanceWindowExecutionTaskIdentity struct { // certain status values. StatusDetails *string `type:"string"` - // The ARN of the executed task. + // The ARN of the task that ran. TaskArn *string `min:"1" type:"string"` // The ID of the specific task execution in the Maintenance Window execution. TaskExecutionId *string `min:"36" type:"string"` - // The type of executed task. + // The type of task that ran. TaskType *string `type:"string" enum:"MaintenanceWindowTaskType"` // The ID of the Maintenance Window execution that ran the task. @@ -26501,7 +26871,7 @@ type MaintenanceWindowExecutionTaskInvocationIdentity struct { // during the task invocation. OwnerInformation *string `min:"1" type:"string" sensitive:"true"` - // The parameters that were provided for the invocation when it was executed. + // The parameters that were provided for the invocation when it was run. Parameters *string `type:"string" sensitive:"true"` // The time the invocation started. @@ -26909,7 +27279,7 @@ func (s *MaintenanceWindowLambdaParameters) SetQualifier(v string) *MaintenanceW type MaintenanceWindowRunCommandParameters struct { _ struct{} `type:"structure"` - // Information about the command(s) to execute. + // Information about the command(s) to run. Comment *string `type:"string"` // The SHA-256 or SHA-1 hash created by the system when the document was created. @@ -26935,7 +27305,7 @@ type MaintenanceWindowRunCommandParameters struct { // The IAM service role to assume during task execution. ServiceRoleArn *string `type:"string"` - // If this time is reached and the command has not already started executing, + // If this time is reached and the command has not already started running, // it doesn't run. TimeoutSeconds *int64 `min:"30" type:"integer"` } @@ -27191,7 +27561,7 @@ type MaintenanceWindowTask struct { // in parallel. Priority *int64 `type:"integer"` - // The role that should be assumed when executing the task + // The role that should be assumed when running the task. ServiceRoleArn *string `type:"string"` // The targets (either instances or tags). Instances are specified using Key=instanceids,Values=,. @@ -27204,7 +27574,7 @@ type MaintenanceWindowTask struct { // machine ARN. TaskArn *string `min:"1" type:"string"` - // The parameters that should be passed to the task when it is executed. + // The parameters that should be passed to the task when it is run. // // TaskParameters has been deprecated. To specify parameters to pass to a task // when it runs, instead use the Parameters option in the TaskInvocationParameters @@ -29199,7 +29569,7 @@ type ProgressCounters struct { // Regions and accounts for the current Automation execution. CancelledSteps *int64 `type:"integer"` - // The total number of steps that failed to execute in all specified AWS Regions + // The total number of steps that failed to run in all specified AWS Regions // and accounts for the current Automation execution. FailedSteps *int64 `type:"integer"` @@ -29211,8 +29581,8 @@ type ProgressCounters struct { // accounts for the current Automation execution. TimedOutSteps *int64 `type:"integer"` - // The total number of steps executed in all specified AWS Regions and accounts - // for the current Automation execution. + // The total number of steps run in all specified AWS Regions and accounts for + // the current Automation execution. TotalSteps *int64 `type:"integer"` } @@ -30095,7 +30465,7 @@ type RegisterTaskWithMaintenanceWindowInput struct { // Targets is a required field Targets []*Target `type:"list" required:"true"` - // The ARN of the task to execute + // The ARN of the task to run. // // TaskArn is a required field TaskArn *string `min:"1" type:"string" required:"true"` @@ -30104,7 +30474,7 @@ type RegisterTaskWithMaintenanceWindowInput struct { // fields that match the task type. All other fields should be empty. TaskInvocationParameters *MaintenanceWindowTaskInvocationParameters `type:"structure"` - // The parameters that should be passed to the task when it is executed. + // The parameters that should be passed to the task when it is run. // // TaskParameters has been deprecated. To specify parameters to pass to a task // when it runs, instead use the Parameters option in the TaskInvocationParameters @@ -30406,6 +30776,73 @@ func (s RemoveTagsFromResourceOutput) GoString() string { return s.String() } +// The request body of the ResetServiceSetting API action. +type ResetServiceSettingInput struct { + _ struct{} `type:"structure"` + + // The ID of the service setting to reset. + // + // SettingId is a required field + SettingId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResetServiceSettingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetServiceSettingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResetServiceSettingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResetServiceSettingInput"} + if s.SettingId == nil { + invalidParams.Add(request.NewErrParamRequired("SettingId")) + } + if s.SettingId != nil && len(*s.SettingId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SettingId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSettingId sets the SettingId field's value. +func (s *ResetServiceSettingInput) SetSettingId(v string) *ResetServiceSettingInput { + s.SettingId = &v + return s +} + +// The result body of the ResetServiceSetting API action. +type ResetServiceSettingOutput struct { + _ struct{} `type:"structure"` + + // The current, effective service setting after calling the ResetServiceSetting + // API action. + ServiceSetting *ServiceSetting `type:"structure"` +} + +// String returns the string representation +func (s ResetServiceSettingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetServiceSettingOutput) GoString() string { + return s.String() +} + +// SetServiceSetting sets the ServiceSetting field's value. +func (s *ResetServiceSettingOutput) SetServiceSetting(v *ServiceSetting) *ResetServiceSettingOutput { + s.ServiceSetting = v + return s +} + // Information about targets that resolved during the Automation execution. type ResolvedTargets struct { _ struct{} `type:"structure"` @@ -31073,17 +31510,17 @@ type SendCommandInput struct { // Sha1 hashes have been deprecated. DocumentHashType *string `type:"string" enum:"DocumentHashType"` - // Required. The name of the Systems Manager document to execute. This can be - // a public document or a custom document. + // Required. The name of the Systems Manager document to run. This can be a + // public document or a custom document. // // DocumentName is a required field DocumentName *string `type:"string" required:"true"` // The SSM document version to use in the request. You can specify $DEFAULT, - // $LATEST, or a specific version number. If you execute commands by using the - // AWS CLI, then you must escape the first two options by using a backslash. - // If you specify a version number, then you don't need to use the backslash. - // For example: + // $LATEST, or a specific version number. If you run commands by using the AWS + // CLI, then you must escape the first two options by using a backslash. If + // you specify a version number, then you don't need to use the backslash. For + // example: // // --document-version "\$DEFAULT" // @@ -31092,7 +31529,7 @@ type SendCommandInput struct { // --document-version "3" DocumentVersion *string `type:"string"` - // The instance IDs where the command should execute. You can specify a maximum + // The instance IDs where the command should run. You can specify a maximum // of 50 IDs. If you prefer not to list individual instance IDs, you can instead // send commands to a fleet of instances using the Targets parameter, which // accepts EC2 tags. For more information about how to use targets, see Sending @@ -31100,10 +31537,10 @@ type SendCommandInput struct { // in the AWS Systems Manager User Guide. InstanceIds []*string `type:"list"` - // (Optional) The maximum number of instances that are allowed to execute the - // command at the same time. You can specify a number such as 10 or a percentage - // such as 10%. The default value is 50. For more information about how to use - // MaxConcurrency, see Using Concurrency Controls (http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-velocity) + // (Optional) The maximum number of instances that are allowed to run the command + // at the same time. You can specify a number such as 10 or a percentage such + // as 10%. The default value is 50. For more information about how to use MaxConcurrency, + // see Using Concurrency Controls (http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html#send-commands-velocity) // in the AWS Systems Manager User Guide. MaxConcurrency *string `min:"1" type:"string"` @@ -31130,7 +31567,7 @@ type SendCommandInput struct { // region. OutputS3Region *string `min:"3" type:"string"` - // The required and optional parameters specified in the document being executed. + // The required and optional parameters specified in the document being run. Parameters map[string][]*string `type:"map"` // The IAM role that Systems Manager uses to send notifications. @@ -31143,7 +31580,7 @@ type SendCommandInput struct { // in the AWS Systems Manager User Guide. Targets []*Target `type:"list"` - // If this time is reached and the command has not already started executing, + // If this time is reached and the command has not already started running, // it will not run. TimeoutSeconds *int64 `min:"30" type:"integer"` } @@ -31327,6 +31764,100 @@ func (s *SendCommandOutput) SetCommand(v *Command) *SendCommandOutput { return s } +// The service setting data structure. +// +// ServiceSetting is an account-level setting for an AWS service. This setting +// defines how a user interacts with or uses a service or a feature of a service. +// For example, if an AWS service charges money to the account based on feature +// or service usage, then the AWS service team might create a default setting +// of "false". This means the user can't use this feature unless they change +// the setting to "true" and intentionally opt in for a paid feature. +// +// Services map a SettingId object to a setting value. AWS services teams define +// the default value for a SettingId. You can't create a new SettingId, but +// you can overwrite the default value if you have the ssm:UpdateServiceSetting +// permission for the setting. Use the UpdateServiceSetting API action to change +// the default setting. Or, use the ResetServiceSetting to change the value +// back to the original value defined by the AWS service team. +type ServiceSetting struct { + _ struct{} `type:"structure"` + + // The ARN of the service setting. + ARN *string `type:"string"` + + // The last time the service setting was modified. + LastModifiedDate *time.Time `type:"timestamp"` + + // The ARN of the last modified user. This field is populated only if the setting + // value was overwritten. + LastModifiedUser *string `type:"string"` + + // The ID of the service setting. + SettingId *string `min:"1" type:"string"` + + // The value of the service setting. + SettingValue *string `min:"1" type:"string"` + + // The status of the service setting. The value can be Default, Customized or + // PendingUpdate. + // + // * Default: The current setting uses a default value provisioned by the + // AWS service team. + // + // * Customized: The current setting use a custom value specified by the + // customer. + // + // * PendingUpdate: The current setting uses a default or custom value, but + // a setting change request is pending approval. + Status *string `type:"string"` +} + +// String returns the string representation +func (s ServiceSetting) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceSetting) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *ServiceSetting) SetARN(v string) *ServiceSetting { + s.ARN = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ServiceSetting) SetLastModifiedDate(v time.Time) *ServiceSetting { + s.LastModifiedDate = &v + return s +} + +// SetLastModifiedUser sets the LastModifiedUser field's value. +func (s *ServiceSetting) SetLastModifiedUser(v string) *ServiceSetting { + s.LastModifiedUser = &v + return s +} + +// SetSettingId sets the SettingId field's value. +func (s *ServiceSetting) SetSettingId(v string) *ServiceSetting { + s.SettingId = &v + return s +} + +// SetSettingValue sets the SettingValue field's value. +func (s *ServiceSetting) SetSettingValue(v string) *ServiceSetting { + s.SettingValue = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ServiceSetting) SetStatus(v string) *ServiceSetting { + s.Status = &v + return s +} + // Information about a Session Manager connection to an instance. type Session struct { _ struct{} `type:"structure"` @@ -31626,7 +32157,7 @@ func (s *SeveritySummary) SetUnspecifiedCount(v int64) *SeveritySummary { type StartAssociationsOnceInput struct { _ struct{} `type:"structure"` - // The association IDs that you want to execute immediately and only one time. + // The association IDs that you want to run immediately and only one time. // // AssociationIds is a required field AssociationIds []*string `min:"1" type:"list" required:"true"` @@ -31723,9 +32254,9 @@ type StartAutomationExecutionInput struct { Parameters map[string][]*string `min:"1" type:"map"` // A location is a combination of AWS Regions and/or AWS accounts where you - // want to execute the Automation. Use this action to start an Automation in - // multiple Regions and multiple accounts. For more information, see Concurrently - // Executing Automations in Multiple AWS Regions and Accounts (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) + // want to run the Automation. Use this action to start an Automation in multiple + // Regions and multiple accounts. For more information, see Executing Automations + // in Multiple AWS Regions and Accounts (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) // in the AWS Systems Manager User Guide. TargetLocations []*TargetLocation `min:"1" type:"list"` @@ -32049,7 +32580,7 @@ type StepExecution struct { // Returned values from the execution of the step. Outputs map[string][]*string `min:"1" type:"map"` - // A user-specified list of parameters to override when executing a step. + // A user-specified list of parameters to override when running a step. OverriddenParameters map[string][]*string `min:"1" type:"map"` // A message associated with the response code for an execution. @@ -32080,7 +32611,7 @@ type StepExecution struct { // Strategies used when step fails, we support Continue and Abort. Abort will // fail the automation when the step fails. Continue will ignore the failure - // of current step and allow automation to execute the next step. With conditional + // of current step and allow automation to run the next step. With conditional // branching, we add step:stepName to support the automation to go to another // specific step. ValidNextSteps []*string `type:"list"` @@ -32428,10 +32959,10 @@ type Target struct { Key *string `min:"1" type:"string"` // User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, - // you could specify value:WebServer to execute a command on instances that - // include Amazon EC2 tags of ServerRole,WebServer. For more information about - // how to send commands that target instances using Key,Value parameters, see - // Sending Commands to a Fleet (http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html) + // you could specify value:WebServer to run a command on instances that include + // Amazon EC2 tags of ServerRole,WebServer. For more information about how to + // send commands that target instances using Key,Value parameters, see Sending + // Commands to a Fleet (http://docs.aws.amazon.com/systems-manager/latest/userguide/send-commands-multiple.html) // in the AWS Systems Manager User Guide. Values []*string `type:"list"` } @@ -32479,7 +33010,7 @@ type TargetLocation struct { // The AWS accounts targeted by the current Automation execution. Accounts []*string `min:"1" type:"list"` - // The Automation execution role used by the currently executing Automation. + // The Automation execution role used by the currently running Automation. ExecutionRoleName *string `min:"1" type:"string"` // The AWS Regions targeted by the current Automation execution. @@ -32490,7 +33021,7 @@ type TargetLocation struct { TargetLocationMaxConcurrency *string `min:"1" type:"string"` // The maxium number of errors allowed before the system stops queueing additional - // Automation executions for the currently executing Automation. + // Automation executions for the currently running Automation. TargetLocationMaxErrors *string `min:"1" type:"string"` } @@ -32654,8 +33185,8 @@ type UpdateAssociationInput struct { // set, for example 10%. The default value is 100%, which means all targets // run the association at the same time. // - // If a new instance starts and attempts to execute an association while Systems - // Manager is executing MaxConcurrency associations, the association is allowed + // If a new instance starts and attempts to run an association while Systems + // Manager is running MaxConcurrency associations, the association is allowed // to run. During the next association interval, the new instance will process // its association within the limit specified for MaxConcurrency. MaxConcurrency *string `min:"1" type:"string"` @@ -32676,7 +33207,7 @@ type UpdateAssociationInput struct { MaxErrors *string `min:"1" type:"string"` // The name of the SSM document that contains the configuration information - // for the instance. You can specify Command, Policy, or Automation documents. + // for the instance. You can specify Command or Automation documents. // // You can specify AWS-predefined documents, documents you created, or a document // that is shared with you from another account. @@ -34430,6 +34961,80 @@ func (s *UpdatePatchBaselineOutput) SetSources(v []*PatchSource) *UpdatePatchBas return s } +// The request body of the UpdateServiceSetting API action. +type UpdateServiceSettingInput struct { + _ struct{} `type:"structure"` + + // The ID of the service setting to update. + // + // SettingId is a required field + SettingId *string `min:"1" type:"string" required:"true"` + + // The new value to specify for the service setting. + // + // SettingValue is a required field + SettingValue *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateServiceSettingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateServiceSettingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateServiceSettingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateServiceSettingInput"} + if s.SettingId == nil { + invalidParams.Add(request.NewErrParamRequired("SettingId")) + } + if s.SettingId != nil && len(*s.SettingId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SettingId", 1)) + } + if s.SettingValue == nil { + invalidParams.Add(request.NewErrParamRequired("SettingValue")) + } + if s.SettingValue != nil && len(*s.SettingValue) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SettingValue", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSettingId sets the SettingId field's value. +func (s *UpdateServiceSettingInput) SetSettingId(v string) *UpdateServiceSettingInput { + s.SettingId = &v + return s +} + +// SetSettingValue sets the SettingValue field's value. +func (s *UpdateServiceSettingInput) SetSettingValue(v string) *UpdateServiceSettingInput { + s.SettingValue = &v + return s +} + +// The result body of the UpdateServiceSetting API action. +type UpdateServiceSettingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateServiceSettingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateServiceSettingOutput) GoString() string { + return s.String() +} + const ( // AssociationComplianceSeverityCritical is a AssociationComplianceSeverity enum value AssociationComplianceSeverityCritical = "CRITICAL" diff --git a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go index 44d3bac8..4a473c6f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go @@ -598,6 +598,13 @@ const ( // Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). ErrCodeResourceLimitExceededException = "ResourceLimitExceededException" + // ErrCodeServiceSettingNotFound for service response error code + // "ServiceSettingNotFound". + // + // The specified service setting was not found. Either the service name or the + // setting has not been provisioned by the AWS service team. + ErrCodeServiceSettingNotFound = "ServiceSettingNotFound" + // ErrCodeStatusUnchanged for service response error code // "StatusUnchanged". // diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go index ee908f91..81130896 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/api.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" ) @@ -243,6 +244,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re output = &AssumeRoleWithSAMLOutput{} req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials return } @@ -425,6 +427,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI output = &AssumeRoleWithWebIdentityOutput{} req = c.newRequest(op, input, output) + req.Config.Credentials = credentials.AnonymousCredentials return } diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go deleted file mode 100644 index 4010cc7f..00000000 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/customizations.go +++ /dev/null @@ -1,12 +0,0 @@ -package sts - -import "github.com/aws/aws-sdk-go/aws/request" - -func init() { - initRequest = func(r *request.Request) { - switch r.Operation.Name { - case opAssumeRoleWithSAML, opAssumeRoleWithWebIdentity: - r.Handlers.Sign.Clear() // these operations are unsigned - } - } -} diff --git a/vendor/github.com/fullsailor/pkcs7/ber.go b/vendor/github.com/fullsailor/pkcs7/ber.go index bf3e8042..89e96d30 100644 --- a/vendor/github.com/fullsailor/pkcs7/ber.go +++ b/vendor/github.com/fullsailor/pkcs7/ber.go @@ -5,7 +5,7 @@ import ( "errors" ) -var encodeIndent = 0 +// var encodeIndent = 0 type asn1Object interface { EncodeTo(writer *bytes.Buffer) error @@ -18,7 +18,7 @@ type asn1Structured struct { func (s asn1Structured) EncodeTo(out *bytes.Buffer) error { //fmt.Printf("%s--> tag: % X\n", strings.Repeat("| ", encodeIndent), s.tagBytes) - encodeIndent++ + //encodeIndent++ inner := new(bytes.Buffer) for _, obj := range s.content { err := obj.EncodeTo(inner) @@ -26,7 +26,7 @@ func (s asn1Structured) EncodeTo(out *bytes.Buffer) error { return err } } - encodeIndent-- + //encodeIndent-- out.Write(s.tagBytes) encodeLength(out, inner.Len()) out.Write(inner.Bytes()) diff --git a/vendor/github.com/hashicorp/consul/api/agent.go b/vendor/github.com/hashicorp/consul/api/agent.go index 6a3fb27e..6acf8ad9 100644 --- a/vendor/github.com/hashicorp/consul/api/agent.go +++ b/vendor/github.com/hashicorp/consul/api/agent.go @@ -926,41 +926,86 @@ func (a *Agent) Monitor(loglevel string, stopCh <-chan struct{}, q *QueryOptions // UpdateACLToken updates the agent's "acl_token". See updateToken for more // details. +// +// DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateDefaultACLToken for v1.4.3 and above func (a *Agent) UpdateACLToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_token", token, q) } // UpdateACLAgentToken updates the agent's "acl_agent_token". See updateToken // for more details. +// +// DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateAgentACLToken for v1.4.3 and above func (a *Agent) UpdateACLAgentToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_agent_token", token, q) } // UpdateACLAgentMasterToken updates the agent's "acl_agent_master_token". See // updateToken for more details. +// +// DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateAgentMasterACLToken for v1.4.3 and above func (a *Agent) UpdateACLAgentMasterToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_agent_master_token", token, q) } // UpdateACLReplicationToken updates the agent's "acl_replication_token". See // updateToken for more details. +// +// DEPRECATED (ACL-Legacy-Compat) - Prefer UpdateReplicationACLToken for v1.4.3 and above func (a *Agent) UpdateACLReplicationToken(token string, q *WriteOptions) (*WriteMeta, error) { return a.updateToken("acl_replication_token", token, q) } -// updateToken can be used to update an agent's ACL token after the agent has -// started. The tokens are not persisted, so will need to be updated again if -// the agent is restarted. +// UpdateDefaultACLToken updates the agent's "default" token. See updateToken +// for more details +func (a *Agent) UpdateDefaultACLToken(token string, q *WriteOptions) (*WriteMeta, error) { + return a.updateTokenFallback("default", "acl_token", token, q) +} + +// UpdateAgentACLToken updates the agent's "agent" token. See updateToken +// for more details +func (a *Agent) UpdateAgentACLToken(token string, q *WriteOptions) (*WriteMeta, error) { + return a.updateTokenFallback("agent", "acl_agent_token", token, q) +} + +// UpdateAgentMasterACLToken updates the agent's "agent_master" token. See updateToken +// for more details +func (a *Agent) UpdateAgentMasterACLToken(token string, q *WriteOptions) (*WriteMeta, error) { + return a.updateTokenFallback("agent_master", "acl_agent_master_token", token, q) +} + +// UpdateReplicationACLToken updates the agent's "replication" token. See updateToken +// for more details +func (a *Agent) UpdateReplicationACLToken(token string, q *WriteOptions) (*WriteMeta, error) { + return a.updateTokenFallback("replication", "acl_replication_token", token, q) +} + +// updateToken can be used to update one of an agent's ACL tokens after the agent has +// started. The tokens are may not be persisted, so will need to be updated again if +// the agent is restarted unless the agent is configured to persist them. func (a *Agent) updateToken(target, token string, q *WriteOptions) (*WriteMeta, error) { + meta, _, err := a.updateTokenOnce(target, token, q) + return meta, err +} + +func (a *Agent) updateTokenFallback(target, fallback, token string, q *WriteOptions) (*WriteMeta, error) { + meta, status, err := a.updateTokenOnce(target, token, q) + if err != nil && status == 404 { + meta, _, err = a.updateTokenOnce(fallback, token, q) + } + return meta, err +} + +func (a *Agent) updateTokenOnce(target, token string, q *WriteOptions) (*WriteMeta, int, error) { r := a.c.newRequest("PUT", fmt.Sprintf("/v1/agent/token/%s", target)) r.setWriteOptions(q) r.obj = &AgentToken{Token: token} rtt, resp, err := requireOK(a.c.doRequest(r)) if err != nil { - return nil, err + return nil, resp.StatusCode, err } resp.Body.Close() wm := &WriteMeta{RequestTime: rtt} - return wm, nil + return wm, resp.StatusCode, nil } diff --git a/vendor/github.com/hashicorp/consul/api/api.go b/vendor/github.com/hashicorp/consul/api/api.go index b913fa36..39a0ad3e 100644 --- a/vendor/github.com/hashicorp/consul/api/api.go +++ b/vendor/github.com/hashicorp/consul/api/api.go @@ -93,7 +93,7 @@ type QueryOptions struct { // If there is a cached response that is older than the MaxAge, it is treated // as a cache miss and a new fetch invoked. If the fetch fails, the error is // returned. Clients that wish to allow for stale results on error can set - // StaleIfError to a longer duration to change this behaviour. It is ignored + // StaleIfError to a longer duration to change this behavior. It is ignored // if the endpoint supports background refresh caching. See // https://www.consul.io/api/index.html#agent-caching for more details. MaxAge time.Duration diff --git a/vendor/github.com/hashicorp/consul/api/prepared_query.go b/vendor/github.com/hashicorp/consul/api/prepared_query.go index 8bb1004e..02045811 100644 --- a/vendor/github.com/hashicorp/consul/api/prepared_query.go +++ b/vendor/github.com/hashicorp/consul/api/prepared_query.go @@ -55,6 +55,11 @@ type ServiceQuery struct { // service entry to be returned. NodeMeta map[string]string + // ServiceMeta is a map of required service metadata fields. If a key/value + // pair is in this map it must be present on the node in order for the + // service entry to be returned. + ServiceMeta map[string]string + // Connect if true will filter the prepared query results to only // include Connect-capable services. These include both native services // and proxies for matching services. Note that if a proxy matches, diff --git a/vendor/github.com/hashicorp/consul/ui-v2/lib/block-slots/LICENSE.md b/vendor/github.com/hashicorp/consul/ui-v2/lib/block-slots/LICENSE.md new file mode 100644 index 00000000..c75ad2a1 --- /dev/null +++ b/vendor/github.com/hashicorp/consul/ui-v2/lib/block-slots/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Ciena Corporation. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/hashicorp/go-cleanhttp/handlers.go b/vendor/github.com/hashicorp/go-cleanhttp/handlers.go index 7eda3777..3c845dc0 100644 --- a/vendor/github.com/hashicorp/go-cleanhttp/handlers.go +++ b/vendor/github.com/hashicorp/go-cleanhttp/handlers.go @@ -27,17 +27,22 @@ func PrintablePathCheckHandler(next http.Handler, input *HandlerInput) http.Hand } return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - // Check URL path for non-printable characters - idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { - return !unicode.IsPrint(c) - }) - - if idx != -1 { - w.WriteHeader(input.ErrStatus) - return + if r != nil { + // Check URL path for non-printable characters + idx := strings.IndexFunc(r.URL.Path, func(c rune) bool { + return !unicode.IsPrint(c) + }) + + if idx != -1 { + w.WriteHeader(input.ErrStatus) + return + } + + if next != nil { + next.ServeHTTP(w, r) + } } - next.ServeHTTP(w, r) return }) } diff --git a/vendor/github.com/hashicorp/go-retryablehttp/client.go b/vendor/github.com/hashicorp/go-retryablehttp/client.go index 15f1e885..a4e5927c 100644 --- a/vendor/github.com/hashicorp/go-retryablehttp/client.go +++ b/vendor/github.com/hashicorp/go-retryablehttp/client.go @@ -385,9 +385,9 @@ func (c *Client) Do(req *Request) (*http.Response, error) { return resp, err } if c, ok := body.(io.ReadCloser); ok { - req.Request.Body = c + req.Body = c } else { - req.Request.Body = ioutil.NopCloser(body) + req.Body = ioutil.NopCloser(body) } } @@ -402,7 +402,7 @@ func (c *Client) Do(req *Request) (*http.Response, error) { } // Check if we should continue with retries. - checkOK, checkErr := c.CheckRetry(req.Request.Context(), resp, err) + checkOK, checkErr := c.CheckRetry(req.Context(), resp, err) if err != nil { if c.Logger != nil { @@ -445,7 +445,11 @@ func (c *Client) Do(req *Request) (*http.Response, error) { if c.Logger != nil { c.Logger.Printf("[DEBUG] %s: retrying in %s (%d left)", desc, wait, remain) } - time.Sleep(wait) + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case <-time.After(wait): + } } if c.ErrorHandler != nil { diff --git a/vendor/github.com/hashicorp/vault/api/client.go b/vendor/github.com/hashicorp/vault/api/client.go index 80ccd7d5..543ef047 100644 --- a/vendor/github.com/hashicorp/vault/api/client.go +++ b/vendor/github.com/hashicorp/vault/api/client.go @@ -26,12 +26,14 @@ import ( ) const EnvVaultAddress = "VAULT_ADDR" +const EnvVaultAgentAddr = "VAULT_AGENT_ADDR" const EnvVaultCACert = "VAULT_CACERT" const EnvVaultCAPath = "VAULT_CAPATH" const EnvVaultClientCert = "VAULT_CLIENT_CERT" const EnvVaultClientKey = "VAULT_CLIENT_KEY" const EnvVaultClientTimeout = "VAULT_CLIENT_TIMEOUT" -const EnvVaultInsecure = "VAULT_SKIP_VERIFY" +const EnvVaultSkipVerify = "VAULT_SKIP_VERIFY" +const EnvVaultNamespace = "VAULT_NAMESPACE" const EnvVaultTLSServerName = "VAULT_TLS_SERVER_NAME" const EnvVaultWrapTTL = "VAULT_WRAP_TTL" const EnvVaultMaxRetries = "VAULT_MAX_RETRIES" @@ -56,6 +58,10 @@ type Config struct { // HttpClient. Address string + // AgentAddress is the address of the local Vault agent. This should be a + // complete URL such as "http://vault.example.com". + AgentAddress string + // HttpClient is the HTTP client to use. Vault sets sane defaults for the // http.Client and its associated http.Transport created in DefaultConfig. // If you must modify Vault's defaults, it is suggested that you start with @@ -223,6 +229,7 @@ func (c *Config) ConfigureTLS(t *TLSConfig) error { // there is an error, no configuration value is updated. func (c *Config) ReadEnvironment() error { var envAddress string + var envAgentAddress string var envCACert string var envCAPath string var envClientCert string @@ -237,6 +244,9 @@ func (c *Config) ReadEnvironment() error { if v := os.Getenv(EnvVaultAddress); v != "" { envAddress = v } + if v := os.Getenv(EnvVaultAgentAddr); v != "" { + envAgentAddress = v + } if v := os.Getenv(EnvVaultMaxRetries); v != "" { maxRetries, err := strconv.ParseUint(v, 10, 32) if err != nil { @@ -270,7 +280,7 @@ func (c *Config) ReadEnvironment() error { } envClientTimeout = clientTimeout } - if v := os.Getenv(EnvVaultInsecure); v != "" { + if v := os.Getenv(EnvVaultSkipVerify); v != "" { var err error envInsecure, err = strconv.ParseBool(v) if err != nil { @@ -304,6 +314,10 @@ func (c *Config) ReadEnvironment() error { c.Address = envAddress } + if envAgentAddress != "" { + c.AgentAddress = envAgentAddress + } + if envMaxRetries != nil { c.MaxRetries = int(*envMaxRetries) } @@ -366,11 +380,6 @@ func NewClient(c *Config) (*Client, error) { c.modifyLock.Lock() defer c.modifyLock.Unlock() - u, err := url.Parse(c.Address) - if err != nil { - return nil, err - } - if c.HttpClient == nil { c.HttpClient = def.HttpClient } @@ -378,6 +387,32 @@ func NewClient(c *Config) (*Client, error) { c.HttpClient.Transport = def.HttpClient.Transport } + address := c.Address + if c.AgentAddress != "" { + address = c.AgentAddress + } + + u, err := url.Parse(address) + if err != nil { + return nil, err + } + + if strings.HasPrefix(address, "unix://") { + socket := strings.TrimPrefix(address, "unix://") + transport := c.HttpClient.Transport.(*http.Transport) + transport.DialContext = func(context.Context, string, string) (net.Conn, error) { + return net.Dial("unix", socket) + } + + // Since the address points to a unix domain socket, the scheme in the + // *URL would be set to `unix`. The *URL in the client is expected to + // be pointing to the protocol used in the application layer and not to + // the transport layer. Hence, setting the fields accordingly. + u.Scheme = "http" + u.Host = socket + u.Path = "" + } + client := &Client{ addr: u, config: c, diff --git a/vendor/github.com/hashicorp/vault/api/output_string.go b/vendor/github.com/hashicorp/vault/api/output_string.go index ebfdad6c..b836b77a 100644 --- a/vendor/github.com/hashicorp/vault/api/output_string.go +++ b/vendor/github.com/hashicorp/vault/api/output_string.go @@ -41,7 +41,9 @@ func (d *OutputStringError) parseRequest() { // Build cURL string d.parsedCurlString = "curl " - d.parsedCurlString = fmt.Sprintf("%s-X %s ", d.parsedCurlString, d.Request.Method) + if d.Request.Method != "GET" { + d.parsedCurlString = fmt.Sprintf("%s-X %s ", d.parsedCurlString, d.Request.Method) + } for k, v := range d.Request.Header { for _, h := range v { if strings.ToLower(k) == "x-vault-token" { diff --git a/vendor/github.com/hashicorp/vault/api/secret.go b/vendor/github.com/hashicorp/vault/api/secret.go index e2596260..c8a0ba3d 100644 --- a/vendor/github.com/hashicorp/vault/api/secret.go +++ b/vendor/github.com/hashicorp/vault/api/secret.go @@ -292,6 +292,7 @@ type SecretAuth struct { TokenPolicies []string `json:"token_policies"` IdentityPolicies []string `json:"identity_policies"` Metadata map[string]string `json:"metadata"` + Orphan bool `json:"orphan"` LeaseDuration int `json:"lease_duration"` Renewable bool `json:"renewable"` diff --git a/vendor/github.com/hashicorp/vault/helper/consts/agent.go b/vendor/github.com/hashicorp/vault/helper/consts/agent.go new file mode 100644 index 00000000..b62962e3 --- /dev/null +++ b/vendor/github.com/hashicorp/vault/helper/consts/agent.go @@ -0,0 +1,5 @@ +package consts + +// AgentPathCacheClear is the path that the agent will use as its cache-clear +// endpoint. +const AgentPathCacheClear = "/agent/v1/cache-clear" diff --git a/vendor/github.com/hashicorp/vault/helper/consts/replication.go b/vendor/github.com/hashicorp/vault/helper/consts/replication.go index a7e0edea..f3cafe75 100644 --- a/vendor/github.com/hashicorp/vault/helper/consts/replication.go +++ b/vendor/github.com/hashicorp/vault/helper/consts/replication.go @@ -2,6 +2,24 @@ package consts import "time" +const ( + //N.B. This needs to be excluded from replication despite the name; it's + //merely saying that this is cluster information for the replicated + //cluster. + CoreReplicatedClusterPrefix = "core/cluster/replicated/" + CoreReplicatedClusterPrefixDR = "core/cluster/replicated-dr/" + + CoreReplicatedClusterInfoPath = CoreReplicatedClusterPrefix + "info" + CoreReplicatedClusterSecondariesPrefix = CoreReplicatedClusterPrefix + "secondaries/" + CoreReplicatedClusterInfoPathDR = CoreReplicatedClusterPrefixDR + "info" + CoreReplicatedClusterSecondariesPrefixDR = CoreReplicatedClusterPrefixDR + "secondaries/" + + // This is an identifier for the current secondary in the replicated paths + // manager. It should contain a character that is not allowed in secondary + // ids to ensure it doesn't collide. + CurrentReplicatedSecondaryIdentifier = ".current" +) + type ReplicationState uint32 var ReplicationStaleReadTimeout = 2 * time.Second @@ -28,6 +46,18 @@ const ( ReplicationPerformanceStandby ) +// We verify no change to the above values are made +func init() { + + if OldReplicationBootstrapping != 3 { + panic("Replication Constants have changed") + } + + if ReplicationPerformancePrimary != 1<<5 { + panic("Replication Constants have changed") + } +} + func (r ReplicationState) string() string { switch r { case ReplicationPerformanceSecondary: diff --git a/vendor/github.com/pierrec/lz4/reader.go b/vendor/github.com/pierrec/lz4/reader.go index f08db47d..81efdbf8 100644 --- a/vendor/github.com/pierrec/lz4/reader.go +++ b/vendor/github.com/pierrec/lz4/reader.go @@ -158,6 +158,9 @@ func (z *Reader) Read(buf []byte) (int, error) { if debugFlag { debug("reading block from writer") } + // Reset uncompressed buffer + z.data = z.zdata[:cap(z.zdata)][len(z.zdata):] + // Block length: 0 = end of frame, highest bit set: uncompressed. bLen, err := z.readUint32() if err != nil { diff --git a/vendor/github.com/spf13/afero/unionFile.go b/vendor/github.com/spf13/afero/unionFile.go index abcf12d3..eda96312 100644 --- a/vendor/github.com/spf13/afero/unionFile.go +++ b/vendor/github.com/spf13/afero/unionFile.go @@ -155,8 +155,8 @@ var defaultUnionMergeDirsFn = func(lofi, bofi []os.FileInfo) ([]os.FileInfo, err } // Readdir will weave the two directories together and -// return a single view of the overlayed directories -// At the end of the directory view, the error is io.EOF. +// return a single view of the overlayed directories. +// At the end of the directory view, the error is io.EOF if c > 0. func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) { var merge DirsMerger = f.Merger if merge == nil { @@ -187,11 +187,15 @@ func (f *UnionFile) Readdir(c int) (ofi []os.FileInfo, err error) { f.files = append(f.files, merged...) } + if c <= 0 && len(f.files) == 0 { + return f.files, nil + } + if f.off >= len(f.files) { return nil, io.EOF } - if c == -1 { + if c <= 0 { return f.files[f.off:], nil } diff --git a/vendor/github.com/ugorji/go/codec/0_importpath.go b/vendor/github.com/ugorji/go/codec/0_importpath.go new file mode 100644 index 00000000..adbe862c --- /dev/null +++ b/vendor/github.com/ugorji/go/codec/0_importpath.go @@ -0,0 +1,7 @@ +// Copyright (c) 2012-2018 Ugorji Nwoke. All rights reserved. +// Use of this source code is governed by a MIT license found in the LICENSE file. + +package codec // import "github.com/ugorji/go/codec" + +// This establishes that this package must be imported as github.com/ugorji/go/codec. +// It makes forking easier, and plays well with pre-module releases of go. diff --git a/vendor/github.com/ugorji/go/codec/0doc.go b/vendor/github.com/ugorji/go/codec/0doc.go index 9c8ce86f..295ee346 100644 --- a/vendor/github.com/ugorji/go/codec/0doc.go +++ b/vendor/github.com/ugorji/go/codec/0doc.go @@ -109,7 +109,7 @@ We determine how to encode or decode by walking this decision tree - is there an extension registered for the type? - is format binary, and is type a encoding.BinaryMarshaler and BinaryUnmarshaler? - is format specifically json, and is type a encoding/json.Marshaler and Unmarshaler? - - is format text-based, and type an encoding.TextMarshaler? + - is format text-based, and type an encoding.TextMarshaler and TextUnmarshaler? - else we use a pair of functions based on the "kind" of the type e.g. map, slice, int64, etc This symmetry is important to reduce chances of issues happening because the diff --git a/vendor/github.com/ugorji/go/codec/binc.go b/vendor/github.com/ugorji/go/codec/binc.go index e6f3f49b..c9877ac7 100644 --- a/vendor/github.com/ugorji/go/codec/binc.go +++ b/vendor/github.com/ugorji/go/codec/binc.go @@ -932,8 +932,7 @@ func (d *bincDecDriver) DecodeNaked() { n.v = valueTypeString n.s = d.DecodeString() case bincVdByteArray: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case bincVdTimestamp: n.v = valueTypeTime tt, err := bincDecodeTime(d.r.readx(uint(d.vs))) diff --git a/vendor/github.com/ugorji/go/codec/cbor.go b/vendor/github.com/ugorji/go/codec/cbor.go index 2a0d714c..7833f9d6 100644 --- a/vendor/github.com/ugorji/go/codec/cbor.go +++ b/vendor/github.com/ugorji/go/codec/cbor.go @@ -649,8 +649,7 @@ func (d *cborDecDriver) DecodeNaked() { n.v = valueTypeFloat n.f = d.DecodeFloat64() case cborBdIndefiniteBytes: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case cborBdIndefiniteString: n.v = valueTypeString n.s = d.DecodeString() @@ -674,8 +673,7 @@ func (d *cborDecDriver) DecodeNaked() { n.v = valueTypeInt n.i = d.DecodeInt64() case d.bd >= cborBaseBytes && d.bd < cborBaseString: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case d.bd >= cborBaseString && d.bd < cborBaseArray: n.v = valueTypeString n.s = d.DecodeString() diff --git a/vendor/github.com/ugorji/go/codec/decode.go b/vendor/github.com/ugorji/go/codec/decode.go index 4caa2595..1f14e7a5 100644 --- a/vendor/github.com/ugorji/go/codec/decode.go +++ b/vendor/github.com/ugorji/go/codec/decode.go @@ -257,6 +257,10 @@ type DecodeOptions struct { // If true, we will delete the mapping of the key. // Else, just set the mapping to the zero value of the type. DeleteOnNilMapValue bool + + // RawToString controls how raw bytes in a stream are decoded into a nil interface{}. + // By default, they are decoded as []byte, but can be decoded as string (if configured). + RawToString bool } // ------------------------------------------------ @@ -553,21 +557,33 @@ type bufioDecReader struct { // err error - _ [2]uint64 // padding + // Extensions can call Decode() within a current Decode() call. + // We need to know when the top level Decode() call returns, + // so we can decide whether to Release() or not. + calls uint16 // what depth in mustDecode are we in now. + + _ [6]uint8 // padding + + _ [1]uint64 // padding } func (z *bufioDecReader) reset(r io.Reader, bufsize int) { z.ioDecReaderCommon.reset(r) z.c = 0 + z.calls = 0 if cap(z.buf) >= bufsize { z.buf = z.buf[:0] } else { - z.bytesBufPooler.end() // potentially return old one to pool z.buf = z.bytesBufPooler.get(bufsize)[:0] // z.buf = make([]byte, 0, bufsize) } } +func (z *bufioDecReader) release() { + z.buf = nil + z.bytesBufPooler.end() +} + func (z *bufioDecReader) readb(p []byte) { var n = uint(copy(p, z.buf[z.c:])) z.n += n @@ -2294,12 +2310,7 @@ type Decoder struct { depth int16 maxdepth int16 - // Extensions can call Decode() within a current Decode() call. - // We need to know when the top level Decode() call returns, - // so we can decide whether to Release() or not. - calls uint16 // what depth in mustDecode are we in now. - - _ [2]uint8 // padding + _ [4]uint8 // padding is map[string]string // used for interning strings @@ -2359,7 +2370,6 @@ func (d *Decoder) resetCommon() { // d.r = &d.decReaderSwitch d.d.reset() d.err = nil - d.calls = 0 d.depth = 0 d.maxdepth = d.h.MaxDepth if d.maxdepth <= 0 { @@ -2523,16 +2533,21 @@ func (d *Decoder) MustDecode(v interface{}) { // This provides insight to the code location that triggered the error. func (d *Decoder) mustDecode(v interface{}) { // TODO: Top-level: ensure that v is a pointer and not nil. - d.calls++ if d.d.TryDecodeAsNil() { setZero(v) - } else { + return + } + if d.bi == nil { d.decode(v) + return } + + d.bi.calls++ + d.decode(v) // xprintf(">>>>>>>> >>>>>>>> num decFns: %v\n", d.cf.sn) - d.calls-- - if !d.h.ExplicitRelease && d.calls == 0 { - d.Release() + d.bi.calls-- + if !d.h.ExplicitRelease && d.bi.calls == 0 { + d.bi.release() } } @@ -2558,12 +2573,8 @@ func (d *Decoder) finalize() { // // By default, Release() is automatically called unless the option ExplicitRelease is set. func (d *Decoder) Release() { - if useFinalizers && removeFinalizerOnRelease { - runtime.SetFinalizer(d, nil) - } - if d.bi != nil && d.bi.bytesBufPooler.pool != nil { - d.bi.buf = nil - d.bi.bytesBufPooler.end() + if d.bi != nil { + d.bi.release() } // d.decNakedPooler.end() } @@ -3086,3 +3097,13 @@ func decReadFull(r io.Reader, bs []byte) (n uint, err error) { // if n != len(bs) && err == io.EOF { err = io.ErrUnexpectedEOF } return } + +func decNakedReadRawBytes(dr decDriver, d *Decoder, n *decNaked, rawToString bool) { + if rawToString { + n.v = valueTypeString + n.s = string(dr.DecodeBytes(d.b[:], true)) + } else { + n.v = valueTypeBytes + n.l = dr.DecodeBytes(nil, false) + } +} diff --git a/vendor/github.com/ugorji/go/codec/encode.go b/vendor/github.com/ugorji/go/codec/encode.go index f3a7ced5..8462440c 100644 --- a/vendor/github.com/ugorji/go/codec/encode.go +++ b/vendor/github.com/ugorji/go/codec/encode.go @@ -48,13 +48,12 @@ type encDriver interface { // encodeExtPreamble(xtag byte, length int) EncodeRawExt(re *RawExt, e *Encoder) EncodeExt(v interface{}, xtag uint64, ext Ext, e *Encoder) - // Deprecated: try to use EncodeStringEnc instead + // Deprecated: use EncodeStringEnc instead EncodeString(c charEncoding, v string) - // c cannot be cRAW - EncodeStringEnc(c charEncoding, v string) - // EncodeSymbol(v string) - // Deprecated: try to use EncodeStringBytesRaw instead + // Deprecated: use EncodeStringBytesRaw instead EncodeStringBytes(c charEncoding, v []byte) + EncodeStringEnc(c charEncoding, v string) // c cannot be cRAW + // EncodeSymbol(v string) EncodeStringBytesRaw(v []byte) EncodeTime(time.Time) //encBignum(f *big.Int) @@ -169,6 +168,19 @@ type EncodeOptions struct { // If unset, we error out. Raw bool + // StringToRaw controls how strings are encoded. + // + // As a go string is just an (immutable) sequence of bytes, + // it can be encoded either as raw bytes or as a UTF string. + // + // By default, strings are encoded as UTF-8. + // but can be treated as []byte during an encode. + // + // Note that things which we know (by definition) to be UTF-8 + // are ALWAYS encoded as UTF-8 strings. + // These include encoding.TextMarshaler, time.Format calls, struct field names, etc. + StringToRaw bool + // // AsSymbols defines what should be encoded as symbols. // // // // Encoding as symbols can reduce the encoded size significantly. @@ -279,10 +291,18 @@ type bufioEncWriter struct { buf []byte w io.Writer n int + sz int // buf size + + // Extensions can call Encode() within a current Encode() call. + // We need to know when the top level Encode() call returns, + // so we can decide whether to Release() or not. + calls uint16 // what depth in mustDecode are we in now. + + _ [6]uint8 // padding bytesBufPooler - _ [3]uint64 // padding + _ [1]uint64 // padding // a int // b [4]byte // err @@ -291,31 +311,39 @@ type bufioEncWriter struct { func (z *bufioEncWriter) reset(w io.Writer, bufsize int) { z.w = w z.n = 0 + z.calls = 0 if bufsize <= 0 { bufsize = defEncByteBufSize } - if z.buf == nil { - z.buf = z.bytesBufPooler.get(bufsize) - } else if cap(z.buf) >= bufsize { + z.sz = bufsize + if cap(z.buf) >= bufsize { z.buf = z.buf[:cap(z.buf)] } else { - z.bytesBufPooler.end() // potentially return old one to pool z.buf = z.bytesBufPooler.get(bufsize) // z.buf = make([]byte, bufsize) } } +func (z *bufioEncWriter) release() { + z.buf = nil + z.bytesBufPooler.end() +} + //go:noinline - flush only called intermittently -func (z *bufioEncWriter) flush() { +func (z *bufioEncWriter) flushErr() (err error) { n, err := z.w.Write(z.buf[:z.n]) z.n -= n if z.n > 0 && err == nil { err = io.ErrShortWrite } - if err != nil { - if n > 0 && z.n > 0 { - copy(z.buf, z.buf[n:z.n+n]) - } + if n > 0 && z.n > 0 { + copy(z.buf, z.buf[n:z.n+n]) + } + return err +} + +func (z *bufioEncWriter) flush() { + if err := z.flushErr(); err != nil { panic(err) } } @@ -362,10 +390,11 @@ func (z *bufioEncWriter) writen2(b1, b2 byte) { z.n += 2 } -func (z *bufioEncWriter) end() { +func (z *bufioEncWriter) endErr() (err error) { if z.n > 0 { - z.flush() + err = z.flushErr() } + return } // --------------------------------------------- @@ -388,8 +417,9 @@ func (z *bytesEncAppender) writen1(b1 byte) { func (z *bytesEncAppender) writen2(b1, b2 byte) { z.b = append(z.b, b1, b2) } -func (z *bytesEncAppender) end() { +func (z *bytesEncAppender) endErr() error { *(z.out) = z.b + return nil } func (z *bytesEncAppender) reset(in []byte, out *[]byte) { z.b = in[:0] @@ -625,15 +655,13 @@ func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) { if e.esep { for _, si := range tisfi { ee.WriteMapElemKey() - // ee.EncodeStringEnc(cUTF8, si.encName) - e.kStructFieldKey(fti.keyType, si) + e.kStructFieldKey(fti.keyType, si.encNameAsciiAlphaNum, si.encName) ee.WriteMapElemValue() e.encodeValue(sfn.field(si), nil, true) } } else { for _, si := range tisfi { - // ee.EncodeStringEnc(cUTF8, si.encName) - e.kStructFieldKey(fti.keyType, si) + e.kStructFieldKey(fti.keyType, si.encNameAsciiAlphaNum, si.encName) e.encodeValue(sfn.field(si), nil, true) } } @@ -654,40 +682,8 @@ func (e *Encoder) kStructNoOmitempty(f *codecFnInfo, rv reflect.Value) { } } -func (e *Encoder) kStructFieldKey(keyType valueType, s *structFieldInfo) { - var m must - // use if-else-if, not switch (which compiles to binary-search) - // since keyType is typically valueTypeString, branch prediction is pretty good. - if keyType == valueTypeString { - if e.js && s.encNameAsciiAlphaNum { // keyType == valueTypeString - e.w.writen1('"') - e.w.writestr(s.encName) - e.w.writen1('"') - } else { // keyType == valueTypeString - e.e.EncodeStringEnc(cUTF8, s.encName) - } - } else if keyType == valueTypeInt { - e.e.EncodeInt(m.Int(strconv.ParseInt(s.encName, 10, 64))) - } else if keyType == valueTypeUint { - e.e.EncodeUint(m.Uint(strconv.ParseUint(s.encName, 10, 64))) - } else if keyType == valueTypeFloat { - e.e.EncodeFloat64(m.Float(strconv.ParseFloat(s.encName, 64))) - } -} - -func (e *Encoder) kStructFieldKeyName(keyType valueType, encName string) { - var m must - // use if-else-if, not switch (which compiles to binary-search) - // since keyType is typically valueTypeString, branch prediction is pretty good. - if keyType == valueTypeString { - e.e.EncodeStringEnc(cUTF8, encName) - } else if keyType == valueTypeInt { - e.e.EncodeInt(m.Int(strconv.ParseInt(encName, 10, 64))) - } else if keyType == valueTypeUint { - e.e.EncodeUint(m.Uint(strconv.ParseUint(encName, 10, 64))) - } else if keyType == valueTypeFloat { - e.e.EncodeFloat64(m.Float(strconv.ParseFloat(encName, 64))) - } +func (e *Encoder) kStructFieldKey(keyType valueType, encNameAsciiAlphaNum bool, encName string) { + encStructFieldKey(encName, e.e, e.w, keyType, encNameAsciiAlphaNum, e.js) } func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { @@ -784,23 +780,21 @@ func (e *Encoder) kStruct(f *codecFnInfo, rv reflect.Value) { for j = 0; j < len(fkvs); j++ { kv = fkvs[j] ee.WriteMapElemKey() - // ee.EncodeStringEnc(cUTF8, kv.v) - e.kStructFieldKey(fti.keyType, kv.v) + e.kStructFieldKey(fti.keyType, kv.v.encNameAsciiAlphaNum, kv.v.encName) ee.WriteMapElemValue() e.encodeValue(kv.r, nil, true) } } else { for j = 0; j < len(fkvs); j++ { kv = fkvs[j] - // ee.EncodeStringEnc(cUTF8, kv.v) - e.kStructFieldKey(fti.keyType, kv.v) + e.kStructFieldKey(fti.keyType, kv.v.encNameAsciiAlphaNum, kv.v.encName) e.encodeValue(kv.r, nil, true) } } // now, add the others for k, v := range mf { ee.WriteMapElemKey() - e.kStructFieldKeyName(fti.keyType, k) + e.kStructFieldKey(fti.keyType, false, k) ee.WriteMapElemValue() e.encode(v) } @@ -885,7 +879,11 @@ func (e *Encoder) kMap(f *codecFnInfo, rv reflect.Value) { ee.WriteMapElemKey() } if keyTypeIsString { - ee.EncodeStringEnc(cUTF8, mks[j].String()) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(mks[j].String())) + } else { + ee.EncodeStringEnc(cUTF8, mks[j].String()) + } } else { e.encodeValue(mks[j], keyFn, true) } @@ -935,7 +933,11 @@ func (e *Encoder) kMapCanonical(rtkey reflect.Type, rv reflect.Value, mks []refl if elemsep { ee.WriteMapElemKey() } - ee.EncodeStringEnc(cUTF8, mksv[i].v) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(mksv[i].v)) + } else { + ee.EncodeStringEnc(cUTF8, mksv[i].v) + } if elemsep { ee.WriteMapElemValue() } @@ -1107,11 +1109,16 @@ func (z *encWriterSwitch) writen2(b1, b2 byte) { z.wf.writen2(b1, b2) } } -func (z *encWriterSwitch) end() { +func (z *encWriterSwitch) endErr() error { if z.bytes { - z.wb.end() - } else { - z.wf.end() + return z.wb.endErr() + } + return z.wf.endErr() +} + +func (z *encWriterSwitch) end() { + if err := z.endErr(); err != nil { + panic(err) } } @@ -1237,12 +1244,7 @@ type Encoder struct { ci set - // Extensions can call Encode() within a current Encode() call. - // We need to know when the top level Encode() call returns, - // so we can decide whether to Release() or not. - calls uint16 // what depth in mustEncode are we in now. - - b [(5 * 8) - 2]byte // for encoding chan or (non-addressable) [N]byte + b [(5 * 8)]byte // for encoding chan or (non-addressable) [N]byte // ---- writable fields during execution --- *try* to keep in sep cache line @@ -1298,7 +1300,6 @@ func (e *Encoder) resetCommon() { _, e.js = e.hh.(*JsonHandle) e.e.reset() e.err = nil - e.calls = 0 } // Reset resets the Encoder with a new output stream. @@ -1450,8 +1451,13 @@ func (e *Encoder) Encode(v interface{}) (err error) { } if recoverPanicToErr { defer func() { - e.w.end() - if x := recover(); x != nil { + // if error occurred during encoding, return that error; + // else if error occurred on end'ing (i.e. during flush), return that error. + err = e.w.endErr() + x := recover() + if x == nil { + e.err = err + } else { panicValToErr(e, x, &e.err) err = e.err } @@ -1473,23 +1479,26 @@ func (e *Encoder) MustEncode(v interface{}) { } func (e *Encoder) mustEncode(v interface{}) { - // ensure the bufioEncWriter buffer is not nil (e.g. if Release() was called) - if e.wf != nil && e.wf.buf == nil { - if e.h.WriterBufferSize > 0 { - e.wf.buf = e.wf.bytesBufPooler.get(e.h.WriterBufferSize) - } else { - e.wf.buf = e.wf.bytesBufPooler.get(defEncByteBufSize) - } + if e.wf == nil { + e.encode(v) + e.e.atEndOfEncode() + e.w.end() + return + } + + if e.wf.buf == nil { + e.wf.buf = e.wf.bytesBufPooler.get(e.wf.sz) } + e.wf.calls++ - e.calls++ e.encode(v) e.e.atEndOfEncode() e.w.end() - e.calls-- - if !e.h.ExplicitRelease && e.calls == 0 { - e.Release() + e.wf.calls-- + + if !e.h.ExplicitRelease && e.wf.calls == 0 { + e.wf.release() } } @@ -1514,12 +1523,8 @@ func (e *Encoder) finalize() { // It is important to call Release() when done with an Encoder, so those resources // are released instantly for use by subsequently created Encoders. func (e *Encoder) Release() { - if useFinalizers && removeFinalizerOnRelease { - runtime.SetFinalizer(e, nil) - } if e.wf != nil { - e.wf.buf = nil - e.wf.bytesBufPooler.end() + e.wf.release() } } @@ -1541,7 +1546,11 @@ func (e *Encoder) encode(iv interface{}) { e.encodeValue(v, nil, true) case string: - e.e.EncodeStringEnc(cUTF8, v) + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(v)) + } else { + e.e.EncodeStringEnc(cUTF8, v) + } case bool: e.e.EncodeBool(v) case int: @@ -1579,7 +1588,11 @@ func (e *Encoder) encode(iv interface{}) { e.rawBytes(*v) case *string: - e.e.EncodeStringEnc(cUTF8, *v) + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(*v)) + } else { + e.e.EncodeStringEnc(cUTF8, *v) + } case *bool: e.e.EncodeBool(*v) case *int: @@ -1698,7 +1711,7 @@ TOP: // } else if asis { // e.asis(bs) // } else { -// e.e.EncodeStringBytes(c, bs) +// e.e.EncodeStringBytesRaw(bs) // } // } @@ -1754,3 +1767,42 @@ func (e *Encoder) rawBytes(vv Raw) { func (e *Encoder) wrapErr(v interface{}, err *error) { *err = encodeError{codecError{name: e.hh.Name(), err: v}} } + +func encStructFieldKey(encName string, ee encDriver, w *encWriterSwitch, + keyType valueType, encNameAsciiAlphaNum bool, js bool) { + var m must + // use if-else-if, not switch (which compiles to binary-search) + // since keyType is typically valueTypeString, branch prediction is pretty good. + if keyType == valueTypeString { + if js && encNameAsciiAlphaNum { // keyType == valueTypeString + // w.writen1('"') + // w.writestr(encName) + // w.writen1('"') + // ---- + // w.writestr(`"` + encName + `"`) + // ---- + // do concat myself, so it is faster than the generic string concat + b := make([]byte, len(encName)+2) + copy(b[1:], encName) + b[0] = '"' + b[len(b)-1] = '"' + w.writeb(b) + } else { // keyType == valueTypeString + ee.EncodeStringEnc(cUTF8, encName) + } + } else if keyType == valueTypeInt { + ee.EncodeInt(m.Int(strconv.ParseInt(encName, 10, 64))) + } else if keyType == valueTypeUint { + ee.EncodeUint(m.Uint(strconv.ParseUint(encName, 10, 64))) + } else if keyType == valueTypeFloat { + ee.EncodeFloat64(m.Float(strconv.ParseFloat(encName, 64))) + } +} + +// func encStringAsRawBytesMaybe(ee encDriver, s string, stringToRaw bool) { +// if stringToRaw { +// ee.EncodeStringBytesRaw(bytesView(s)) +// } else { +// ee.EncodeStringEnc(cUTF8, s) +// } +// } diff --git a/vendor/github.com/ugorji/go/codec/fast-path.generated.go b/vendor/github.com/ugorji/go/codec/fast-path.generated.go index 45137afa..9bc14bd6 100644 --- a/vendor/github.com/ugorji/go/codec/fast-path.generated.go +++ b/vendor/github.com/ugorji/go/codec/fast-path.generated.go @@ -1485,15 +1485,11 @@ func (_ fastpathT) EncSliceIntfV(v []interface{}, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - e.encode(v2) - } - } else { - for _, v2 := range v { - e.encode(v2) } + e.encode(v2) } ee.WriteArrayEnd() } @@ -1504,19 +1500,15 @@ func (_ fastpathT) EncAsMapSliceIntfV(v []interface{}, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - e.encode(v2) - } - } else { - for _, v2 := range v { - e.encode(v2) } + e.encode(v2) } ee.WriteMapEnd() } @@ -1535,13 +1527,13 @@ func (_ fastpathT) EncSliceStringV(v []string, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for _, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -1554,17 +1546,17 @@ func (_ fastpathT) EncAsMapSliceStringV(v []string, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for _, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -1585,15 +1577,11 @@ func (_ fastpathT) EncSliceFloat32V(v []float32, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeFloat32(v2) - } - } else { - for _, v2 := range v { - ee.EncodeFloat32(v2) } + ee.EncodeFloat32(v2) } ee.WriteArrayEnd() } @@ -1604,19 +1592,15 @@ func (_ fastpathT) EncAsMapSliceFloat32V(v []float32, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeFloat32(v2) - } - } else { - for _, v2 := range v { - ee.EncodeFloat32(v2) } + ee.EncodeFloat32(v2) } ee.WriteMapEnd() } @@ -1635,15 +1619,11 @@ func (_ fastpathT) EncSliceFloat64V(v []float64, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeFloat64(v2) - } - } else { - for _, v2 := range v { - ee.EncodeFloat64(v2) } + ee.EncodeFloat64(v2) } ee.WriteArrayEnd() } @@ -1654,19 +1634,15 @@ func (_ fastpathT) EncAsMapSliceFloat64V(v []float64, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeFloat64(v2) - } - } else { - for _, v2 := range v { - ee.EncodeFloat64(v2) } + ee.EncodeFloat64(v2) } ee.WriteMapEnd() } @@ -1685,15 +1661,11 @@ func (_ fastpathT) EncSliceUintV(v []uint, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteArrayEnd() } @@ -1704,19 +1676,15 @@ func (_ fastpathT) EncAsMapSliceUintV(v []uint, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteMapEnd() } @@ -1735,15 +1703,11 @@ func (_ fastpathT) EncSliceUint8V(v []uint8, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteArrayEnd() } @@ -1754,19 +1718,15 @@ func (_ fastpathT) EncAsMapSliceUint8V(v []uint8, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteMapEnd() } @@ -1785,15 +1745,11 @@ func (_ fastpathT) EncSliceUint16V(v []uint16, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteArrayEnd() } @@ -1804,19 +1760,15 @@ func (_ fastpathT) EncAsMapSliceUint16V(v []uint16, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteMapEnd() } @@ -1835,15 +1787,11 @@ func (_ fastpathT) EncSliceUint32V(v []uint32, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteArrayEnd() } @@ -1854,19 +1802,15 @@ func (_ fastpathT) EncAsMapSliceUint32V(v []uint32, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteMapEnd() } @@ -1885,15 +1829,11 @@ func (_ fastpathT) EncSliceUint64V(v []uint64, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteArrayEnd() } @@ -1904,19 +1844,15 @@ func (_ fastpathT) EncAsMapSliceUint64V(v []uint64, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeUint(uint64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeUint(uint64(v2)) } + ee.EncodeUint(uint64(v2)) } ee.WriteMapEnd() } @@ -1935,15 +1871,11 @@ func (_ fastpathT) EncSliceUintptrV(v []uintptr, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - e.encode(v2) - } - } else { - for _, v2 := range v { - e.encode(v2) } + e.encode(v2) } ee.WriteArrayEnd() } @@ -1954,19 +1886,15 @@ func (_ fastpathT) EncAsMapSliceUintptrV(v []uintptr, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - e.encode(v2) - } - } else { - for _, v2 := range v { - e.encode(v2) } + e.encode(v2) } ee.WriteMapEnd() } @@ -1985,15 +1913,11 @@ func (_ fastpathT) EncSliceIntV(v []int, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteArrayEnd() } @@ -2004,19 +1928,15 @@ func (_ fastpathT) EncAsMapSliceIntV(v []int, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteMapEnd() } @@ -2035,15 +1955,11 @@ func (_ fastpathT) EncSliceInt8V(v []int8, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteArrayEnd() } @@ -2054,19 +1970,15 @@ func (_ fastpathT) EncAsMapSliceInt8V(v []int8, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteMapEnd() } @@ -2085,15 +1997,11 @@ func (_ fastpathT) EncSliceInt16V(v []int16, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteArrayEnd() } @@ -2104,19 +2012,15 @@ func (_ fastpathT) EncAsMapSliceInt16V(v []int16, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteMapEnd() } @@ -2135,15 +2039,11 @@ func (_ fastpathT) EncSliceInt32V(v []int32, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteArrayEnd() } @@ -2154,19 +2054,15 @@ func (_ fastpathT) EncAsMapSliceInt32V(v []int32, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteMapEnd() } @@ -2185,15 +2081,11 @@ func (_ fastpathT) EncSliceInt64V(v []int64, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteArrayEnd() } @@ -2204,19 +2096,15 @@ func (_ fastpathT) EncAsMapSliceInt64V(v []int64, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeInt(int64(v2)) - } - } else { - for _, v2 := range v { - ee.EncodeInt(int64(v2)) } + ee.EncodeInt(int64(v2)) } ee.WriteMapEnd() } @@ -2235,15 +2123,11 @@ func (_ fastpathT) EncSliceBoolV(v []bool, e *Encoder) { } ee, esep := e.e, e.hh.hasElemSeparators() ee.WriteArrayStart(len(v)) - if esep { - for _, v2 := range v { + for _, v2 := range v { + if esep { ee.WriteArrayElem() - ee.EncodeBool(v2) - } - } else { - for _, v2 := range v { - ee.EncodeBool(v2) } + ee.EncodeBool(v2) } ee.WriteArrayEnd() } @@ -2254,19 +2138,15 @@ func (_ fastpathT) EncAsMapSliceBoolV(v []bool, e *Encoder) { return } ee.WriteMapStart(len(v) / 2) - if esep { - for j, v2 := range v { + for j, v2 := range v { + if esep { if j%2 == 0 { ee.WriteMapElemKey() } else { ee.WriteMapElemValue() } - ee.EncodeBool(v2) - } - } else { - for _, v2 := range v { - ee.EncodeBool(v2) } + ee.EncodeBool(v2) } ee.WriteMapEnd() } @@ -2296,32 +2176,26 @@ func (_ fastpathT) EncMapIntfIntfV(v map[interface{}]interface{}, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -2352,30 +2226,28 @@ func (_ fastpathT) EncMapIntfStringV(v map[interface{}]string, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) + } + e.encode(k2) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - e.encode(k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -2408,32 +2280,26 @@ func (_ fastpathT) EncMapIntfUintV(v map[interface{}]uint, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -2464,32 +2330,26 @@ func (_ fastpathT) EncMapIntfUint8V(v map[interface{}]uint8, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -2520,32 +2380,26 @@ func (_ fastpathT) EncMapIntfUint16V(v map[interface{}]uint16, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -2576,32 +2430,26 @@ func (_ fastpathT) EncMapIntfUint32V(v map[interface{}]uint32, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -2632,32 +2480,26 @@ func (_ fastpathT) EncMapIntfUint64V(v map[interface{}]uint64, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -2688,32 +2530,26 @@ func (_ fastpathT) EncMapIntfUintptrV(v map[interface{}]uintptr, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -2744,32 +2580,26 @@ func (_ fastpathT) EncMapIntfIntV(v map[interface{}]int, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -2800,32 +2630,26 @@ func (_ fastpathT) EncMapIntfInt8V(v map[interface{}]int8, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -2856,32 +2680,26 @@ func (_ fastpathT) EncMapIntfInt16V(v map[interface{}]int16, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -2912,32 +2730,26 @@ func (_ fastpathT) EncMapIntfInt32V(v map[interface{}]int32, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -2968,32 +2780,26 @@ func (_ fastpathT) EncMapIntfInt64V(v map[interface{}]int64, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -3024,32 +2830,26 @@ func (_ fastpathT) EncMapIntfFloat32V(v map[interface{}]float32, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat32(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -3080,32 +2880,26 @@ func (_ fastpathT) EncMapIntfFloat64V(v map[interface{}]float64, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat64(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -3136,32 +2930,26 @@ func (_ fastpathT) EncMapIntfBoolV(v map[interface{}]bool, e *Encoder) { i++ } sort.Sort(bytesISlice(v2)) - if esep { - for j := range v2 { + for j := range v2 { + if esep { ee.WriteMapElemKey() - e.asis(v2[j].v) - ee.WriteMapElemValue() - e.encode(v[v2[j].i]) } - } else { - for j := range v2 { - e.asis(v2[j].v) - e.encode(v[v2[j].i]) + e.asis(v2[j].v) + if esep { + ee.WriteMapElemValue() } + e.encode(v[v2[j].i]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeBool(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -3185,32 +2973,34 @@ func (_ fastpathT) EncMapStringIntfV(v map[string]interface{}, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - e.encode(v[string(k2)]) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - e.encode(v[string(k2)]) } + if esep { + ee.WriteMapElemValue() + } + e.encode(v[string(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - e.encode(v2) } + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) } } ee.WriteMapEnd() @@ -3234,30 +3024,40 @@ func (_ fastpathT) EncMapStringStringV(v map[string]string, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) + } + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[string(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeStringEnc(cUTF8, k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[string(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[string(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() + } + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) + } + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeStringEnc(cUTF8, k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -3283,32 +3083,34 @@ func (_ fastpathT) EncMapStringUintV(v map[string]uint, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -3332,32 +3134,34 @@ func (_ fastpathT) EncMapStringUint8V(v map[string]uint8, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -3381,32 +3185,34 @@ func (_ fastpathT) EncMapStringUint16V(v map[string]uint16, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -3430,32 +3236,34 @@ func (_ fastpathT) EncMapStringUint32V(v map[string]uint32, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -3479,32 +3287,34 @@ func (_ fastpathT) EncMapStringUint64V(v map[string]uint64, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeUint(uint64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -3528,32 +3338,34 @@ func (_ fastpathT) EncMapStringUintptrV(v map[string]uintptr, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - e.encode(v[string(k2)]) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - e.encode(v[string(k2)]) } + if esep { + ee.WriteMapElemValue() + } + e.encode(v[string(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - e.encode(v2) } + if esep { + ee.WriteMapElemValue() + } + e.encode(v2) } } ee.WriteMapEnd() @@ -3577,32 +3389,34 @@ func (_ fastpathT) EncMapStringIntV(v map[string]int, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -3626,32 +3440,34 @@ func (_ fastpathT) EncMapStringInt8V(v map[string]int8, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -3675,32 +3491,34 @@ func (_ fastpathT) EncMapStringInt16V(v map[string]int16, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -3724,32 +3542,34 @@ func (_ fastpathT) EncMapStringInt32V(v map[string]int32, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -3773,32 +3593,34 @@ func (_ fastpathT) EncMapStringInt64V(v map[string]int64, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[string(k2)])) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v[string(k2)])) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v[string(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeInt(int64(v2)) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -3822,32 +3644,34 @@ func (_ fastpathT) EncMapStringFloat32V(v map[string]float32, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[string(k2)]) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeFloat32(v[string(k2)]) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v[string(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeFloat32(v2) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -3871,32 +3695,34 @@ func (_ fastpathT) EncMapStringFloat64V(v map[string]float64, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[string(k2)]) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeFloat64(v[string(k2)]) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v[string(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeFloat64(v2) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -3920,32 +3746,34 @@ func (_ fastpathT) EncMapStringBoolV(v map[string]bool, e *Encoder) { i++ } sort.Sort(stringSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeBool(v[string(k2)]) } - } else { - for _, k2 := range v2 { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeBool(v[string(k2)]) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v[string(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeStringEnc(cUTF8, k2) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(k2)) + } else { ee.EncodeStringEnc(cUTF8, k2) - ee.EncodeBool(v2) } + if esep { + ee.WriteMapElemValue() + } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -3969,32 +3797,26 @@ func (_ fastpathT) EncMapFloat32IntfV(v map[float32]interface{}, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - e.encode(v[float32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - e.encode(v[float32(k2)]) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[float32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - e.encode(v2) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -4018,30 +3840,32 @@ func (_ fastpathT) EncMapFloat32StringV(v map[float32]string, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) + } + ee.EncodeFloat32(float32(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[float32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[float32(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[float32(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) + } + ee.EncodeFloat32(k2) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -4067,32 +3891,26 @@ func (_ fastpathT) EncMapFloat32UintV(v map[float32]uint, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeUint(uint64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4116,32 +3934,26 @@ func (_ fastpathT) EncMapFloat32Uint8V(v map[float32]uint8, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeUint(uint64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4165,32 +3977,26 @@ func (_ fastpathT) EncMapFloat32Uint16V(v map[float32]uint16, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeUint(uint64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4214,32 +4020,26 @@ func (_ fastpathT) EncMapFloat32Uint32V(v map[float32]uint32, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeUint(uint64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4263,32 +4063,26 @@ func (_ fastpathT) EncMapFloat32Uint64V(v map[float32]uint64, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeUint(uint64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4312,32 +4106,26 @@ func (_ fastpathT) EncMapFloat32UintptrV(v map[float32]uintptr, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - e.encode(v[float32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - e.encode(v[float32(k2)]) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[float32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - e.encode(v2) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -4361,32 +4149,26 @@ func (_ fastpathT) EncMapFloat32IntV(v map[float32]int, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeInt(int64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -4410,32 +4192,26 @@ func (_ fastpathT) EncMapFloat32Int8V(v map[float32]int8, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeInt(int64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -4459,32 +4235,26 @@ func (_ fastpathT) EncMapFloat32Int16V(v map[float32]int16, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeInt(int64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -4508,32 +4278,26 @@ func (_ fastpathT) EncMapFloat32Int32V(v map[float32]int32, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeInt(int64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -4557,32 +4321,26 @@ func (_ fastpathT) EncMapFloat32Int64V(v map[float32]int64, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeInt(int64(v[float32(k2)])) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -4606,32 +4364,26 @@ func (_ fastpathT) EncMapFloat32Float32V(v map[float32]float32, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[float32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeFloat32(v[float32(k2)]) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[float32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeFloat32(v2) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -4655,32 +4407,26 @@ func (_ fastpathT) EncMapFloat32Float64V(v map[float32]float64, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[float32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeFloat64(v[float32(k2)]) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[float32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeFloat64(v2) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -4704,32 +4450,26 @@ func (_ fastpathT) EncMapFloat32BoolV(v map[float32]bool, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(float32(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v[float32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat32(float32(k2)) - ee.EncodeBool(v[float32(k2)]) + ee.EncodeFloat32(float32(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[float32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat32(k2) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat32(k2) - ee.EncodeBool(v2) + ee.EncodeFloat32(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -4753,32 +4493,26 @@ func (_ fastpathT) EncMapFloat64IntfV(v map[float64]interface{}, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - e.encode(v[float64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - e.encode(v[float64(k2)]) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[float64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - e.encode(v2) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -4802,30 +4536,32 @@ func (_ fastpathT) EncMapFloat64StringV(v map[float64]string, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) + } + ee.EncodeFloat64(float64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[float64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[float64(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[float64(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) + } + ee.EncodeFloat64(k2) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -4851,32 +4587,26 @@ func (_ fastpathT) EncMapFloat64UintV(v map[float64]uint, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeUint(uint64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4900,32 +4630,26 @@ func (_ fastpathT) EncMapFloat64Uint8V(v map[float64]uint8, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeUint(uint64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4949,32 +4673,26 @@ func (_ fastpathT) EncMapFloat64Uint16V(v map[float64]uint16, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeUint(uint64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -4998,32 +4716,26 @@ func (_ fastpathT) EncMapFloat64Uint32V(v map[float64]uint32, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeUint(uint64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5047,32 +4759,26 @@ func (_ fastpathT) EncMapFloat64Uint64V(v map[float64]uint64, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeUint(uint64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5096,32 +4802,26 @@ func (_ fastpathT) EncMapFloat64UintptrV(v map[float64]uintptr, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - e.encode(v[float64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - e.encode(v[float64(k2)]) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[float64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - e.encode(v2) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -5145,32 +4845,26 @@ func (_ fastpathT) EncMapFloat64IntV(v map[float64]int, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeInt(int64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -5194,32 +4888,26 @@ func (_ fastpathT) EncMapFloat64Int8V(v map[float64]int8, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeInt(int64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -5243,32 +4931,26 @@ func (_ fastpathT) EncMapFloat64Int16V(v map[float64]int16, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeInt(int64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -5292,32 +4974,26 @@ func (_ fastpathT) EncMapFloat64Int32V(v map[float64]int32, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeInt(int64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -5341,32 +5017,26 @@ func (_ fastpathT) EncMapFloat64Int64V(v map[float64]int64, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[float64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeInt(int64(v[float64(k2)])) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[float64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -5390,32 +5060,26 @@ func (_ fastpathT) EncMapFloat64Float32V(v map[float64]float32, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[float64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeFloat32(v[float64(k2)]) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[float64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeFloat32(v2) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -5439,32 +5103,26 @@ func (_ fastpathT) EncMapFloat64Float64V(v map[float64]float64, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[float64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeFloat64(v[float64(k2)]) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[float64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeFloat64(v2) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -5488,32 +5146,26 @@ func (_ fastpathT) EncMapFloat64BoolV(v map[float64]bool, e *Encoder) { i++ } sort.Sort(floatSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(float64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v[float64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeFloat64(float64(k2)) - ee.EncodeBool(v[float64(k2)]) + ee.EncodeFloat64(float64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[float64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeFloat64(k2) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeFloat64(k2) - ee.EncodeBool(v2) + ee.EncodeFloat64(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -5537,32 +5189,26 @@ func (_ fastpathT) EncMapUintIntfV(v map[uint]interface{}, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - e.encode(v[uint(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - e.encode(v[uint(k2)]) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -5586,30 +5232,32 @@ func (_ fastpathT) EncMapUintStringV(v map[uint]string, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) + } + ee.EncodeUint(uint64(uint(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[uint(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[uint(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) + } + ee.EncodeUint(uint64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -5635,32 +5283,26 @@ func (_ fastpathT) EncMapUintUintV(v map[uint]uint, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeUint(uint64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5684,32 +5326,26 @@ func (_ fastpathT) EncMapUintUint8V(v map[uint]uint8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeUint(uint64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5733,32 +5369,26 @@ func (_ fastpathT) EncMapUintUint16V(v map[uint]uint16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeUint(uint64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5782,32 +5412,26 @@ func (_ fastpathT) EncMapUintUint32V(v map[uint]uint32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeUint(uint64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5831,32 +5455,26 @@ func (_ fastpathT) EncMapUintUint64V(v map[uint]uint64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeUint(uint64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -5880,32 +5498,26 @@ func (_ fastpathT) EncMapUintUintptrV(v map[uint]uintptr, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - e.encode(v[uint(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - e.encode(v[uint(k2)]) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -5929,32 +5541,26 @@ func (_ fastpathT) EncMapUintIntV(v map[uint]int, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeInt(int64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -5978,32 +5584,26 @@ func (_ fastpathT) EncMapUintInt8V(v map[uint]int8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeInt(int64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6027,32 +5627,26 @@ func (_ fastpathT) EncMapUintInt16V(v map[uint]int16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeInt(int64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6076,32 +5670,26 @@ func (_ fastpathT) EncMapUintInt32V(v map[uint]int32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeInt(int64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6125,32 +5713,26 @@ func (_ fastpathT) EncMapUintInt64V(v map[uint]int64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeInt(int64(v[uint(k2)])) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6174,32 +5756,26 @@ func (_ fastpathT) EncMapUintFloat32V(v map[uint]float32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[uint(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeFloat32(v[uint(k2)]) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[uint(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -6223,32 +5799,26 @@ func (_ fastpathT) EncMapUintFloat64V(v map[uint]float64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[uint(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeFloat64(v[uint(k2)]) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[uint(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -6272,32 +5842,26 @@ func (_ fastpathT) EncMapUintBoolV(v map[uint]bool, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[uint(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint(k2))) - ee.EncodeBool(v[uint(k2)]) + ee.EncodeUint(uint64(uint(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[uint(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -6321,32 +5885,26 @@ func (_ fastpathT) EncMapUint8IntfV(v map[uint8]interface{}, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - e.encode(v[uint8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - e.encode(v[uint8(k2)]) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -6370,30 +5928,32 @@ func (_ fastpathT) EncMapUint8StringV(v map[uint8]string, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) + } + ee.EncodeUint(uint64(uint8(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[uint8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint8(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[uint8(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) + } + ee.EncodeUint(uint64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -6419,32 +5979,26 @@ func (_ fastpathT) EncMapUint8UintV(v map[uint8]uint, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeUint(uint64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -6468,32 +6022,26 @@ func (_ fastpathT) EncMapUint8Uint8V(v map[uint8]uint8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeUint(uint64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -6517,32 +6065,26 @@ func (_ fastpathT) EncMapUint8Uint16V(v map[uint8]uint16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeUint(uint64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -6566,32 +6108,26 @@ func (_ fastpathT) EncMapUint8Uint32V(v map[uint8]uint32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeUint(uint64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -6615,32 +6151,26 @@ func (_ fastpathT) EncMapUint8Uint64V(v map[uint8]uint64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeUint(uint64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -6664,32 +6194,26 @@ func (_ fastpathT) EncMapUint8UintptrV(v map[uint8]uintptr, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - e.encode(v[uint8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - e.encode(v[uint8(k2)]) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -6713,32 +6237,26 @@ func (_ fastpathT) EncMapUint8IntV(v map[uint8]int, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeInt(int64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6762,32 +6280,26 @@ func (_ fastpathT) EncMapUint8Int8V(v map[uint8]int8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeInt(int64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6811,32 +6323,26 @@ func (_ fastpathT) EncMapUint8Int16V(v map[uint8]int16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeInt(int64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6860,32 +6366,26 @@ func (_ fastpathT) EncMapUint8Int32V(v map[uint8]int32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeInt(int64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6909,32 +6409,26 @@ func (_ fastpathT) EncMapUint8Int64V(v map[uint8]int64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeInt(int64(v[uint8(k2)])) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -6958,32 +6452,26 @@ func (_ fastpathT) EncMapUint8Float32V(v map[uint8]float32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[uint8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeFloat32(v[uint8(k2)]) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[uint8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -7007,32 +6495,26 @@ func (_ fastpathT) EncMapUint8Float64V(v map[uint8]float64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[uint8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeFloat64(v[uint8(k2)]) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[uint8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -7056,32 +6538,26 @@ func (_ fastpathT) EncMapUint8BoolV(v map[uint8]bool, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint8(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[uint8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint8(k2))) - ee.EncodeBool(v[uint8(k2)]) + ee.EncodeUint(uint64(uint8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[uint8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -7105,32 +6581,26 @@ func (_ fastpathT) EncMapUint16IntfV(v map[uint16]interface{}, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - e.encode(v[uint16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - e.encode(v[uint16(k2)]) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -7154,30 +6624,32 @@ func (_ fastpathT) EncMapUint16StringV(v map[uint16]string, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) + } + ee.EncodeUint(uint64(uint16(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[uint16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint16(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[uint16(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) + } + ee.EncodeUint(uint64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -7203,32 +6675,26 @@ func (_ fastpathT) EncMapUint16UintV(v map[uint16]uint, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeUint(uint64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -7252,32 +6718,26 @@ func (_ fastpathT) EncMapUint16Uint8V(v map[uint16]uint8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeUint(uint64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -7301,32 +6761,26 @@ func (_ fastpathT) EncMapUint16Uint16V(v map[uint16]uint16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeUint(uint64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -7350,32 +6804,26 @@ func (_ fastpathT) EncMapUint16Uint32V(v map[uint16]uint32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeUint(uint64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -7399,32 +6847,26 @@ func (_ fastpathT) EncMapUint16Uint64V(v map[uint16]uint64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeUint(uint64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -7448,32 +6890,26 @@ func (_ fastpathT) EncMapUint16UintptrV(v map[uint16]uintptr, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - e.encode(v[uint16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - e.encode(v[uint16(k2)]) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -7497,32 +6933,26 @@ func (_ fastpathT) EncMapUint16IntV(v map[uint16]int, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeInt(int64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -7546,32 +6976,26 @@ func (_ fastpathT) EncMapUint16Int8V(v map[uint16]int8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeInt(int64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -7595,32 +7019,26 @@ func (_ fastpathT) EncMapUint16Int16V(v map[uint16]int16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeInt(int64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -7644,32 +7062,26 @@ func (_ fastpathT) EncMapUint16Int32V(v map[uint16]int32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeInt(int64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -7693,32 +7105,26 @@ func (_ fastpathT) EncMapUint16Int64V(v map[uint16]int64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeInt(int64(v[uint16(k2)])) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -7742,32 +7148,26 @@ func (_ fastpathT) EncMapUint16Float32V(v map[uint16]float32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[uint16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeFloat32(v[uint16(k2)]) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[uint16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -7791,32 +7191,26 @@ func (_ fastpathT) EncMapUint16Float64V(v map[uint16]float64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[uint16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeFloat64(v[uint16(k2)]) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[uint16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -7840,32 +7234,26 @@ func (_ fastpathT) EncMapUint16BoolV(v map[uint16]bool, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint16(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[uint16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint16(k2))) - ee.EncodeBool(v[uint16(k2)]) + ee.EncodeUint(uint64(uint16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[uint16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -7889,32 +7277,26 @@ func (_ fastpathT) EncMapUint32IntfV(v map[uint32]interface{}, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - e.encode(v[uint32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - e.encode(v[uint32(k2)]) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -7938,30 +7320,32 @@ func (_ fastpathT) EncMapUint32StringV(v map[uint32]string, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) + } + ee.EncodeUint(uint64(uint32(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[uint32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint32(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[uint32(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) + } + ee.EncodeUint(uint64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -7987,32 +7371,26 @@ func (_ fastpathT) EncMapUint32UintV(v map[uint32]uint, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeUint(uint64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8036,32 +7414,26 @@ func (_ fastpathT) EncMapUint32Uint8V(v map[uint32]uint8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeUint(uint64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8085,32 +7457,26 @@ func (_ fastpathT) EncMapUint32Uint16V(v map[uint32]uint16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeUint(uint64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8134,32 +7500,26 @@ func (_ fastpathT) EncMapUint32Uint32V(v map[uint32]uint32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeUint(uint64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8183,32 +7543,26 @@ func (_ fastpathT) EncMapUint32Uint64V(v map[uint32]uint64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeUint(uint64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8232,32 +7586,26 @@ func (_ fastpathT) EncMapUint32UintptrV(v map[uint32]uintptr, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - e.encode(v[uint32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - e.encode(v[uint32(k2)]) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -8281,32 +7629,26 @@ func (_ fastpathT) EncMapUint32IntV(v map[uint32]int, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeInt(int64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -8330,32 +7672,26 @@ func (_ fastpathT) EncMapUint32Int8V(v map[uint32]int8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeInt(int64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -8379,32 +7715,26 @@ func (_ fastpathT) EncMapUint32Int16V(v map[uint32]int16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeInt(int64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -8428,32 +7758,26 @@ func (_ fastpathT) EncMapUint32Int32V(v map[uint32]int32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeInt(int64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -8477,32 +7801,26 @@ func (_ fastpathT) EncMapUint32Int64V(v map[uint32]int64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeInt(int64(v[uint32(k2)])) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -8526,32 +7844,26 @@ func (_ fastpathT) EncMapUint32Float32V(v map[uint32]float32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[uint32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeFloat32(v[uint32(k2)]) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[uint32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -8575,32 +7887,26 @@ func (_ fastpathT) EncMapUint32Float64V(v map[uint32]float64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[uint32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeFloat64(v[uint32(k2)]) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[uint32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -8624,32 +7930,26 @@ func (_ fastpathT) EncMapUint32BoolV(v map[uint32]bool, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint32(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[uint32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint32(k2))) - ee.EncodeBool(v[uint32(k2)]) + ee.EncodeUint(uint64(uint32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[uint32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -8673,32 +7973,26 @@ func (_ fastpathT) EncMapUint64IntfV(v map[uint64]interface{}, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - e.encode(v[uint64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - e.encode(v[uint64(k2)]) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -8722,30 +8016,32 @@ func (_ fastpathT) EncMapUint64StringV(v map[uint64]string, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) + } + ee.EncodeUint(uint64(uint64(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[uint64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uint64(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[uint64(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) + } + ee.EncodeUint(uint64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -8771,32 +8067,26 @@ func (_ fastpathT) EncMapUint64UintV(v map[uint64]uint, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeUint(uint64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8820,32 +8110,26 @@ func (_ fastpathT) EncMapUint64Uint8V(v map[uint64]uint8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeUint(uint64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8869,32 +8153,26 @@ func (_ fastpathT) EncMapUint64Uint16V(v map[uint64]uint16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeUint(uint64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8918,32 +8196,26 @@ func (_ fastpathT) EncMapUint64Uint32V(v map[uint64]uint32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeUint(uint64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -8967,32 +8239,26 @@ func (_ fastpathT) EncMapUint64Uint64V(v map[uint64]uint64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeUint(uint64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -9016,32 +8282,26 @@ func (_ fastpathT) EncMapUint64UintptrV(v map[uint64]uintptr, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - e.encode(v[uint64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - e.encode(v[uint64(k2)]) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uint64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - e.encode(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -9065,32 +8325,26 @@ func (_ fastpathT) EncMapUint64IntV(v map[uint64]int, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeInt(int64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9114,32 +8368,26 @@ func (_ fastpathT) EncMapUint64Int8V(v map[uint64]int8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeInt(int64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9163,32 +8411,26 @@ func (_ fastpathT) EncMapUint64Int16V(v map[uint64]int16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeInt(int64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9212,32 +8454,26 @@ func (_ fastpathT) EncMapUint64Int32V(v map[uint64]int32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeInt(int64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9261,32 +8497,26 @@ func (_ fastpathT) EncMapUint64Int64V(v map[uint64]int64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uint64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeInt(int64(v[uint64(k2)])) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uint64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9310,32 +8540,26 @@ func (_ fastpathT) EncMapUint64Float32V(v map[uint64]float32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[uint64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeFloat32(v[uint64(k2)]) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[uint64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -9359,32 +8583,26 @@ func (_ fastpathT) EncMapUint64Float64V(v map[uint64]float64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[uint64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeFloat64(v[uint64(k2)]) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[uint64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -9408,32 +8626,26 @@ func (_ fastpathT) EncMapUint64BoolV(v map[uint64]bool, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(uint64(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[uint64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeUint(uint64(uint64(k2))) - ee.EncodeBool(v[uint64(k2)]) + ee.EncodeUint(uint64(uint64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[uint64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeUint(uint64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeUint(uint64(k2)) - ee.EncodeBool(v2) + ee.EncodeUint(uint64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -9457,32 +8669,26 @@ func (_ fastpathT) EncMapUintptrIntfV(v map[uintptr]interface{}, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - e.encode(v[uintptr(k2)]) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - e.encode(v[uintptr(k2)]) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uintptr(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -9506,30 +8712,32 @@ func (_ fastpathT) EncMapUintptrStringV(v map[uintptr]string, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) + } + e.encode(uintptr(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[uintptr(k2)]) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[uintptr(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[uintptr(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) + } + e.encode(k2) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - e.encode(k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -9555,32 +8763,26 @@ func (_ fastpathT) EncMapUintptrUintV(v map[uintptr]uint, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeUint(uint64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -9604,32 +8806,26 @@ func (_ fastpathT) EncMapUintptrUint8V(v map[uintptr]uint8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeUint(uint64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -9653,32 +8849,26 @@ func (_ fastpathT) EncMapUintptrUint16V(v map[uintptr]uint16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeUint(uint64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -9702,32 +8892,26 @@ func (_ fastpathT) EncMapUintptrUint32V(v map[uintptr]uint32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeUint(uint64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -9751,32 +8935,26 @@ func (_ fastpathT) EncMapUintptrUint64V(v map[uintptr]uint64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeUint(uint64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeUint(uint64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -9800,32 +8978,26 @@ func (_ fastpathT) EncMapUintptrUintptrV(v map[uintptr]uintptr, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - e.encode(v[uintptr(k2)]) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - e.encode(v[uintptr(k2)]) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[uintptr(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - e.encode(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -9849,32 +9021,26 @@ func (_ fastpathT) EncMapUintptrIntV(v map[uintptr]int, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeInt(int64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9898,32 +9064,26 @@ func (_ fastpathT) EncMapUintptrInt8V(v map[uintptr]int8, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeInt(int64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9947,32 +9107,26 @@ func (_ fastpathT) EncMapUintptrInt16V(v map[uintptr]int16, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeInt(int64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -9996,32 +9150,26 @@ func (_ fastpathT) EncMapUintptrInt32V(v map[uintptr]int32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeInt(int64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10045,32 +9193,26 @@ func (_ fastpathT) EncMapUintptrInt64V(v map[uintptr]int64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[uintptr(k2)])) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeInt(int64(v[uintptr(k2)])) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[uintptr(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeInt(int64(v2)) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10094,32 +9236,26 @@ func (_ fastpathT) EncMapUintptrFloat32V(v map[uintptr]float32, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[uintptr(k2)]) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeFloat32(v[uintptr(k2)]) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[uintptr(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat32(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -10143,32 +9279,26 @@ func (_ fastpathT) EncMapUintptrFloat64V(v map[uintptr]float64, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[uintptr(k2)]) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeFloat64(v[uintptr(k2)]) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[uintptr(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeFloat64(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -10192,32 +9322,26 @@ func (_ fastpathT) EncMapUintptrBoolV(v map[uintptr]bool, e *Encoder) { i++ } sort.Sort(uintSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - e.encode(uintptr(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v[uintptr(k2)]) } - } else { - for _, k2 := range v2 { - e.encode(uintptr(k2)) - ee.EncodeBool(v[uintptr(k2)]) + e.encode(uintptr(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[uintptr(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - e.encode(k2) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - e.encode(k2) - ee.EncodeBool(v2) + e.encode(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -10241,32 +9365,26 @@ func (_ fastpathT) EncMapIntIntfV(v map[int]interface{}, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - e.encode(v[int(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - e.encode(v[int(k2)]) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -10290,30 +9408,32 @@ func (_ fastpathT) EncMapIntStringV(v map[int]string, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) + } + ee.EncodeInt(int64(int(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[int(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[int(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) + } + ee.EncodeInt(int64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -10339,32 +9459,26 @@ func (_ fastpathT) EncMapIntUintV(v map[int]uint, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeUint(uint64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -10388,32 +9502,26 @@ func (_ fastpathT) EncMapIntUint8V(v map[int]uint8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeUint(uint64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -10437,32 +9545,26 @@ func (_ fastpathT) EncMapIntUint16V(v map[int]uint16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeUint(uint64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -10486,32 +9588,26 @@ func (_ fastpathT) EncMapIntUint32V(v map[int]uint32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeUint(uint64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -10535,32 +9631,26 @@ func (_ fastpathT) EncMapIntUint64V(v map[int]uint64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeUint(uint64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -10584,32 +9674,26 @@ func (_ fastpathT) EncMapIntUintptrV(v map[int]uintptr, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - e.encode(v[int(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - e.encode(v[int(k2)]) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -10633,32 +9717,26 @@ func (_ fastpathT) EncMapIntIntV(v map[int]int, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeInt(int64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10682,32 +9760,26 @@ func (_ fastpathT) EncMapIntInt8V(v map[int]int8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeInt(int64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10731,32 +9803,26 @@ func (_ fastpathT) EncMapIntInt16V(v map[int]int16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeInt(int64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10780,32 +9846,26 @@ func (_ fastpathT) EncMapIntInt32V(v map[int]int32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeInt(int64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10829,32 +9889,26 @@ func (_ fastpathT) EncMapIntInt64V(v map[int]int64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeInt(int64(v[int(k2)])) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -10878,32 +9932,26 @@ func (_ fastpathT) EncMapIntFloat32V(v map[int]float32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[int(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeFloat32(v[int(k2)]) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[int(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -10927,32 +9975,26 @@ func (_ fastpathT) EncMapIntFloat64V(v map[int]float64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[int(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeFloat64(v[int(k2)]) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[int(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -10976,32 +10018,26 @@ func (_ fastpathT) EncMapIntBoolV(v map[int]bool, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[int(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int(k2))) - ee.EncodeBool(v[int(k2)]) + ee.EncodeInt(int64(int(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[int(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -11025,32 +10061,26 @@ func (_ fastpathT) EncMapInt8IntfV(v map[int8]interface{}, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - e.encode(v[int8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - e.encode(v[int8(k2)]) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -11074,30 +10104,32 @@ func (_ fastpathT) EncMapInt8StringV(v map[int8]string, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) + } + ee.EncodeInt(int64(int8(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[int8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int8(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[int8(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) + } + ee.EncodeInt(int64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -11123,32 +10155,26 @@ func (_ fastpathT) EncMapInt8UintV(v map[int8]uint, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeUint(uint64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -11172,32 +10198,26 @@ func (_ fastpathT) EncMapInt8Uint8V(v map[int8]uint8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeUint(uint64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -11221,32 +10241,26 @@ func (_ fastpathT) EncMapInt8Uint16V(v map[int8]uint16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeUint(uint64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -11270,32 +10284,26 @@ func (_ fastpathT) EncMapInt8Uint32V(v map[int8]uint32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeUint(uint64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -11319,32 +10327,26 @@ func (_ fastpathT) EncMapInt8Uint64V(v map[int8]uint64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeUint(uint64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -11368,32 +10370,26 @@ func (_ fastpathT) EncMapInt8UintptrV(v map[int8]uintptr, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - e.encode(v[int8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - e.encode(v[int8(k2)]) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -11417,32 +10413,26 @@ func (_ fastpathT) EncMapInt8IntV(v map[int8]int, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeInt(int64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -11466,32 +10456,26 @@ func (_ fastpathT) EncMapInt8Int8V(v map[int8]int8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeInt(int64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -11515,32 +10499,26 @@ func (_ fastpathT) EncMapInt8Int16V(v map[int8]int16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeInt(int64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -11564,32 +10542,26 @@ func (_ fastpathT) EncMapInt8Int32V(v map[int8]int32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeInt(int64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -11613,32 +10585,26 @@ func (_ fastpathT) EncMapInt8Int64V(v map[int8]int64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int8(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeInt(int64(v[int8(k2)])) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int8(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -11662,32 +10628,26 @@ func (_ fastpathT) EncMapInt8Float32V(v map[int8]float32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[int8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeFloat32(v[int8(k2)]) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[int8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -11711,32 +10671,26 @@ func (_ fastpathT) EncMapInt8Float64V(v map[int8]float64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[int8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeFloat64(v[int8(k2)]) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[int8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -11760,32 +10714,26 @@ func (_ fastpathT) EncMapInt8BoolV(v map[int8]bool, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int8(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[int8(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int8(k2))) - ee.EncodeBool(v[int8(k2)]) + ee.EncodeInt(int64(int8(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[int8(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -11809,32 +10757,26 @@ func (_ fastpathT) EncMapInt16IntfV(v map[int16]interface{}, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - e.encode(v[int16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - e.encode(v[int16(k2)]) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -11858,30 +10800,32 @@ func (_ fastpathT) EncMapInt16StringV(v map[int16]string, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) + } + ee.EncodeInt(int64(int16(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[int16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int16(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[int16(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) + } + ee.EncodeInt(int64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -11907,32 +10851,26 @@ func (_ fastpathT) EncMapInt16UintV(v map[int16]uint, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeUint(uint64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -11956,32 +10894,26 @@ func (_ fastpathT) EncMapInt16Uint8V(v map[int16]uint8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeUint(uint64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12005,32 +10937,26 @@ func (_ fastpathT) EncMapInt16Uint16V(v map[int16]uint16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeUint(uint64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12054,32 +10980,26 @@ func (_ fastpathT) EncMapInt16Uint32V(v map[int16]uint32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeUint(uint64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12103,32 +11023,26 @@ func (_ fastpathT) EncMapInt16Uint64V(v map[int16]uint64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeUint(uint64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12152,32 +11066,26 @@ func (_ fastpathT) EncMapInt16UintptrV(v map[int16]uintptr, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - e.encode(v[int16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - e.encode(v[int16(k2)]) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -12201,32 +11109,26 @@ func (_ fastpathT) EncMapInt16IntV(v map[int16]int, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeInt(int64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -12250,32 +11152,26 @@ func (_ fastpathT) EncMapInt16Int8V(v map[int16]int8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeInt(int64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -12299,32 +11195,26 @@ func (_ fastpathT) EncMapInt16Int16V(v map[int16]int16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeInt(int64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -12348,32 +11238,26 @@ func (_ fastpathT) EncMapInt16Int32V(v map[int16]int32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeInt(int64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -12397,32 +11281,26 @@ func (_ fastpathT) EncMapInt16Int64V(v map[int16]int64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int16(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeInt(int64(v[int16(k2)])) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int16(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -12446,32 +11324,26 @@ func (_ fastpathT) EncMapInt16Float32V(v map[int16]float32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[int16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeFloat32(v[int16(k2)]) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[int16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -12495,32 +11367,26 @@ func (_ fastpathT) EncMapInt16Float64V(v map[int16]float64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[int16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeFloat64(v[int16(k2)]) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[int16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -12544,32 +11410,26 @@ func (_ fastpathT) EncMapInt16BoolV(v map[int16]bool, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int16(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[int16(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int16(k2))) - ee.EncodeBool(v[int16(k2)]) + ee.EncodeInt(int64(int16(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[int16(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -12593,32 +11453,26 @@ func (_ fastpathT) EncMapInt32IntfV(v map[int32]interface{}, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - e.encode(v[int32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - e.encode(v[int32(k2)]) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -12642,30 +11496,32 @@ func (_ fastpathT) EncMapInt32StringV(v map[int32]string, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) + } + ee.EncodeInt(int64(int32(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[int32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int32(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[int32(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) + } + ee.EncodeInt(int64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -12691,32 +11547,26 @@ func (_ fastpathT) EncMapInt32UintV(v map[int32]uint, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeUint(uint64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12740,32 +11590,26 @@ func (_ fastpathT) EncMapInt32Uint8V(v map[int32]uint8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeUint(uint64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12789,32 +11633,26 @@ func (_ fastpathT) EncMapInt32Uint16V(v map[int32]uint16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeUint(uint64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12838,32 +11676,26 @@ func (_ fastpathT) EncMapInt32Uint32V(v map[int32]uint32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeUint(uint64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12887,32 +11719,26 @@ func (_ fastpathT) EncMapInt32Uint64V(v map[int32]uint64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeUint(uint64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -12936,32 +11762,26 @@ func (_ fastpathT) EncMapInt32UintptrV(v map[int32]uintptr, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - e.encode(v[int32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - e.encode(v[int32(k2)]) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -12985,32 +11805,26 @@ func (_ fastpathT) EncMapInt32IntV(v map[int32]int, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeInt(int64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13034,32 +11848,26 @@ func (_ fastpathT) EncMapInt32Int8V(v map[int32]int8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeInt(int64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13083,32 +11891,26 @@ func (_ fastpathT) EncMapInt32Int16V(v map[int32]int16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeInt(int64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13132,32 +11934,26 @@ func (_ fastpathT) EncMapInt32Int32V(v map[int32]int32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeInt(int64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13181,32 +11977,26 @@ func (_ fastpathT) EncMapInt32Int64V(v map[int32]int64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int32(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeInt(int64(v[int32(k2)])) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int32(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13230,32 +12020,26 @@ func (_ fastpathT) EncMapInt32Float32V(v map[int32]float32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[int32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeFloat32(v[int32(k2)]) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[int32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -13279,32 +12063,26 @@ func (_ fastpathT) EncMapInt32Float64V(v map[int32]float64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[int32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeFloat64(v[int32(k2)]) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[int32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -13328,32 +12106,26 @@ func (_ fastpathT) EncMapInt32BoolV(v map[int32]bool, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int32(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[int32(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int32(k2))) - ee.EncodeBool(v[int32(k2)]) + ee.EncodeInt(int64(int32(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[int32(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -13377,32 +12149,26 @@ func (_ fastpathT) EncMapInt64IntfV(v map[int64]interface{}, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - e.encode(v[int64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - e.encode(v[int64(k2)]) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -13426,30 +12192,32 @@ func (_ fastpathT) EncMapInt64StringV(v map[int64]string, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) + } + ee.EncodeInt(int64(int64(k2))) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[int64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[int64(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[int64(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) + } + ee.EncodeInt(int64(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -13475,32 +12243,26 @@ func (_ fastpathT) EncMapInt64UintV(v map[int64]uint, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeUint(uint64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -13524,32 +12286,26 @@ func (_ fastpathT) EncMapInt64Uint8V(v map[int64]uint8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeUint(uint64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -13573,32 +12329,26 @@ func (_ fastpathT) EncMapInt64Uint16V(v map[int64]uint16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeUint(uint64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -13622,32 +12372,26 @@ func (_ fastpathT) EncMapInt64Uint32V(v map[int64]uint32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeUint(uint64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -13671,32 +12415,26 @@ func (_ fastpathT) EncMapInt64Uint64V(v map[int64]uint64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeUint(uint64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeUint(uint64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -13720,32 +12458,26 @@ func (_ fastpathT) EncMapInt64UintptrV(v map[int64]uintptr, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - e.encode(v[int64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - e.encode(v[int64(k2)]) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + e.encode(v[int64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - e.encode(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -13769,32 +12501,26 @@ func (_ fastpathT) EncMapInt64IntV(v map[int64]int, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeInt(int64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13818,32 +12544,26 @@ func (_ fastpathT) EncMapInt64Int8V(v map[int64]int8, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeInt(int64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13867,32 +12587,26 @@ func (_ fastpathT) EncMapInt64Int16V(v map[int64]int16, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeInt(int64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13916,32 +12630,26 @@ func (_ fastpathT) EncMapInt64Int32V(v map[int64]int32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeInt(int64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -13965,32 +12673,26 @@ func (_ fastpathT) EncMapInt64Int64V(v map[int64]int64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[int64(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeInt(int64(v[int64(k2)])) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[int64(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeInt(int64(v2)) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -14014,32 +12716,26 @@ func (_ fastpathT) EncMapInt64Float32V(v map[int64]float32, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[int64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeFloat32(v[int64(k2)]) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[int64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat32(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -14063,32 +12759,26 @@ func (_ fastpathT) EncMapInt64Float64V(v map[int64]float64, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[int64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeFloat64(v[int64(k2)]) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[int64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeFloat64(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -14112,32 +12802,26 @@ func (_ fastpathT) EncMapInt64BoolV(v map[int64]bool, e *Encoder) { i++ } sort.Sort(intSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(int64(k2))) - ee.WriteMapElemValue() - ee.EncodeBool(v[int64(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeInt(int64(int64(k2))) - ee.EncodeBool(v[int64(k2)]) + ee.EncodeInt(int64(int64(k2))) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[int64(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeInt(int64(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeInt(int64(k2)) - ee.EncodeBool(v2) + ee.EncodeInt(int64(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() @@ -14161,32 +12845,26 @@ func (_ fastpathT) EncMapBoolIntfV(v map[bool]interface{}, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - e.encode(v[bool(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - e.encode(v[bool(k2)]) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[bool(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - e.encode(v2) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -14210,30 +12888,32 @@ func (_ fastpathT) EncMapBoolStringV(v map[bool]string, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) + } + ee.EncodeBool(bool(k2)) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v[bool(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v[bool(k2)])) + } else { ee.EncodeStringEnc(cUTF8, v[bool(k2)]) } } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) + } + ee.EncodeBool(k2) + if esep { ee.WriteMapElemValue() - ee.EncodeStringEnc(cUTF8, v2) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) + if e.h.StringToRaw { + ee.EncodeStringBytesRaw(bytesView(v2)) + } else { ee.EncodeStringEnc(cUTF8, v2) } } @@ -14259,32 +12939,26 @@ func (_ fastpathT) EncMapBoolUintV(v map[bool]uint, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeUint(uint64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -14308,32 +12982,26 @@ func (_ fastpathT) EncMapBoolUint8V(v map[bool]uint8, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeUint(uint64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -14357,32 +13025,26 @@ func (_ fastpathT) EncMapBoolUint16V(v map[bool]uint16, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeUint(uint64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -14406,32 +13068,26 @@ func (_ fastpathT) EncMapBoolUint32V(v map[bool]uint32, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeUint(uint64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -14455,32 +13111,26 @@ func (_ fastpathT) EncMapBoolUint64V(v map[bool]uint64, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeUint(uint64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeUint(uint64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeUint(uint64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeUint(uint64(v2)) } } ee.WriteMapEnd() @@ -14504,32 +13154,26 @@ func (_ fastpathT) EncMapBoolUintptrV(v map[bool]uintptr, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - e.encode(v[bool(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - e.encode(v[bool(k2)]) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + e.encode(v[bool(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - e.encode(v2) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - e.encode(v2) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + e.encode(v2) } } ee.WriteMapEnd() @@ -14553,32 +13197,26 @@ func (_ fastpathT) EncMapBoolIntV(v map[bool]int, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeInt(int64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -14602,32 +13240,26 @@ func (_ fastpathT) EncMapBoolInt8V(v map[bool]int8, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeInt(int64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -14651,32 +13283,26 @@ func (_ fastpathT) EncMapBoolInt16V(v map[bool]int16, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeInt(int64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -14700,32 +13326,26 @@ func (_ fastpathT) EncMapBoolInt32V(v map[bool]int32, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeInt(int64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -14749,32 +13369,26 @@ func (_ fastpathT) EncMapBoolInt64V(v map[bool]int64, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v[bool(k2)])) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeInt(int64(v[bool(k2)])) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v[bool(k2)])) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeInt(int64(v2)) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeInt(int64(v2)) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeInt(int64(v2)) } } ee.WriteMapEnd() @@ -14798,32 +13412,26 @@ func (_ fastpathT) EncMapBoolFloat32V(v map[bool]float32, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat32(v[bool(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeFloat32(v[bool(k2)]) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v[bool(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeFloat32(v2) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeFloat32(v2) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat32(v2) } } ee.WriteMapEnd() @@ -14847,32 +13455,26 @@ func (_ fastpathT) EncMapBoolFloat64V(v map[bool]float64, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeFloat64(v[bool(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeFloat64(v[bool(k2)]) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v[bool(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeFloat64(v2) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeFloat64(v2) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeFloat64(v2) } } ee.WriteMapEnd() @@ -14896,32 +13498,26 @@ func (_ fastpathT) EncMapBoolBoolV(v map[bool]bool, e *Encoder) { i++ } sort.Sort(boolSlice(v2)) - if esep { - for _, k2 := range v2 { + for _, k2 := range v2 { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(bool(k2)) - ee.WriteMapElemValue() - ee.EncodeBool(v[bool(k2)]) } - } else { - for _, k2 := range v2 { - ee.EncodeBool(bool(k2)) - ee.EncodeBool(v[bool(k2)]) + ee.EncodeBool(bool(k2)) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v[bool(k2)]) } } else { - if esep { - for k2, v2 := range v { + for k2, v2 := range v { + if esep { ee.WriteMapElemKey() - ee.EncodeBool(k2) - ee.WriteMapElemValue() - ee.EncodeBool(v2) } - } else { - for k2, v2 := range v { - ee.EncodeBool(k2) - ee.EncodeBool(v2) + ee.EncodeBool(k2) + if esep { + ee.WriteMapElemValue() } + ee.EncodeBool(v2) } } ee.WriteMapEnd() diff --git a/vendor/github.com/ugorji/go/codec/gen-helper.generated.go b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go index b5155240..2a7d1aab 100644 --- a/vendor/github.com/ugorji/go/codec/gen-helper.generated.go +++ b/vendor/github.com/ugorji/go/codec/gen-helper.generated.go @@ -10,7 +10,6 @@ package codec import ( "encoding" "reflect" - "strconv" ) // GenVersion is the current version of codecgen. @@ -50,17 +49,7 @@ type genHelperEncDriver struct { func (x genHelperEncDriver) EncodeBuiltin(rt uintptr, v interface{}) {} func (x genHelperEncDriver) EncStructFieldKey(keyType valueType, s string) { - var m must - if keyType == valueTypeString { - x.encDriver.EncodeStringEnc(cUTF8, s) - } else if keyType == valueTypeInt { - x.encDriver.EncodeInt(m.Int(strconv.ParseInt(s, 10, 64))) - } else if keyType == valueTypeUint { - x.encDriver.EncodeUint(m.Uint(strconv.ParseUint(s, 10, 64))) - } else if keyType == valueTypeFloat { - x.encDriver.EncodeFloat64(m.Float(strconv.ParseFloat(s, 64))) - } - // encStructFieldKey(x.encDriver, keyType, s) + encStructFieldKey(s, x.encDriver, nil, keyType, false, false) } func (x genHelperEncDriver) EncodeSymbol(s string) { x.encDriver.EncodeStringEnc(cUTF8, s) @@ -185,6 +174,9 @@ func (f genHelperEncoder) WriteStr(s string) { f.e.w.writestr(s) } +// FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* +func (f genHelperEncoder) BytesView(v string) []byte { return bytesView(v) } + // FOR USE BY CODECGEN ONLY. IT *WILL* CHANGE WITHOUT NOTICE. *DO NOT USE* // // Deprecated: No longer used, diff --git a/vendor/github.com/ugorji/go/codec/gen.go b/vendor/github.com/ugorji/go/codec/gen.go index 115c9b46..74c4aa86 100644 --- a/vendor/github.com/ugorji/go/codec/gen.go +++ b/vendor/github.com/ugorji/go/codec/gen.go @@ -798,7 +798,7 @@ func (x *genRunner) enc(varname string, t reflect.Type) { case reflect.Bool: x.line("r.EncodeBool(bool(" + varname + "))") case reflect.String: - x.line("r.EncodeStringEnc(codecSelferCcUTF8" + x.xs + ", string(" + varname + "))") + x.linef("if z.EncBasicHandle().StringToRaw { r.EncodeStringBytesRaw(z.BytesView(string(%s))) } else { r.EncodeStringEnc(codecSelferCcUTF8%s, string(%s)) }", varname, x.xs, varname) case reflect.Chan: x.xtraSM(varname, t, true, false) // x.encListFallback(varname, rtid, t) @@ -862,7 +862,7 @@ func (x *genRunner) encZero(t reflect.Type) { case reflect.Bool: x.line("r.EncodeBool(false)") case reflect.String: - x.line("r.EncodeStringEnc(codecSelferCcUTF8" + x.xs + `, "")`) + x.linef(`if z.EncBasicHandle().StringToRaw { r.EncodeStringBytesRaw([]byte{}) } else { r.EncodeStringEnc(codecSelferCcUTF8%s, "") }`, x.xs) default: x.line("r.EncodeNil()") } @@ -1051,7 +1051,6 @@ func (x *genRunner) encStruct(varname string, rtid uintptr, t reflect.Type) { } x.line("r.WriteMapElemKey()") - // x.line("r.EncodeStringEnc(codecSelferCcUTF8" + x.xs + ", `" + si.encName + "`)") // emulate EncStructFieldKey switch ti.keyType { case valueTypeInt: @@ -1937,7 +1936,8 @@ func genInternalEncCommandAsString(s string, vname string) string { case "int", "int8", "int16", "int32", "int64": return "ee.EncodeInt(int64(" + vname + "))" case "string": - return "ee.EncodeStringEnc(cUTF8, " + vname + ")" + return "if e.h.StringToRaw { ee.EncodeStringBytesRaw(bytesView(" + vname + ")) " + + "} else { ee.EncodeStringEnc(cUTF8, " + vname + ") }" case "float32": return "ee.EncodeFloat32(" + vname + ")" case "float64": diff --git a/vendor/github.com/ugorji/go/codec/helper.go b/vendor/github.com/ugorji/go/codec/helper.go index adc3b7b0..8ada846b 100644 --- a/vendor/github.com/ugorji/go/codec/helper.go +++ b/vendor/github.com/ugorji/go/codec/helper.go @@ -127,7 +127,7 @@ const ( // arrayCacheLen is the length of the cache used in encoder or decoder for // allowing zero-alloc initialization. - arrayCacheLen = 8 + // arrayCacheLen = 8 // size of the cacheline: defaulting to value for archs: amd64, arm64, 386 // should use "runtime/internal/sys".CacheLineSize, but that is not exposed. @@ -149,8 +149,7 @@ const ( // explicitly call SetFinalizer themselves e.g. // runtime.SetFinalizer(e, (*Encoder).Release) // runtime.SetFinalizer(d, (*Decoder).Release) - useFinalizers = false - removeFinalizerOnRelease = false + useFinalizers = false ) var oneByteArr [1]byte @@ -2543,6 +2542,12 @@ func (z *bytesBufPooler) end() { } func (z *bytesBufPooler) get(bufsize int) (buf []byte) { + // ensure an end is called first (if necessary) + if z.pool != nil { + z.pool.Put(z.poolbuf) + z.pool, z.poolbuf = nil, nil + } + // // Try to use binary search. // // This is not optimal, as most folks select 1k or 2k buffers // // so a linear search is better (sequence of if/else blocks) diff --git a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go index eef58636..74987f9f 100644 --- a/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go +++ b/vendor/github.com/ugorji/go/codec/helper_not_unsafe.go @@ -248,7 +248,12 @@ func (e *Encoder) kTime(f *codecFnInfo, rv reflect.Value) { } func (e *Encoder) kString(f *codecFnInfo, rv reflect.Value) { - e.e.EncodeStringEnc(cUTF8, rv.String()) + s := rv.String() + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(s)) + } else { + e.e.EncodeStringEnc(cUTF8, s) + } } func (e *Encoder) kFloat64(f *codecFnInfo, rv reflect.Value) { diff --git a/vendor/github.com/ugorji/go/codec/helper_unsafe.go b/vendor/github.com/ugorji/go/codec/helper_unsafe.go index 51de2d68..3bc34d90 100644 --- a/vendor/github.com/ugorji/go/codec/helper_unsafe.go +++ b/vendor/github.com/ugorji/go/codec/helper_unsafe.go @@ -408,7 +408,12 @@ func (e *Encoder) kTime(f *codecFnInfo, rv reflect.Value) { func (e *Encoder) kString(f *codecFnInfo, rv reflect.Value) { v := (*unsafeReflectValue)(unsafe.Pointer(&rv)) - e.e.EncodeStringEnc(cUTF8, *(*string)(v.ptr)) + s := *(*string)(v.ptr) + if e.h.StringToRaw { + e.e.EncodeStringBytesRaw(bytesView(s)) + } else { + e.e.EncodeStringEnc(cUTF8, s) + } } func (e *Encoder) kFloat64(f *codecFnInfo, rv reflect.Value) { diff --git a/vendor/github.com/ugorji/go/codec/msgpack.go b/vendor/github.com/ugorji/go/codec/msgpack.go index bc3f259a..85c71f22 100644 --- a/vendor/github.com/ugorji/go/codec/msgpack.go +++ b/vendor/github.com/ugorji/go/codec/msgpack.go @@ -172,23 +172,26 @@ type MsgpackSpecRpcMultiArgs []interface{} // A MsgpackContainer type specifies the different types of msgpackContainers. type msgpackContainerType struct { - fixCutoff int - bFixMin, b8, b16, b32 byte - hasFixMin, has8, has8Always bool + fixCutoff uint8 + bFixMin, b8, b16, b32 byte + // hasFixMin, has8, has8Always bool } var ( + msgpackContainerRawLegacy = msgpackContainerType{ + 32, mpFixStrMin, 0, mpStr16, mpStr32, + } msgpackContainerStr = msgpackContainerType{ - 32, mpFixStrMin, mpStr8, mpStr16, mpStr32, true, true, false, + 32, mpFixStrMin, mpStr8, mpStr16, mpStr32, // true, true, false, } msgpackContainerBin = msgpackContainerType{ - 0, 0, mpBin8, mpBin16, mpBin32, false, true, true, + 0, 0, mpBin8, mpBin16, mpBin32, // false, true, true, } msgpackContainerList = msgpackContainerType{ - 16, mpFixArrayMin, 0, mpArray16, mpArray32, true, false, false, + 16, mpFixArrayMin, 0, mpArray16, mpArray32, // true, false, false, } msgpackContainerMap = msgpackContainerType{ - 16, mpFixMapMin, 0, mpMap16, mpMap32, true, false, false, + 16, mpFixMapMin, 0, mpMap16, mpMap32, // true, false, false, } ) @@ -302,7 +305,7 @@ func (e *msgpackEncDriver) EncodeTime(t time.Time) { if e.h.WriteExt { e.encodeExtPreamble(mpTimeExtTagU, l) } else { - e.writeContainerLen(msgpackContainerStr, l) + e.writeContainerLen(msgpackContainerRawLegacy, l) } switch l { case 4: @@ -372,7 +375,7 @@ func (e *msgpackEncDriver) EncodeString(c charEncoding, s string) { if c == cRAW && e.h.WriteExt { e.writeContainerLen(msgpackContainerBin, slen) } else { - e.writeContainerLen(msgpackContainerStr, slen) + e.writeContainerLen(msgpackContainerRawLegacy, slen) } if slen > 0 { e.w.writestr(s) @@ -396,7 +399,7 @@ func (e *msgpackEncDriver) EncodeStringBytes(c charEncoding, bs []byte) { if c == cRAW && e.h.WriteExt { e.writeContainerLen(msgpackContainerBin, slen) } else { - e.writeContainerLen(msgpackContainerStr, slen) + e.writeContainerLen(msgpackContainerRawLegacy, slen) } if slen > 0 { e.w.writeb(bs) @@ -412,7 +415,7 @@ func (e *msgpackEncDriver) EncodeStringBytesRaw(bs []byte) { if e.h.WriteExt { e.writeContainerLen(msgpackContainerBin, slen) } else { - e.writeContainerLen(msgpackContainerStr, slen) + e.writeContainerLen(msgpackContainerRawLegacy, slen) } if slen > 0 { e.w.writeb(bs) @@ -420,9 +423,9 @@ func (e *msgpackEncDriver) EncodeStringBytesRaw(bs []byte) { } func (e *msgpackEncDriver) writeContainerLen(ct msgpackContainerType, l int) { - if ct.hasFixMin && l < ct.fixCutoff { + if ct.fixCutoff > 0 && l < int(ct.fixCutoff) { e.w.writen1(ct.bFixMin | byte(l)) - } else if ct.has8 && l < 256 && (ct.has8Always || e.h.WriteExt) { + } else if ct.b8 > 0 && l < 256 { e.w.writen2(ct.b8, uint8(l)) } else if l < 65536 { e.w.writen1(ct.b16) @@ -518,7 +521,7 @@ func (d *msgpackDecDriver) DecodeNaked() { n.v = valueTypeInt n.i = int64(int8(bd)) case bd == mpStr8, bd == mpStr16, bd == mpStr32, bd >= mpFixStrMin && bd <= mpFixStrMax: - if d.h.RawToString { + if d.h.WriteExt { n.v = valueTypeString n.s = d.DecodeString() } else { @@ -526,8 +529,7 @@ func (d *msgpackDecDriver) DecodeNaked() { n.l = d.DecodeBytes(nil, false) } case bd == mpBin8, bd == mpBin16, bd == mpBin32: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case bd == mpArray16, bd == mpArray32, bd >= mpFixArrayMin && bd <= mpFixArrayMax: n.v = valueTypeArray decodeFurther = true @@ -692,38 +694,28 @@ func (d *msgpackDecDriver) DecodeBytes(bs []byte, zerocopy bool) (bsOut []byte) d.readNextBd() } - // check if an "array" of uint8's (see ContainerType for how to infer if an array) bd := d.bd - // DecodeBytes could be from: bin str fixstr fixarray array ... var clen int - vt := d.ContainerType() - switch vt { - case valueTypeBytes: - // valueTypeBytes may be a mpBin or an mpStr container - if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { - clen = d.readContainerLen(msgpackContainerBin) - } else { - clen = d.readContainerLen(msgpackContainerStr) - } - case valueTypeString: - clen = d.readContainerLen(msgpackContainerStr) - case valueTypeArray: + if bd == mpNil { + d.bdRead = false + return + } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + clen = d.readContainerLen(msgpackContainerBin) // binary + } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + clen = d.readContainerLen(msgpackContainerStr) // string/raw + } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { + // check if an "array" of uint8's if zerocopy && len(bs) == 0 { bs = d.d.b[:] } bsOut, _ = fastpathTV.DecSliceUint8V(bs, true, d.d) return - default: - d.d.errorf("invalid container type: expecting bin|str|array, got: 0x%x", uint8(vt)) + } else { + d.d.errorf("invalid byte descriptor for decoding bytes, got: 0x%x", d.bd) return } - // these are (bin|str)(8|16|32) d.bdRead = false - // bytes may be nil, so handle it. if nil, clen=-1. - if clen < 0 { - return nil - } if zerocopy { if d.br { return d.r.readx(uint(clen)) @@ -759,15 +751,26 @@ func (d *msgpackDecDriver) ContainerType() (vt valueType) { d.readNextBd() } bd := d.bd + // if bd == mpNil { + // // nil + // } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + // // binary + // } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + // // string/raw + // } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { + // // array + // } else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) { + // // map + // } if bd == mpNil { return valueTypeNil - } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 || - (!d.h.RawToString && - (bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax))) { + } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { return valueTypeBytes - } else if d.h.RawToString && - (bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax)) { - return valueTypeString + } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + if d.h.WriteExt { // UTF-8 string (new spec) + return valueTypeString + } + return valueTypeBytes // raw (old spec) } else if bd == mpArray16 || bd == mpArray32 || (bd >= mpFixArrayMin && bd <= mpFixArrayMax) { return valueTypeArray } else if bd == mpMap16 || bd == mpMap32 || (bd >= mpFixMapMin && bd <= mpFixMapMax) { @@ -856,15 +859,16 @@ func (d *msgpackDecDriver) DecodeTime() (t time.Time) { if !d.bdRead { d.readNextBd() } - if d.bd == mpNil { + bd := d.bd + var clen int + if bd == mpNil { d.bdRead = false return - } - var clen int - switch d.ContainerType() { - case valueTypeBytes, valueTypeString: - clen = d.readContainerLen(msgpackContainerStr) - default: + } else if bd == mpBin8 || bd == mpBin16 || bd == mpBin32 { + clen = d.readContainerLen(msgpackContainerBin) // binary + } else if bd == mpStr8 || bd == mpStr16 || bd == mpStr32 || (bd >= mpFixStrMin && bd <= mpFixStrMax) { + clen = d.readContainerLen(msgpackContainerStr) // string/raw + } else { // expect to see mpFixExt4,-1 OR mpFixExt8,-1 OR mpExt8,12,-1 d.bdRead = false b2 := d.r.readn1() @@ -875,7 +879,7 @@ func (d *msgpackDecDriver) DecodeTime() (t time.Time) { } else if d.bd == mpExt8 && b2 == 12 && d.r.readn1() == mpTimeExtTagU { clen = 12 } else { - d.d.errorf("invalid bytes for decoding time as extension: got 0x%x, 0x%x", d.bd, b2) + d.d.errorf("invalid stream for decoding time as extension: got 0x%x, 0x%x", d.bd, b2) return } } @@ -952,22 +956,21 @@ func (d *msgpackDecDriver) decodeExtV(verifyTag bool, tag byte) (xtag byte, xbs type MsgpackHandle struct { BasicHandle - // RawToString controls how raw bytes are decoded into a nil interface{}. - RawToString bool - // NoFixedNum says to output all signed integers as 2-bytes, never as 1-byte fixednum. NoFixedNum bool - // WriteExt flag supports encoding configured extensions with extension tags. - // It also controls whether other elements of the new spec are encoded (ie Str8). + // WriteExt controls whether the new spec is honored. + // + // With WriteExt=true, we can encode configured extensions with extension tags + // and encode string/[]byte/extensions in a way compatible with the new spec + // but incompatible with the old spec. // - // With WriteExt=false, configured extensions are serialized as raw bytes - // and Str8 is not encoded. + // For compatibility with the old spec, set WriteExt=false. // - // A stream can still be decoded into a typed value, provided an appropriate value - // is provided, but the type cannot be inferred from the stream. If no appropriate - // type is provided (e.g. decoding into a nil interface{}), you get back - // a []byte or string based on the setting of RawToString. + // With WriteExt=false: + // configured extensions are serialized as raw bytes (not msgpack extensions). + // reserved byte descriptors like Str8 and those enabling the new msgpack Binary type + // are not encoded. WriteExt bool // PositiveIntUnsigned says to encode positive integers as unsigned. diff --git a/vendor/github.com/ugorji/go/codec/simple.go b/vendor/github.com/ugorji/go/codec/simple.go index 464c2f99..a3257c1a 100644 --- a/vendor/github.com/ugorji/go/codec/simple.go +++ b/vendor/github.com/ugorji/go/codec/simple.go @@ -158,7 +158,7 @@ func (e *simpleEncDriver) WriteMapStart(length int) { } // func (e *simpleEncDriver) EncodeSymbol(v string) { -// e.EncodeString(cUTF8, v) +// e.EncodeStringEnc(cUTF8, v) // } func (e *simpleEncDriver) EncodeStringEnc(c charEncoding, v string) { @@ -576,8 +576,7 @@ func (d *simpleDecDriver) DecodeNaked() { n.s = d.DecodeString() case simpleVdByteArray, simpleVdByteArray + 1, simpleVdByteArray + 2, simpleVdByteArray + 3, simpleVdByteArray + 4: - n.v = valueTypeBytes - n.l = d.DecodeBytes(nil, false) + decNakedReadRawBytes(d, d.d, n, d.h.RawToString) case simpleVdExt, simpleVdExt + 1, simpleVdExt + 2, simpleVdExt + 3, simpleVdExt + 4: n.v = valueTypeExt l := d.decLen() -- cgit v1.2.3