diff --git a/go.mod b/go.mod index a5f5e66dee1..0377c21767e 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cortexproject/cortex -go 1.24.0 +go 1.25.3 require ( github.com/Masterminds/squirrel v1.5.4 @@ -13,26 +13,26 @@ require ( github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb github.com/felixge/fgprof v0.9.5 github.com/go-kit/log v0.2.1 - github.com/go-openapi/strfmt v0.24.0 + github.com/go-openapi/strfmt v0.25.0 github.com/go-openapi/swag v0.25.1 // indirect github.com/go-redis/redis/v8 v8.11.5 github.com/gogo/protobuf v1.3.2 github.com/gogo/status v1.1.1 - github.com/golang-migrate/migrate/v4 v4.18.1 + github.com/golang-migrate/migrate/v4 v4.19.1 github.com/golang/protobuf v1.5.4 github.com/golang/snappy v1.0.0 github.com/gorilla/mux v1.8.1 github.com/grafana/regexp v0.0.0-20240518133315-a468a5bfb3bc github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 - github.com/hashicorp/consul/api v1.32.0 + github.com/hashicorp/consul/api v1.33.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-metrics v0.5.4 github.com/hashicorp/go-sockaddr v1.0.7 github.com/hashicorp/memberlist v0.5.3 github.com/json-iterator/go v1.1.12 - github.com/klauspost/compress v1.18.0 + github.com/klauspost/compress v1.18.2 github.com/lib/pq v1.10.9 - github.com/minio/minio-go/v7 v7.0.93 + github.com/minio/minio-go/v7 v7.0.97 github.com/mitchellh/go-wordwrap v1.0.1 github.com/oklog/ulid v1.3.1 github.com/opentracing-contrib/go-grpc v0.1.2 @@ -42,103 +42,103 @@ require ( github.com/prometheus/alertmanager v0.29.0 github.com/prometheus/client_golang v1.23.2 github.com/prometheus/client_model v0.6.2 - github.com/prometheus/common v0.67.1 + github.com/prometheus/common v0.67.4 // Prometheus maps version 3.x.y to tags v0.30x.y. github.com/prometheus/prometheus v0.306.0 github.com/segmentio/fasthash v1.0.3 github.com/sony/gobreaker v1.0.0 - github.com/spf13/afero v1.11.0 + github.com/spf13/afero v1.15.0 github.com/stretchr/testify v1.11.1 github.com/thanos-io/objstore v0.0.0-20250722142242-922b22272ee3 github.com/thanos-io/promql-engine v0.0.0-20251117105526-bcec363c24e6 github.com/thanos-io/thanos v0.39.3-0.20250729120336-88d0ae8071cb github.com/uber/jaeger-client-go v2.30.0+incompatible github.com/weaveworks/common v0.0.0-20230728070032-dd9e68f319d5 - go.etcd.io/etcd/api/v3 v3.5.17 - go.etcd.io/etcd/client/pkg/v3 v3.5.17 - go.etcd.io/etcd/client/v3 v3.5.17 - go.opentelemetry.io/contrib/propagators/aws v1.36.0 - go.opentelemetry.io/otel v1.38.0 - go.opentelemetry.io/otel/bridge/opentracing v1.36.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 - go.opentelemetry.io/otel/sdk v1.38.0 - go.opentelemetry.io/otel/trace v1.38.0 + go.etcd.io/etcd/api/v3 v3.6.6 + go.etcd.io/etcd/client/pkg/v3 v3.6.6 + go.etcd.io/etcd/client/v3 v3.6.6 + go.opentelemetry.io/contrib/propagators/aws v1.39.0 + go.opentelemetry.io/otel v1.39.0 + go.opentelemetry.io/otel/bridge/opentracing v1.39.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 + go.opentelemetry.io/otel/sdk v1.39.0 + go.opentelemetry.io/otel/trace v1.39.0 go.uber.org/atomic v1.11.0 - golang.org/x/net v0.47.0 - golang.org/x/sync v0.18.0 - golang.org/x/time v0.12.0 - google.golang.org/grpc v1.73.0 + golang.org/x/net v0.48.0 + golang.org/x/sync v0.19.0 + golang.org/x/time v0.14.0 + google.golang.org/grpc v1.77.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 ) require ( - github.com/VictoriaMetrics/fastcache v1.12.2 - github.com/aws/aws-sdk-go-v2 v1.39.2 - github.com/aws/aws-sdk-go-v2/config v1.31.12 - github.com/aws/aws-sdk-go-v2/service/dynamodb v1.50.1 + github.com/VictoriaMetrics/fastcache v1.13.2 + github.com/aws/aws-sdk-go-v2 v1.41.0 + github.com/aws/aws-sdk-go-v2/config v1.32.5 + github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.5 github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 github.com/cespare/xxhash/v2 v2.3.0 - github.com/go-openapi/swag/jsonutils v0.25.1 + github.com/go-openapi/swag/jsonutils v0.25.4 github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 github.com/oklog/ulid/v2 v2.1.1 - github.com/parquet-go/parquet-go v0.25.1 + github.com/parquet-go/parquet-go v0.26.1 github.com/prometheus-community/parquet-common v0.0.0-20251205214622-b9865c513b71 github.com/prometheus/client_golang/exp v0.0.0-20250914183048-a974e0d45e0a - github.com/prometheus/procfs v0.16.1 + github.com/prometheus/procfs v0.19.2 github.com/sercand/kuberesolver/v5 v5.1.1 - github.com/tjhop/slog-gokit v0.1.4 - go.opentelemetry.io/collector/pdata v1.35.0 + github.com/tjhop/slog-gokit v0.1.5 + go.opentelemetry.io/collector/pdata v1.47.0 go.uber.org/automaxprocs v1.6.0 google.golang.org/protobuf v1.36.10 ) require ( - cel.dev/expr v0.23.1 // indirect - cloud.google.com/go v0.120.0 // indirect - cloud.google.com/go/auth v0.16.2 // indirect + cel.dev/expr v0.24.0 // indirect + cloud.google.com/go v0.121.6 // indirect + cloud.google.com/go/auth v0.16.4 // indirect cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect - cloud.google.com/go/compute/metadata v0.7.0 // indirect + cloud.google.com/go/compute/metadata v0.8.0 // indirect cloud.google.com/go/iam v1.5.2 // indirect cloud.google.com/go/monitoring v1.24.2 // indirect - cloud.google.com/go/storage v1.50.0 // indirect + cloud.google.com/go/storage v1.56.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.10.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.1 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.52.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect github.com/alecthomas/kingpin/v2 v2.4.0 // indirect github.com/andybalholm/brotli v1.1.1 // indirect github.com/armon/go-metrics v0.4.1 // indirect - github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.18.16 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.19.5 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.16 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 // indirect + github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 // indirect github.com/aws/aws-sdk-go-v2/service/sns v1.38.5 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.38.6 // indirect - github.com/aws/smithy-go v1.23.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.30.7 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 // indirect + github.com/aws/smithy-go v1.24.0 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/caio/go-tdigest v3.1.0+incompatible // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect - github.com/cenkalti/backoff/v5 v5.0.2 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 // indirect github.com/coder/quartz v0.2.1 // indirect - github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect github.com/coreos/go-systemd/v22 v22.6.0 // indirect github.com/cristalhq/hedgedhttp v0.9.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -155,41 +155,40 @@ require ( github.com/fsnotify/fsnotify v1.9.0 // indirect github.com/go-chi/chi/v5 v5.2.2 // indirect github.com/go-ini/ini v1.67.0 // indirect - github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/go-logfmt/logfmt v0.6.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/analysis v0.24.0 // indirect - github.com/go-openapi/errors v0.22.3 // indirect + github.com/go-openapi/errors v0.22.4 // indirect github.com/go-openapi/jsonpointer v0.22.1 // indirect github.com/go-openapi/jsonreference v0.21.2 // indirect github.com/go-openapi/loads v0.23.1 // indirect github.com/go-openapi/runtime v0.29.0 // indirect github.com/go-openapi/spec v0.22.0 // indirect github.com/go-openapi/swag/cmdutils v0.25.1 // indirect - github.com/go-openapi/swag/conv v0.25.1 // indirect + github.com/go-openapi/swag/conv v0.25.4 // indirect github.com/go-openapi/swag/fileutils v0.25.1 // indirect github.com/go-openapi/swag/jsonname v0.25.1 // indirect github.com/go-openapi/swag/loading v0.25.1 // indirect github.com/go-openapi/swag/mangling v0.25.1 // indirect github.com/go-openapi/swag/netutils v0.25.1 // indirect github.com/go-openapi/swag/stringutils v0.25.1 // indirect - github.com/go-openapi/swag/typeutils v0.25.1 // indirect + github.com/go-openapi/swag/typeutils v0.25.4 // indirect github.com/go-openapi/swag/yamlutils v0.25.1 // indirect github.com/go-openapi/validate v0.25.0 // indirect github.com/go-viper/mapstructure/v2 v2.4.0 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/goccy/go-json v0.10.5 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/googleapis v1.4.1 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect github.com/google/btree v1.1.3 // indirect github.com/google/pprof v0.0.0-20250607225305-033d6d78b36a // indirect github.com/google/s2a-go v0.1.9 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.6 // indirect - github.com/googleapis/gax-go/v2 v2.14.2 // indirect + github.com/googleapis/gax-go/v2 v2.15.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.2 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-hclog v1.6.3 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect @@ -202,7 +201,8 @@ require ( github.com/jessevdk/go-flags v1.6.1 // indirect github.com/jpillora/backoff v1.0.0 // indirect github.com/julienschmidt/httprouter v1.3.0 // indirect - github.com/klauspost/cpuid/v2 v2.2.10 // indirect + github.com/klauspost/cpuid/v2 v2.2.11 // indirect + github.com/klauspost/crc32 v1.3.0 // indirect github.com/knadh/koanf/maps v0.1.2 // indirect github.com/knadh/koanf/providers/confmap v1.0.0 // indirect github.com/knadh/koanf/v2 v2.2.1 // indirect @@ -216,22 +216,23 @@ require ( github.com/mdlayher/vsock v1.2.1 // indirect github.com/metalmatze/signal v0.0.0-20210307161603-1c9aa721a97a // indirect github.com/miekg/dns v1.1.66 // indirect - github.com/minio/crc64nvme v1.0.1 // indirect + github.com/minio/crc64nvme v1.1.0 // indirect github.com/minio/md5-simd v1.1.2 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect - github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect github.com/ncw/swift v1.0.53 // indirect github.com/oklog/run v1.2.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.129.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatautil v0.129.0 // indirect github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor v0.129.0 // indirect - github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect + github.com/parquet-go/bitpack v1.0.0 // indirect + github.com/parquet-go/jsonlite v1.0.0 // indirect + github.com/philhofer/fwd v1.2.0 // indirect github.com/pierrec/lz4/v4 v4.1.22 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect @@ -259,20 +260,20 @@ require ( github.com/weaveworks/promrus v1.2.0 // indirect github.com/xhit/go-str2duration/v2 v2.1.0 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect - go.mongodb.org/mongo-driver v1.17.4 // indirect + go.mongodb.org/mongo-driver v1.17.6 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect go.opentelemetry.io/collector/component v1.35.0 // indirect go.opentelemetry.io/collector/confmap v1.35.0 // indirect go.opentelemetry.io/collector/confmap/xconfmap v0.129.0 // indirect go.opentelemetry.io/collector/consumer v1.35.0 // indirect - go.opentelemetry.io/collector/featuregate v1.35.0 // indirect + go.opentelemetry.io/collector/featuregate v1.47.0 // indirect go.opentelemetry.io/collector/internal/telemetry v0.129.0 // indirect go.opentelemetry.io/collector/pipeline v0.129.0 // indirect go.opentelemetry.io/collector/processor v1.35.0 // indirect go.opentelemetry.io/collector/semconv v0.128.0 // indirect go.opentelemetry.io/contrib/bridges/otelzap v0.11.0 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.36.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.61.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect @@ -281,9 +282,9 @@ require ( go.opentelemetry.io/contrib/propagators/jaeger v1.36.0 // indirect go.opentelemetry.io/contrib/propagators/ot v1.36.0 // indirect go.opentelemetry.io/otel/log v0.12.2 // indirect - go.opentelemetry.io/otel/metric v1.38.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect - go.opentelemetry.io/proto/otlp v1.7.0 // indirect + go.opentelemetry.io/otel/metric v1.39.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.39.0 // indirect + go.opentelemetry.io/proto/otlp v1.9.0 // indirect go.uber.org/goleak v1.3.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect @@ -291,18 +292,18 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect go4.org/intern v0.0.0-20230525184215-6c62f75575cb // indirect go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 // indirect - golang.org/x/mod v0.29.0 // indirect - golang.org/x/oauth2 v0.31.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect - golang.org/x/tools v0.38.0 // indirect + golang.org/x/crypto v0.46.0 // indirect + golang.org/x/exp v0.0.0-20250808145144-a408d31f581a // indirect + golang.org/x/mod v0.30.0 // indirect + golang.org/x/oauth2 v0.32.0 // indirect + golang.org/x/sys v0.39.0 // indirect + golang.org/x/text v0.32.0 // indirect + golang.org/x/tools v0.39.0 // indirect gonum.org/v1/gonum v0.16.0 // indirect - google.golang.org/api v0.239.0 // indirect - google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 // indirect + google.golang.org/api v0.247.0 // indirect + google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 // indirect gopkg.in/telebot.v3 v3.3.8 // indirect k8s.io/apimachinery v0.33.1 // indirect k8s.io/client-go v0.33.1 // indirect diff --git a/go.sum b/go.sum index e8d973c9536..3f3ddd556bf 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ cel.dev/expr v0.15.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cel.dev/expr v0.16.0/go.mod h1:TRSuuV7DlVCE/uwv5QbAiW/v8l5O8C4eEPHeu7gf7Sg= cel.dev/expr v0.19.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= -cel.dev/expr v0.23.1 h1:K4KOtPCJQjVggkARsjG9RWXP6O4R73aHeJMa/dmCQQg= -cel.dev/expr v0.23.1/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= +cel.dev/expr v0.24.0 h1:56OvJKSH3hDGL0ml5uSxZmz3/3Pq4tJ+fb1unVLAFcY= +cel.dev/expr v0.24.0/go.mod h1:hLPLo1W4QUmuYdA72RBX06QTs6MXw941piREPl3Yfiw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -44,8 +44,8 @@ cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMz cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= -cloud.google.com/go v0.120.0 h1:wc6bgG9DHyKqF5/vQvX1CiZrtHnxJjBlKUyF9nP6meA= -cloud.google.com/go v0.120.0/go.mod h1:/beW32s8/pGRuj4IILWQNd4uuebeT4dkOhKmkfit64Q= +cloud.google.com/go v0.121.6 h1:waZiuajrI28iAf40cWgycWNgaXPO06dupuS+sgibK6c= +cloud.google.com/go v0.121.6/go.mod h1:coChdst4Ea5vUpiALcYKXEpR1S9ZgXbhEzzMcMR66vI= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= @@ -122,8 +122,8 @@ cloud.google.com/go/assuredworkloads v1.8.0/go.mod h1:AsX2cqyNCOvEQC8RMPnoc0yEar cloud.google.com/go/assuredworkloads v1.9.0/go.mod h1:kFuI1P78bplYtT77Tb1hi0FMxM0vVpRC7VVoJC3ZoT0= cloud.google.com/go/assuredworkloads v1.10.0/go.mod h1:kwdUQuXcedVdsIaKgKTp9t0UJkE5+PAVNhdQm4ZVq2E= cloud.google.com/go/assuredworkloads v1.11.1/go.mod h1:+F04I52Pgn5nmPG36CWFtxmav6+7Q+c5QyJoL18Lry0= -cloud.google.com/go/auth v0.16.2 h1:QvBAGFPLrDeoiNjyfVunhQ10HKNYuOwZ5noee0M5df4= -cloud.google.com/go/auth v0.16.2/go.mod h1:sRBas2Y1fB1vZTdurouM0AzuYQBMZinrUYL8EufhtEA= +cloud.google.com/go/auth v0.16.4 h1:fXOAIQmkApVvcIn7Pc2+5J8QTMVbUGLscnSVNl11su8= +cloud.google.com/go/auth v0.16.4/go.mod h1:j10ncYwjX/g3cdX7GpEzsdM+d+ZNsXAbb6qXA7p1Y5M= cloud.google.com/go/auth/oauth2adapt v0.2.8 h1:keo8NaayQZ6wimpNSmW5OPc283g65QNIiLpZnkHRbnc= cloud.google.com/go/auth/oauth2adapt v0.2.8/go.mod h1:XQ9y31RkqZCcwJWNSx2Xvric3RrU88hAYYbjDWYDL+c= cloud.google.com/go/automl v1.5.0/go.mod h1:34EjfoFGMZ5sgJ9EoLsRtdPSNZLcfflJR39VbVNS2M0= @@ -225,8 +225,8 @@ cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2Aawl cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.5.2/go.mod h1:C66sj2AluDcIqakBq/M8lw8/ybHgOZqin2obFxa/E5k= cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg= -cloud.google.com/go/compute/metadata v0.7.0 h1:PBWF+iiAerVNe8UCHxdOt6eHLVc3ydFeOCw78U8ytSU= -cloud.google.com/go/compute/metadata v0.7.0/go.mod h1:j5MvL9PprKL39t166CoB1uVHfQMs4tFQZZcKwksXUjo= +cloud.google.com/go/compute/metadata v0.8.0 h1:HxMRIbao8w17ZX6wBnjhcDkW6lTFpgcaobyVfZWqRLA= +cloud.google.com/go/compute/metadata v0.8.0/go.mod h1:sYOGTp851OV9bOFJ9CH7elVvyzopvWQFNNghtDQ/Biw= cloud.google.com/go/contactcenterinsights v1.3.0/go.mod h1:Eu2oemoePuEFc/xKFPjbTuPSj0fYJcPls9TFlPNnHHY= cloud.google.com/go/contactcenterinsights v1.4.0/go.mod h1:L2YzkGbPsv+vMQMCADxJoT9YiTTnSEd6fEvCeHTYVck= cloud.google.com/go/contactcenterinsights v1.6.0/go.mod h1:IIDlT6CLcDoyv79kDv8iWxMSTZhLxSCofVV5W6YFM/w= @@ -690,8 +690,8 @@ cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5ogcBBKhU86Y= cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= -cloud.google.com/go/storage v1.50.0 h1:3TbVkzTooBvnZsk7WaAQfOsNrdoM8QHusXA1cpk6QJs= -cloud.google.com/go/storage v1.50.0/go.mod h1:l7XeiD//vx5lfqE3RavfmU9yvk5Pp0Zhcv482poyafY= +cloud.google.com/go/storage v1.56.0 h1:iixmq2Fse2tqxMbWhLWC9HfBj1qdxqAmiK8/eqtsLxI= +cloud.google.com/go/storage v1.56.0/go.mod h1:Tpuj6t4NweCLzlNbw9Z9iwxEkrSem20AetIeH/shgVU= cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= @@ -811,12 +811,12 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.25.0/go.mod h1:obipzmGjfSjam60XLwGfqUkJsfiheAl+TUjG+4yzyPM= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0 h1:ErKg/3iS1AKcTkf3yixlZ54f9U1rljCkQyEXWUnIUxc= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.27.0/go.mod h1:yAZHSGnqScoU556rBOVkwLze6WP5N+U11RHuWaGVxwY= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0 h1:5IT7xOdq17MtcdtL/vtl6mGfzhaq4m4vpollPRmlsBQ= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.50.0/go.mod h1:ZV4VOm0/eHR06JLrXWe09068dHpr3TRpY9Uo7T+anuA= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.50.0 h1:nNMpRpnkWDAaqcpxMJvxa/Ud98gjbYwayJY4/9bdjiU= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.50.0/go.mod h1:SZiPHWGOOk3bl8tkevxkoiwPgsIl6CwrWcbwjfHZpdM= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.52.0 h1:wbMd4eG/fOhsCa6+IP8uEDvWF5vl7rNoUWmP5f72Tbs= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.52.0/go.mod h1:gdIm9TxRk5soClCwuB0FtdXsbqtw0aqPwBEurK9tPkw= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 h1:owcC2UnmsZycprQ5RfRgjydWhuoxg71LUfyiQdijZuM= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0/go.mod h1:ZPpqegjbE99EPKsu3iUWV22A04wzGPcAY/ziSIQEEgs= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.53.0 h1:4LP6hvB4I5ouTbGgWtixJhgED6xdf67twf9PoY96Tbg= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.53.0/go.mod h1:jUZ5LYlw40WMd07qxcQJD5M40aUxrfwqQX1g7zxYnrQ= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 h1:Ron4zCA/yk6U7WOBXhTJcDpsUBG9npumK6xw2auFltQ= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0/go.mod h1:cSgYe11MCNYunTnRXrKiR/tHc0eoKjICUuWpNZoVCOo= github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM= github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= @@ -824,8 +824,8 @@ github.com/Masterminds/squirrel v1.5.4 h1:uUcX/aBc8O7Fg9kaISIUsHXdKuqehiXAMQTYX8 github.com/Masterminds/squirrel v1.5.4/go.mod h1:NNaOrjSoIDfDA40n7sr2tPNZRfjzjA400rg+riTZj10= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= -github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= -github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= +github.com/VictoriaMetrics/fastcache v1.13.2 h1:2XTB49aLSuCex7e9P5rqrfQcMkzGjh5Vq3GMFa8YpCA= +github.com/VictoriaMetrics/fastcache v1.13.2/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -861,42 +861,42 @@ github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJ github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= -github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/aws/aws-sdk-go v1.55.7 h1:UJrkFq7es5CShfBwlWAC8DA077vp8PyVbQd3lqLiztE= github.com/aws/aws-sdk-go v1.55.7/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= -github.com/aws/aws-sdk-go-v2 v1.39.2 h1:EJLg8IdbzgeD7xgvZ+I8M1e0fL0ptn/M47lianzth0I= -github.com/aws/aws-sdk-go-v2 v1.39.2/go.mod h1:sDioUELIUO9Znk23YVmIk86/9DOpkbyyVb1i/gUNFXY= -github.com/aws/aws-sdk-go-v2/config v1.31.12 h1:pYM1Qgy0dKZLHX2cXslNacbcEFMkDMl+Bcj5ROuS6p8= -github.com/aws/aws-sdk-go-v2/config v1.31.12/go.mod h1:/MM0dyD7KSDPR+39p9ZNVKaHDLb9qnfDurvVS2KAhN8= -github.com/aws/aws-sdk-go-v2/credentials v1.18.16 h1:4JHirI4zp958zC026Sm+V4pSDwW4pwLefKrc0bF2lwI= -github.com/aws/aws-sdk-go-v2/credentials v1.18.16/go.mod h1:qQMtGx9OSw7ty1yLclzLxXCRbrkjWAM7JnObZjmCB7I= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9 h1:Mv4Bc0mWmv6oDuSWTKnk+wgeqPL5DRFu5bQL9BGPQ8Y= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.9/go.mod h1:IKlKfRppK2a1y0gy1yH6zD+yX5uplJ6UuPlgd48dJiQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 h1:se2vOWGD3dWQUtfn4wEjRQJb1HK1XsNIt825gskZ970= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9/go.mod h1:hijCGH2VfbZQxqCDN7bwz/4dzxV+hkyhjawAtdPWKZA= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 h1:6RBnKZLkJM4hQ+kN6E7yWFveOTg8NLPHAkqrs4ZPlTU= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9/go.mod h1:V9rQKRmK7AWuEsOMnHzKj8WyrIir1yUJbZxDuZLFvXI= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d2KyU5X/BZxjOkRo= -github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.50.1 h1:MXUnj1TKjwQvotPPHFMfynlUljcpl5UccMrkiauKdWI= -github.com/aws/aws-sdk-go-v2/service/dynamodb v1.50.1/go.mod h1:fe3UQAYwylCQRlGnihsqU/tTQkrc2nrW/IhWYwlW9vg= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.6 h1:34ojKW9OV123FZ6Q8Nua3Uwy6yVTcshZ+gLE4gpMDEs= -github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.6/go.mod h1:sXXWh1G9LKKkNbuR0f0ZPd/IvDXlMGiag40opt4XEgY= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 h1:5r34CgVOD4WZudeEKZ9/iKpiT6cM1JyEROpXjOcdWv8= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9/go.mod h1:dB12CEbNWPbzO2uC6QSWHteqOg4JfBVJOojbAoAUb5I= +github.com/aws/aws-sdk-go-v2 v1.41.0 h1:tNvqh1s+v0vFYdA1xq0aOJH+Y5cRyZ5upu6roPgPKd4= +github.com/aws/aws-sdk-go-v2 v1.41.0/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0= +github.com/aws/aws-sdk-go-v2/config v1.32.5 h1:pz3duhAfUgnxbtVhIK39PGF/AHYyrzGEyRD9Og0QrE8= +github.com/aws/aws-sdk-go-v2/config v1.32.5/go.mod h1:xmDjzSUs/d0BB7ClzYPAZMmgQdrodNjPPhd6bGASwoE= +github.com/aws/aws-sdk-go-v2/credentials v1.19.5 h1:xMo63RlqP3ZZydpJDMBsH9uJ10hgHYfQFIk1cHDXrR4= +github.com/aws/aws-sdk-go-v2/credentials v1.19.5/go.mod h1:hhbH6oRcou+LpXfA/0vPElh/e0M3aFeOblE1sssAAEk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16 h1:80+uETIWS1BqjnN9uJ0dBUaETh+P1XwFy5vwHwK5r9k= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.16/go.mod h1:wOOsYuxYuB/7FlnVtzeBYRcjSRtQpAW0hCP7tIULMwo= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16 h1:rgGwPzb82iBYSvHMHXc8h9mRoOUBZIGFgKb9qniaZZc= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.16/go.mod h1:L/UxsGeKpGoIj6DxfhOWHWQ/kGKcd4I1VncE4++IyKA= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16 h1:1jtGzuV7c82xnqOVfx2F0xmJcOw5374L7N6juGW6x6U= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.16/go.mod h1:M2E5OQf+XLe+SZGmmpaI2yy+J326aFf6/+54PoxSANc= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk= +github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.5 h1:mSBrQCXMjEvLHsYyJVbN8QQlcITXwHEuu+8mX9e2bSo= +github.com/aws/aws-sdk-go-v2/service/dynamodb v1.53.5/go.mod h1:eEuD0vTf9mIzsSjGBFWIaNQwtH5/mzViJOVQfnMY5DE= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.16 h1:8g4OLy3zfNzLV20wXmZgx+QumI9WhWHnd4GCdvETxs4= +github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery v1.11.16/go.mod h1:5a78jwLMs7BaesU0UIhLfVy2ZmOEgOy6ewYQXKTD37Q= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16 h1:oHjJHeUy0ImIV0bsrX0X91GkV5nJAyv1l1CC9lnO0TI= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.16/go.mod h1:iRSNGgOYmiYwSCXxXaKb9HfOEj40+oTKn8pTxMlYkRM= +github.com/aws/aws-sdk-go-v2/service/signin v1.0.4 h1:HpI7aMmJ+mm1wkSHIA2t5EaFFv5EFYXePW30p1EIrbQ= +github.com/aws/aws-sdk-go-v2/service/signin v1.0.4/go.mod h1:C5RdGMYGlfM0gYq/tifqgn4EbyX99V15P2V3R+VHbQU= github.com/aws/aws-sdk-go-v2/service/sns v1.38.5 h1:c0hINjMfDQvQLJJxfNNcIaLYVLC7E0W2zOQOVVKLnnU= github.com/aws/aws-sdk-go-v2/service/sns v1.38.5/go.mod h1:E427ZzdOMWh/4KtD48AGfbWLX14iyw9URVOdIwtv80o= -github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 h1:A1oRkiSQOWstGh61y4Wc/yQ04sqrQZr1Si/oAXj20/s= -github.com/aws/aws-sdk-go-v2/service/sso v1.29.6/go.mod h1:5PfYspyCU5Vw1wNPsxi15LZovOnULudOQuVxphSflQA= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 h1:5fm5RTONng73/QA73LhCNR7UT9RpFH3hR6HWL6bIgVY= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1/go.mod h1:xBEjWD13h+6nq+z4AkqSfSvqRKFgDIQeaMguAJndOWo= -github.com/aws/aws-sdk-go-v2/service/sts v1.38.6 h1:p3jIvqYwUZgu/XYeI48bJxOhvm47hZb5HUQ0tn6Q9kA= -github.com/aws/aws-sdk-go-v2/service/sts v1.38.6/go.mod h1:WtKK+ppze5yKPkZ0XwqIVWD4beCwv056ZbPQNoeHqM8= -github.com/aws/smithy-go v1.23.0 h1:8n6I3gXzWJB2DxBDnfxgBaSX6oe0d/t10qGz7OKqMCE= -github.com/aws/smithy-go v1.23.0/go.mod h1:t1ufH5HMublsJYulve2RKmHDC15xu1f26kHCp/HgceI= +github.com/aws/aws-sdk-go-v2/service/sso v1.30.7 h1:eYnlt6QxnFINKzwxP5/Ucs1vkG7VT3Iezmvfgc2waUw= +github.com/aws/aws-sdk-go-v2/service/sso v1.30.7/go.mod h1:+fWt2UHSb4kS7Pu8y+BMBvJF0EWx+4H0hzNwtDNRTrg= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12 h1:AHDr0DaHIAo8c9t1emrzAlVDFp+iMMKnPdYy6XO4MCE= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.12/go.mod h1:GQ73XawFFiWxyWXMHWfhiomvP3tXtdNar/fi8z18sx0= +github.com/aws/aws-sdk-go-v2/service/sts v1.41.5 h1:SciGFVNZ4mHdm7gpD1dgZYnCuVdX1s+lFTg4+4DOy70= +github.com/aws/aws-sdk-go-v2/service/sts v1.41.5/go.mod h1:iW40X4QBmUxdP+fZNOpfmkdMZqsovezbAeO+Ubiv2pk= +github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk= +github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0= github.com/baidubce/bce-sdk-go v0.9.230 h1:HzELBKiD7QAgYqZ1qHZexoI2A3Lo/6zYGQFvcUbS5cA= github.com/baidubce/bce-sdk-go v0.9.230/go.mod h1:zbYJMQwE4IZuyrJiFO8tO8NbtYiKTFTbwh4eIsqjVdg= github.com/bboreham/go-loser v0.0.0-20230920113527-fcc2c21820a3 h1:6df1vn4bBlDDo4tARvBm7l6KA9iVMnE3NWizDeWSrps= @@ -919,8 +919,8 @@ github.com/caio/go-tdigest v3.1.0+incompatible h1:uoVMJ3Q5lXmVLCCqaMGHLBWnbGoN6L github.com/caio/go-tdigest v3.1.0+incompatible/go.mod h1:sHQM/ubZStBUmF1WbB8FAm8q9GjDajLC5T7ydxE3JHI= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/cenkalti/backoff/v5 v5.0.2 h1:rIfFVxEf1QsI7E1ZHfp/B4DF/6QBAUhmgkxc0H7Zss8= -github.com/cenkalti/backoff/v5 v5.0.2/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw= @@ -960,8 +960,9 @@ github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= -github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= +github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.6.0 h1:aGVa/v8B7hpb0TKl0MWoAavPDmHvobFe5R5zn0bCJWo= github.com/coreos/go-systemd/v22 v22.6.0/go.mod h1:iG+pp635Fo7ZmV/j14KUcmEyWF+0X7Lua8rrTWzYgWU= @@ -983,14 +984,14 @@ github.com/dgryski/go-metro v0.0.0-20250106013310-edb8663e5e33 h1:ucRHb6/lvW/+mT github.com/dgryski/go-metro v0.0.0-20250106013310-edb8663e5e33/go.mod h1:c9O8+fpSOX1DM8cPNSkX/qsBWdkD4yd2dpciOWQjpBw= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/dhui/dktest v0.4.3 h1:wquqUxAFdcUgabAVLvSCOKOlag5cIZuaOjYIBOWdsR0= -github.com/dhui/dktest v0.4.3/go.mod h1:zNK8IwktWzQRm6I/l2Wjp7MakiyaFWv4G1hjmodmMTs= +github.com/dhui/dktest v0.4.6 h1:+DPKyScKSEp3VLtbMDHcUq6V5Lm5zfZZVb0Sk7Ahom4= +github.com/dhui/dktest v0.4.6/go.mod h1:JHTSYDtKkvFNFHJKqCzVzqXecyv+tKt8EzceOmQOgbU= github.com/digitalocean/godo v1.157.0 h1:ReELaS6FxXNf8gryUiVH0wmyUmZN8/NCmBX4gXd3F0o= github.com/digitalocean/godo v1.157.0/go.mod h1:tYeiWY5ZXVpU48YaFv0M5irUFHXGorZpDNm7zzdWMzM= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/docker v28.3.0+incompatible h1:ffS62aKWupCWdvcee7nBU9fhnmknOqDPaJAMtfK0ImQ= -github.com/docker/docker v28.3.0+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI= +github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= @@ -1076,8 +1077,8 @@ github.com/go-latex/latex v0.0.0-20210823091927-c0d11ff05a81/go.mod h1:SX0U8uGpx github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= -github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/go-logfmt/logfmt v0.6.1 h1:4hvbpePJKnIzH1B+8OR/JPbTx37NktoI9LE2QZBBkvE= +github.com/go-logfmt/logfmt v0.6.1/go.mod h1:EV2pOAQoZaT1ZXZbqDl5hrymndi4SY9ED9/z6CO0XAk= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= @@ -1086,8 +1087,8 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/analysis v0.24.0 h1:vE/VFFkICKyYuTWYnplQ+aVr45vlG6NcZKC7BdIXhsA= github.com/go-openapi/analysis v0.24.0/go.mod h1:GLyoJA+bvmGGaHgpfeDh8ldpGo69fAJg7eeMDMRCIrw= -github.com/go-openapi/errors v0.22.3 h1:k6Hxa5Jg1TUyZnOwV2Lh81j8ayNw5VVYLvKrp4zFKFs= -github.com/go-openapi/errors v0.22.3/go.mod h1:+WvbaBBULWCOna//9B9TbLNGSFOfF8lY9dw4hGiEiKQ= +github.com/go-openapi/errors v0.22.4 h1:oi2K9mHTOb5DPW2Zjdzs/NIvwi2N3fARKaTJLdNabaM= +github.com/go-openapi/errors v0.22.4/go.mod h1:z9S8ASTUqx7+CP1Q8dD8ewGH/1JWFFLX/2PmAYNQLgk= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.22.1 h1:sHYI1He3b9NqJ4wXLoJDKmUmHkWy/L7rtEo92JUxBNk= @@ -1101,24 +1102,24 @@ github.com/go-openapi/runtime v0.29.0 h1:Y7iDTFarS9XaFQ+fA+lBLngMwH6nYfqig1G+pHx github.com/go-openapi/runtime v0.29.0/go.mod h1:52HOkEmLL/fE4Pg3Kf9nxc9fYQn0UsIWyGjGIJE9dkg= github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jIQ= github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/strfmt v0.24.0 h1:dDsopqbI3wrrlIzeXRbqMihRNnjzGC+ez4NQaAAJLuc= -github.com/go-openapi/strfmt v0.24.0/go.mod h1:Lnn1Bk9rZjXxU9VMADbEEOo7D7CDyKGLsSKekhFr7s4= +github.com/go-openapi/strfmt v0.25.0 h1:7R0RX7mbKLa9EYCTHRcCuIPcaqlyQiWNPTXwClK0saQ= +github.com/go-openapi/strfmt v0.25.0/go.mod h1:nNXct7OzbwrMY9+5tLX4I21pzcmE6ccMGXl3jFdPfn8= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.25.1 h1:6uwVsx+/OuvFVPqfQmOOPsqTcm5/GkBhNwLqIR916n8= github.com/go-openapi/swag v0.25.1/go.mod h1:bzONdGlT0fkStgGPd3bhZf1MnuPkf2YAys6h+jZipOo= github.com/go-openapi/swag/cmdutils v0.25.1 h1:nDke3nAFDArAa631aitksFGj2omusks88GF1VwdYqPY= github.com/go-openapi/swag/cmdutils v0.25.1/go.mod h1:pdae/AFo6WxLl5L0rq87eRzVPm/XRHM3MoYgRMvG4A0= -github.com/go-openapi/swag/conv v0.25.1 h1:+9o8YUg6QuqqBM5X6rYL/p1dpWeZRhoIt9x7CCP+he0= -github.com/go-openapi/swag/conv v0.25.1/go.mod h1:Z1mFEGPfyIKPu0806khI3zF+/EUXde+fdeksUl2NiDs= +github.com/go-openapi/swag/conv v0.25.4 h1:/Dd7p0LZXczgUcC/Ikm1+YqVzkEeCc9LnOWjfkpkfe4= +github.com/go-openapi/swag/conv v0.25.4/go.mod h1:3LXfie/lwoAv0NHoEuY1hjoFAYkvlqI/Bn5EQDD3PPU= github.com/go-openapi/swag/fileutils v0.25.1 h1:rSRXapjQequt7kqalKXdcpIegIShhTPXx7yw0kek2uU= github.com/go-openapi/swag/fileutils v0.25.1/go.mod h1:+NXtt5xNZZqmpIpjqcujqojGFek9/w55b3ecmOdtg8M= github.com/go-openapi/swag/jsonname v0.25.1 h1:Sgx+qbwa4ej6AomWC6pEfXrA6uP2RkaNjA9BR8a1RJU= github.com/go-openapi/swag/jsonname v0.25.1/go.mod h1:71Tekow6UOLBD3wS7XhdT98g5J5GR13NOTQ9/6Q11Zo= -github.com/go-openapi/swag/jsonutils v0.25.1 h1:AihLHaD0brrkJoMqEZOBNzTLnk81Kg9cWr+SPtxtgl8= -github.com/go-openapi/swag/jsonutils v0.25.1/go.mod h1:JpEkAjxQXpiaHmRO04N1zE4qbUEg3b7Udll7AMGTNOo= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.1 h1:DSQGcdB6G0N9c/KhtpYc71PzzGEIc/fZ1no35x4/XBY= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.1/go.mod h1:kjmweouyPwRUEYMSrbAidoLMGeJ5p6zdHi9BgZiqmsg= +github.com/go-openapi/swag/jsonutils v0.25.4 h1:VSchfbGhD4UTf4vCdR2F4TLBdLwHyUDTd1/q4i+jGZA= +github.com/go-openapi/swag/jsonutils v0.25.4/go.mod h1:7OYGXpvVFPn4PpaSdPHJBtF0iGnbEaTk8AvBkoWnaAY= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4 h1:IACsSvBhiNJwlDix7wq39SS2Fh7lUOCJRmx/4SN4sVo= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.25.4/go.mod h1:Mt0Ost9l3cUzVv4OEZG+WSeoHwjWLnarzMePNDAOBiM= github.com/go-openapi/swag/loading v0.25.1 h1:6OruqzjWoJyanZOim58iG2vj934TysYVptyaoXS24kw= github.com/go-openapi/swag/loading v0.25.1/go.mod h1:xoIe2EG32NOYYbqxvXgPzne989bWvSNoWoyQVWEZicc= github.com/go-openapi/swag/mangling v0.25.1 h1:XzILnLzhZPZNtmxKaz/2xIGPQsBsvmCjrJOWGNz/ync= @@ -1127,10 +1128,14 @@ github.com/go-openapi/swag/netutils v0.25.1 h1:2wFLYahe40tDUHfKT1GRC4rfa5T1B4GWZ github.com/go-openapi/swag/netutils v0.25.1/go.mod h1:CAkkvqnUJX8NV96tNhEQvKz8SQo2KF0f7LleiJwIeRE= github.com/go-openapi/swag/stringutils v0.25.1 h1:Xasqgjvk30eUe8VKdmyzKtjkVjeiXx1Iz0zDfMNpPbw= github.com/go-openapi/swag/stringutils v0.25.1/go.mod h1:JLdSAq5169HaiDUbTvArA2yQxmgn4D6h4A+4HqVvAYg= -github.com/go-openapi/swag/typeutils v0.25.1 h1:rD/9HsEQieewNt6/k+JBwkxuAHktFtH3I3ysiFZqukA= -github.com/go-openapi/swag/typeutils v0.25.1/go.mod h1:9McMC/oCdS4BKwk2shEB7x17P6HmMmA6dQRtAkSnNb8= +github.com/go-openapi/swag/typeutils v0.25.4 h1:1/fbZOUN472NTc39zpa+YGHn3jzHWhv42wAJSN91wRw= +github.com/go-openapi/swag/typeutils v0.25.4/go.mod h1:Ou7g//Wx8tTLS9vG0UmzfCsjZjKhpjxayRKTHXf2pTE= github.com/go-openapi/swag/yamlutils v0.25.1 h1:mry5ez8joJwzvMbaTGLhw8pXUnhDK91oSJLDPF1bmGk= github.com/go-openapi/swag/yamlutils v0.25.1/go.mod h1:cm9ywbzncy3y6uPm/97ysW8+wZ09qsks+9RS8fLWKqg= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2 h1:0+Y41Pz1NkbTHz8NngxTuAXxEodtNSI1WG1c/m5Akw4= +github.com/go-openapi/testify/enable/yaml/v2 v2.0.2/go.mod h1:kme83333GCtJQHXQ8UKX3IBZu6z8T5Dvy5+CW3NLUUg= +github.com/go-openapi/testify/v2 v2.0.2 h1:X999g3jeLcoY8qctY/c/Z8iBHTbwLz7R2WXd6Ub6wls= +github.com/go-openapi/testify/v2 v2.0.2/go.mod h1:HCPmvFFnheKK2BuwSA0TbbdxJ3I16pjwMkYkP4Ywn54= github.com/go-openapi/validate v0.25.0 h1:JD9eGX81hDTjoY3WOzh6WqxVBVl7xjsLnvDo1GL5WPU= github.com/go-openapi/validate v0.25.0/go.mod h1:SUY7vKrN5FiwK6LyvSwKjDfLNirSfWwHNgxd2l29Mmw= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= @@ -1154,8 +1159,6 @@ github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u1 github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= -github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4= -github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= @@ -1170,10 +1173,10 @@ github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/gogo/status v1.1.1 h1:DuHXlSFHNKqTQ+/ACf5Vs6r4X/dH2EgIzR9Vr+H65kg= github.com/gogo/status v1.1.1/go.mod h1:jpG3dM5QPcqu19Hg8lkUhBFBa3TcLs1DG7+2Jqci7oU= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang-migrate/migrate/v4 v4.18.1 h1:JML/k+t4tpHCpQTCAD62Nu43NUFzHY4CV3uAuvHGC+Y= -github.com/golang-migrate/migrate/v4 v4.18.1/go.mod h1:HAX6m3sQgcdO81tdjn5exv20+3Kb13cmGli1hrD6hks= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang-migrate/migrate/v4 v4.19.1 h1:OCyb44lFuQfYXYLx1SCxPZQGU7mcaZ7gH9yH4jSFbBA= +github.com/golang-migrate/migrate/v4 v4.19.1/go.mod h1:CTcgfjxhaUtsLipnLoQRWCrjYXycRz/g5+RWDuYgPrE= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= @@ -1302,8 +1305,8 @@ github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38 github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= github.com/googleapis/gax-go/v2 v2.10.0/go.mod h1:4UOEnMCrxsSqQ940WnTiD6qJ63le2ev3xfyagutxiPw= github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/gax-go/v2 v2.14.2 h1:eBLnkZ9635krYIPD+ag1USrOAI0Nr0QYF3+/3GqO0k0= -github.com/googleapis/gax-go/v2 v2.14.2/go.mod h1:ON64QhlJkhVtSqp4v1uaK92VyZ2gmvDQsweuyLV+8+w= +github.com/googleapis/gax-go/v2 v2.15.0 h1:SyjDc1mGgZU5LncH8gimWo9lW1DtIfPibOG81vgd/bo= +github.com/googleapis/gax-go/v2 v2.15.0/go.mod h1:zVVkkxAQHa1RQpg9z2AUCMnKhi0Qld9rcmyfL1OZhoc= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gophercloud/gophercloud/v2 v2.7.0 h1:o0m4kgVcPgHlcXiWAjoVxGd8QCmvM5VU+YM71pFbn0E= @@ -1325,14 +1328,14 @@ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFb github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w= github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 h1:5ZPtiqj0JL5oKWmcsq4VMaAW5ukBEgSGXEN89zeH1Jo= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3/go.mod h1:ndYquD05frm2vACXE1nsccT4oJzjhw2arTS2cpUD1PI= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 h1:NmZ1PKzSTQbuGHw9DGPFomqkkLWMC+vZCkfs+FHv1Vg= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3/go.mod h1:zQrxl1YP88HQlA6i9c63DSVPFklWpGX4OWAc9bFuaH4= github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= -github.com/hashicorp/consul/api v1.32.0 h1:5wp5u780Gri7c4OedGEPzmlUEzi0g2KyiPphSr6zjVg= -github.com/hashicorp/consul/api v1.32.0/go.mod h1:Z8YgY0eVPukT/17ejW+l+C7zJmKwgPHtjU1q16v/Y40= +github.com/hashicorp/consul/api v1.33.0 h1:MnFUzN1Bo6YDGi/EsRLbVNgA4pyCymmcswrE5j4OHBM= +github.com/hashicorp/consul/api v1.33.0/go.mod h1:vLz2I/bqqCYiG0qRHGerComvbwSWKswc8rRFtnYBrIw= github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= -github.com/hashicorp/consul/sdk v0.16.1 h1:V8TxTnImoPD5cj0U9Spl0TUxcytjcbbJeADFF07KdHg= -github.com/hashicorp/consul/sdk v0.16.1/go.mod h1:fSXvwxB2hmh1FMZCNl6PwX0Q/1wdWtHJcZ7Ea5tns0s= +github.com/hashicorp/consul/sdk v0.17.0 h1:N/JigV6y1yEMfTIhXoW0DXUecM2grQnFuRpY7PcLHLI= +github.com/hashicorp/consul/sdk v0.17.0/go.mod h1:8dgIhY6VlPUprRH7o7UenVuFEgq017qUn3k9wS5mCt4= github.com/hashicorp/cronexpr v1.1.2 h1:wG/ZYIKT+RT3QkOdgYc+xsKWVRgnxJ1OJtjjy84fJ9A= github.com/hashicorp/cronexpr v1.1.2/go.mod h1:P4wA0KBl9C5q2hABiMO7cp6jcIg96CDh1Efb3g1PWA4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -1429,12 +1432,14 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/asmfmt v1.3.2/go.mod h1:AG8TuvYojzulgDAMCnYn50l/5QV3Bs/tp6j0HLHbNSE= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.2 h1:iiPHWW0YrcFgpBYhsA6D1+fqHssJscY/Tm/y2Uqnapk= +github.com/klauspost/compress v1.18.2/go.mod h1:R0h/fSBs8DE4ENlcrlib3PsXS61voFxhIs2DeRhCvJ4= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= -github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= -github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/cpuid/v2 v2.2.11 h1:0OwqZRYI2rFrjS4kvkDnqJkKHdHaRnCm68/DY4OxRzU= +github.com/klauspost/cpuid/v2 v2.2.11/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= +github.com/klauspost/crc32 v1.3.0 h1:sSmTt3gUt81RP655XGZPElI0PelVTZ6YwCRnPSupoFM= +github.com/klauspost/crc32 v1.3.0/go.mod h1:D7kQaZhnkX/Y0tstFGf8VUzv2UofNGqCjnC3zdHB0Hw= github.com/knadh/koanf/maps v0.1.2 h1:RBfmAW5CnZT+PJ1CVc1QSJKf4Xu9kxfQgYVQSu8hpbo= github.com/knadh/koanf/maps v0.1.2/go.mod h1:npD/QZY3V6ghQDdcQzl1W4ICNVTkohC8E73eI2xW4yI= github.com/knadh/koanf/providers/confmap v1.0.0 h1:mHKLJTE7iXEys6deO5p6olAiZdG5zwp8Aebir+/EaRE= @@ -1518,12 +1523,12 @@ github.com/miekg/dns v1.1.66 h1:FeZXOS3VCVsKnEAd+wBkjMC3D2K+ww66Cq3VnCINuJE= github.com/miekg/dns v1.1.66/go.mod h1:jGFzBsSNbJw6z1HYut1RKBKHA9PBdxeHrZG8J+gC2WE= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= -github.com/minio/crc64nvme v1.0.1 h1:DHQPrYPdqK7jQG/Ls5CTBZWeex/2FMS3G5XGkycuFrY= -github.com/minio/crc64nvme v1.0.1/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= +github.com/minio/crc64nvme v1.1.0 h1:e/tAguZ+4cw32D+IO/8GSf5UVr9y+3eJcxZI2WOO/7Q= +github.com/minio/crc64nvme v1.1.0/go.mod h1:eVfm2fAzLlxMdUGc0EEBGSMmPwmXD5XiNRpnu9J3bvg= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.93 h1:lAB4QJp8Nq3vDMOU0eKgMuyBiEGMNlXQ5Glc8qAxqSU= -github.com/minio/minio-go/v7 v7.0.93/go.mod h1:71t2CqDt3ThzESgZUlU1rBN54mksGGlkLcFgguDnnAc= +github.com/minio/minio-go/v7 v7.0.97 h1:lqhREPyfgHTB/ciX8k2r8k0D93WaFqxbJX36UZq5occ= +github.com/minio/minio-go/v7 v7.0.97/go.mod h1:re5VXuo0pwEtoNLsNuSr0RrLfT/MBtohwdaSmPPSRSk= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= @@ -1550,8 +1555,9 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee h1:W5t00kpgFdJifH4BDsTlE89Zl93FEloxaWZfGcifgq8= +github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mozillazg/go-httpheader v0.4.0 h1:aBn6aRXtFzyDLZ4VIRLsZbbJloagQfMnCiYgOq6hK4w= @@ -1590,6 +1596,8 @@ github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQ github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/opentracing-contrib/go-grpc v0.1.2 h1:MP16Ozc59kqqwn1v18aQxpeGZhsBanJ2iurZYaQSZ+g= github.com/opentracing-contrib/go-grpc v0.1.2/go.mod h1:glU6rl1Fhfp9aXUHkE36K2mR4ht8vih0ekOVlWKEUHM= +github.com/opentracing-contrib/go-grpc/test v0.0.0-20250917164221-a6e64aab787c h1:1l8TtIT2NrMOvowf0E0oYTFE1c8zuXRqtncYkxNQ+gs= +github.com/opentracing-contrib/go-grpc/test v0.0.0-20250917164221-a6e64aab787c/go.mod h1:bROL6bo5GkaoSOYWcRXMAUwNM2c5jA1sTEgb2137qAU= github.com/opentracing-contrib/go-stdlib v1.1.0 h1:cZBWc4pA4e65tqTJddbflK435S0tDImj6c9BMvkdUH0= github.com/opentracing-contrib/go-stdlib v1.1.0/go.mod h1:S0p+X9p6dcBkoMTL+Qq2VOvxKs9ys5PpYWXWqlCS0bQ= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= @@ -1600,16 +1608,20 @@ github.com/oracle/oci-go-sdk/v65 v65.93.1/go.mod h1:u6XRPsw9tPziBh76K7GrrRXPa8P8 github.com/orisano/pixelmatch v0.0.0-20220722002657-fb0b55479cde/go.mod h1:nZgzbfBr3hhjoZnS66nKrHmduYNpc34ny7RK4z5/HM0= github.com/ovh/go-ovh v1.9.0 h1:6K8VoL3BYjVV3In9tPJUdT7qMx9h0GExN9EXx1r2kKE= github.com/ovh/go-ovh v1.9.0/go.mod h1:cTVDnl94z4tl8pP1uZ/8jlVxntjSIf09bNcQ5TJSC7c= -github.com/parquet-go/parquet-go v0.25.1 h1:l7jJwNM0xrk0cnIIptWMtnSnuxRkwq53S+Po3KG8Xgo= -github.com/parquet-go/parquet-go v0.25.1/go.mod h1:AXBuotO1XiBtcqJb/FKFyjBG4aqa3aQAAWF3ZPzCanY= +github.com/parquet-go/bitpack v1.0.0 h1:AUqzlKzPPXf2bCdjfj4sTeacrUwsT7NlcYDMUQxPcQA= +github.com/parquet-go/bitpack v1.0.0/go.mod h1:XnVk9TH+O40eOOmvpAVZ7K2ocQFrQwysLMnc6M/8lgs= +github.com/parquet-go/jsonlite v1.0.0 h1:87QNdi56wOfsE5bdgas0vRzHPxfJgzrXGml1zZdd7VU= +github.com/parquet-go/jsonlite v1.0.0/go.mod h1:nDjpkpL4EOtqs6NQugUsi0Rleq9sW/OtC1NnZEnxzF0= +github.com/parquet-go/parquet-go v0.26.1 h1:HXnsqRfga5d+rbliKOGWKGeCMRNNBE9o28tE0TVhC6A= +github.com/parquet-go/parquet-go v0.26.1/go.mod h1:h9GcSt41Knf5qXI1tp1TfR8bDBUtvdUMzSKe26aZcHk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pelletier/go-toml/v2 v2.0.5/go.mod h1:OMHamSCAODeSsVrwwvcJOaoN0LIUIaFVNZzmWyNfXas= -github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c h1:dAMKvw0MlJT1GshSTtih8C2gDs04w8dReiOGXrGLNoY= -github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= +github.com/philhofer/fwd v1.2.0 h1:e6DnBTl7vGY+Gz322/ASL4Gyp1FspeMvx1RNDoToZuM= +github.com/philhofer/fwd v1.2.0/go.mod h1:RqIHx9QI14HlwKwm98g9Re5prTQ6LdeRQn+gXJFxsJM= github.com/phpdave11/gofpdf v1.4.2/go.mod h1:zpO6xFn9yxo3YLyMvW8HcKWVdbNqgIfOOp2dXMnm1mY= github.com/phpdave11/gofpdi v1.0.12/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= github.com/phpdave11/gofpdi v1.0.13/go.mod h1:vBmVV0Do6hSBHC8uKUQ71JGW+ZGQq74llk/7bXwjDoI= @@ -1663,8 +1675,8 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= -github.com/prometheus/common v0.67.1 h1:OTSON1P4DNxzTg4hmKCc37o4ZAZDv0cfXLkOt0oEowI= -github.com/prometheus/common v0.67.1/go.mod h1:RpmT9v35q2Y+lsieQsdOh5sXZ6ajUGC8NjZAmr8vb0Q= +github.com/prometheus/common v0.67.4 h1:yR3NqWO1/UyO1w2PhUvXlGQs/PtFmoveVO0KZ4+Lvsc= +github.com/prometheus/common v0.67.4/go.mod h1:gP0fq6YjjNCLssJCQp0yk4M8W6ikLURwkdd/YKtTbyI= github.com/prometheus/exporter-toolkit v0.14.1 h1:uKPE4ewweVRWFainwvAcHs3uw15pjw2dk3I7b+aNo9o= github.com/prometheus/exporter-toolkit v0.14.1/go.mod h1:di7yaAJiaMkcjcz48f/u4yRPwtyuxTU5Jr4EnM2mhtQ= github.com/prometheus/otlptranslator v0.0.0-20250620074007-94f535e0c588 h1:QlySqDdSESgWDePeAYskbbcKKdowI26m9aU9zloHyYE= @@ -1674,8 +1686,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.16.1 h1:hZ15bTNuirocR6u0JZ6BAHHmwS1p8B4P6MRqxtzMyRg= -github.com/prometheus/procfs v0.16.1/go.mod h1:teAbpZRB1iIAJYREa1LsoWUXykVXA1KlTmWl8x/U+Is= +github.com/prometheus/procfs v0.19.2 h1:zUMhqEW66Ex7OXIiDkll3tl9a1ZdilUOd/F6ZXw4Vws= +github.com/prometheus/procfs v0.19.2/go.mod h1:M0aotyiemPhBCM0z5w87kL22CxfcH05ZpYlu+b4J7mw= github.com/prometheus/prometheus v0.306.0 h1:Q0Pvz/ZKS6vVWCa1VSgNyNJlEe8hxdRlKklFg7SRhNw= github.com/prometheus/prometheus v0.306.0/go.mod h1:7hMSGyZHt0dcmZ5r4kFPJ/vxPQU99N5/BGwSPDxeZrQ= github.com/prometheus/sigv4 v0.2.1 h1:hl8D3+QEzU9rRmbKIRwMKRwaFGyLkbPdH5ZerglRHY0= @@ -1735,8 +1747,8 @@ github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z github.com/spf13/afero v1.8.2/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/afero v1.9.2/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= -github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/afero v1.15.0 h1:b/YBCLWAJdFWJTN9cLhiXXcD7mzKn9Dm86dNnfyQw1I= +github.com/spf13/afero v1.15.0/go.mod h1:NC2ByUVxtQs4b3sIUphxK0NioZnmxgyCrfzeuq8lxMg= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -1780,8 +1792,8 @@ github.com/thanos-io/thanos v0.39.3-0.20250729120336-88d0ae8071cb h1:z/ePbn3lo/D github.com/thanos-io/thanos v0.39.3-0.20250729120336-88d0ae8071cb/go.mod h1:gGUG3TDEoRSjTFVs/QO6QnQIILRgNF0P9l7BiiMfmHw= github.com/tinylib/msgp v1.3.0 h1:ULuf7GPooDaIlbyvgAxBV/FI7ynli6LZ1/nVUNu+0ww= github.com/tinylib/msgp v1.3.0/go.mod h1:ykjzy2wzgrlvpDCRc4LA8UXy6D8bzMSuAF3WD57Gok0= -github.com/tjhop/slog-gokit v0.1.4 h1:uj/vbDt3HaF0Py8bHPV4ti/s0utnO0miRbO277FLBKM= -github.com/tjhop/slog-gokit v0.1.4/go.mod h1:Bbu5v2748qpAWH7k6gse/kw3076IJf6owJmh7yArmJs= +github.com/tjhop/slog-gokit v0.1.5 h1:ayloIUi5EK2QYB8eY4DOPO95/mRtMW42lUkp3quJohc= +github.com/tjhop/slog-gokit v0.1.5/go.mod h1:yA48zAHvV+Sg4z4VRyeFyFUNNXd3JY5Zg84u3USICq0= github.com/trivago/tgo v1.0.7 h1:uaWH/XIy9aWYWpjm2CU3RpcqZXmX2ysQ9/Go+d9gyrM= github.com/trivago/tgo v1.0.7/go.mod h1:w4dpD+3tzNIIiIfkWWa85w5/B77tlvdZckQ+6PkFnhc= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= @@ -1813,17 +1825,17 @@ github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7 github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= -go.etcd.io/etcd/api/v3 v3.5.17 h1:cQB8eb8bxwuxOilBpMJAEo8fAONyrdXTHUNcMd8yT1w= -go.etcd.io/etcd/api/v3 v3.5.17/go.mod h1:d1hvkRuXkts6PmaYk2Vrgqbv7H4ADfAKhyJqHNLJCB4= +go.etcd.io/etcd/api/v3 v3.6.6 h1:mcaMp3+7JawWv69p6QShYWS8cIWUOl32bFLb6qf8pOQ= +go.etcd.io/etcd/api/v3 v3.6.6/go.mod h1:f/om26iXl2wSkcTA1zGQv8reJRSLVdoEBsi4JdfMrx4= go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= -go.etcd.io/etcd/client/pkg/v3 v3.5.17 h1:XxnDXAWq2pnxqx76ljWwiQ9jylbpC4rvkAeRVOUKKVw= -go.etcd.io/etcd/client/pkg/v3 v3.5.17/go.mod h1:4DqK1TKacp/86nJk4FLQqo6Mn2vvQFBmruW3pP14H/w= +go.etcd.io/etcd/client/pkg/v3 v3.6.6 h1:uoqgzSOv2H9KlIF5O1Lsd8sW+eMLuV6wzE3q5GJGQNs= +go.etcd.io/etcd/client/pkg/v3 v3.6.6/go.mod h1:YngfUVmvsvOJ2rRgStIyHsKtOt9SZI2aBJrZiWJhCbI= go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -go.etcd.io/etcd/client/v3 v3.5.17 h1:o48sINNeWz5+pjy/Z0+HKpj/xSnBkuVhVvXkjEXbqZY= -go.etcd.io/etcd/client/v3 v3.5.17/go.mod h1:j2d4eXTHWkT2ClBgnnEPm/Wuu7jsqku41v9DZ3OtjQo= -go.mongodb.org/mongo-driver v1.17.4 h1:jUorfmVzljjr0FLzYQsGP8cgN/qzzxlY9Vh0C9KFXVw= -go.mongodb.org/mongo-driver v1.17.4/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= +go.etcd.io/etcd/client/v3 v3.6.6 h1:G5z1wMf5B9SNexoxOHUGBaULurOZPIgGPsW6CN492ec= +go.etcd.io/etcd/client/v3 v3.6.6/go.mod h1:36Qv6baQ07znPR3+n7t+Rk5VHEzVYPvFfGmfF4wBHV8= +go.mongodb.org/mongo-driver v1.17.6 h1:87JUG1wZfWsr6rIz3ZmpH90rL5tea7O3IHuSwHUpsss= +go.mongodb.org/mongo-driver v1.17.6/go.mod h1:Hy04i7O2kC4RS06ZrhPRqj/u4DTYkFDAAccj+rVKqgQ= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -1852,12 +1864,14 @@ go.opentelemetry.io/collector/consumer/consumertest v0.129.0 h1:kRmrAgVvPxH5c/rT go.opentelemetry.io/collector/consumer/consumertest v0.129.0/go.mod h1:JgJKms1+v/CuAjkPH+ceTnKeDgUUGTQV4snGu5wTEHY= go.opentelemetry.io/collector/consumer/xconsumer v0.129.0 h1:bRyJ9TGWwnrUnB5oQGTjPhxpVRbkIVeugmvks22bJ4A= go.opentelemetry.io/collector/consumer/xconsumer v0.129.0/go.mod h1:pbe5ZyPJrtzdt/RRI0LqfT1GVBiJLbtkDKx3SBRTiTY= -go.opentelemetry.io/collector/featuregate v1.35.0 h1:c/XRtA35odgxVc4VgOF/PTIk7ajw1wYdQ6QI562gzd4= -go.opentelemetry.io/collector/featuregate v1.35.0/go.mod h1:Y/KsHbvREENKvvN9RlpiWk/IGBK+CATBYzIIpU7nccc= +go.opentelemetry.io/collector/featuregate v1.47.0 h1:LuJnDngViDzPKds5QOGxVYNL1QCCVWN/m61lHTV8Pf4= +go.opentelemetry.io/collector/featuregate v1.47.0/go.mod h1:d0tiRzVYrytB6LkcYgz2ESFTv7OktRPQe0QEQcPt1L4= go.opentelemetry.io/collector/internal/telemetry v0.129.0 h1:jkzRpIyMxMGdAzVOcBe8aRNrbP7eUrMq6cxEHe0sbzA= go.opentelemetry.io/collector/internal/telemetry v0.129.0/go.mod h1:riAPlR2LZBV7VEx4LicOKebg3N1Ja3izzkv5fl1Lhiw= -go.opentelemetry.io/collector/pdata v1.35.0 h1:ck6WO6hCNjepADY/p9sT9/rLECTLO5ukYTumKzsqB/E= -go.opentelemetry.io/collector/pdata v1.35.0/go.mod h1:pttpb089864qG1k0DMeXLgwwTFLk+o3fAW9I6MF9tzw= +go.opentelemetry.io/collector/internal/testutil v0.141.0 h1:/rUGApojPtUPMN3rFfApNgEjAt03rCGt2qxNxGGs/4A= +go.opentelemetry.io/collector/internal/testutil v0.141.0/go.mod h1:YAD9EAkwh/l5asZNbEBEUCqEjoL1OKMjAMoPjPqH76c= +go.opentelemetry.io/collector/pdata v1.47.0 h1:4Mk0mo2RlKCUPomV8ISm+Yx/STFtuSn88yjiCePHkGA= +go.opentelemetry.io/collector/pdata v1.47.0/go.mod h1:yMdjdWZBNA8wLFCQXOCLb0RfcpZOxp7exH+bN7udWO0= go.opentelemetry.io/collector/pdata/pprofile v0.129.0 h1:DgZTvjOGmyZRx7Or80hz8XbEaGwHPkIh2SX1A5eXttQ= go.opentelemetry.io/collector/pdata/pprofile v0.129.0/go.mod h1:uUBZxqJNOk6QIMvbx30qom//uD4hXJ1K/l3qysijMLE= go.opentelemetry.io/collector/pdata/testdata v0.129.0 h1:n1QLnLOtrcAR57oMSVzmtPsQEpCc/nE5Avk1xfuAkjY= @@ -1875,8 +1889,8 @@ go.opentelemetry.io/collector/semconv v0.128.0/go.mod h1:OPXer4l43X23cnjLXIZnRj/ go.opentelemetry.io/contrib/bridges/otelzap v0.11.0 h1:u2E32P7j1a/gRgZDWhIXC+Shd4rLg70mnE7QLI/Ssnw= go.opentelemetry.io/contrib/bridges/otelzap v0.11.0/go.mod h1:pJPCLM8gzX4ASqLlyAXjHBEYxgbOQJ/9bidWxD6PEPQ= go.opentelemetry.io/contrib/detectors/gcp v1.34.0/go.mod h1:cV4BMFcscUR/ckqLkbfQmF0PRsq8w/lMGzdbCSveBHo= -go.opentelemetry.io/contrib/detectors/gcp v1.35.0 h1:bGvFt68+KTiAKFlacHW6AhA56GF2rS0bdD3aJYEnmzA= -go.opentelemetry.io/contrib/detectors/gcp v1.35.0/go.mod h1:qGWP8/+ILwMRIUf9uIVLloR1uo5ZYAslM4O6OqUi1DA= +go.opentelemetry.io/contrib/detectors/gcp v1.36.0 h1:F7q2tNlCaHY9nMKHR6XH9/qkp8FktLnIcy6jJNyOCQw= +go.opentelemetry.io/contrib/detectors/gcp v1.36.0/go.mod h1:IbBN8uAIIx734PTonTPxAxnjc2pQTxWNkwfstZ+6H2k= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.61.0 h1:lREC4C0ilyP4WibDhQ7Gg2ygAQFP8oR07Fst/5cafwI= @@ -1885,8 +1899,8 @@ go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6h go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= go.opentelemetry.io/contrib/propagators/autoprop v0.61.0 h1:cxOVDJ30qfzV27G5p9WMtJUB/3cXC0iL+u9EV1fSOws= go.opentelemetry.io/contrib/propagators/autoprop v0.61.0/go.mod h1:Y+xiUbWetg65vAroDZcIzJ5wyPNWRH32EoIV9rIaa0g= -go.opentelemetry.io/contrib/propagators/aws v1.36.0 h1:Txhy/1LZIbbnutftc5pdU8Y9vOQuAkuIOFXuLsdDejs= -go.opentelemetry.io/contrib/propagators/aws v1.36.0/go.mod h1:M3A0491jGFPNHU8b3zEW7r/gtsMpGOsFUO3WL+SZ1xw= +go.opentelemetry.io/contrib/propagators/aws v1.39.0 h1:IvNR8pAVGpkK1CHMjU/YE6B6TlnAPGFvogkMWRWU6wo= +go.opentelemetry.io/contrib/propagators/aws v1.39.0/go.mod h1:TUsFCERuGM4IGhJG9w+9l0nzmHUKHuaDYYNF6mtNgjY= go.opentelemetry.io/contrib/propagators/b3 v1.36.0 h1:xrAb/G80z/l5JL6XlmUMSD1i6W8vXkWrLfmkD3w/zZo= go.opentelemetry.io/contrib/propagators/b3 v1.36.0/go.mod h1:UREJtqioFu5awNaCR8aEx7MfJROFlAWb6lPaJFbHaG0= go.opentelemetry.io/contrib/propagators/jaeger v1.36.0 h1:SoCgXYF4ISDtNyfLUzsGDaaudZVTx2yJhOyBO0+/GYk= @@ -1895,40 +1909,46 @@ go.opentelemetry.io/contrib/propagators/ot v1.36.0 h1:UBoZjbx483GslNKYK2YpfvePTJ go.opentelemetry.io/contrib/propagators/ot v1.36.0/go.mod h1:adDDRry19/n9WoA7mSCMjoVJcmzK/bZYzX9SR+g2+W4= go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= -go.opentelemetry.io/otel v1.38.0 h1:RkfdswUDRimDg0m2Az18RKOsnI8UDzppJAtj01/Ymk8= -go.opentelemetry.io/otel v1.38.0/go.mod h1:zcmtmQ1+YmQM9wrNsTGV/q/uyusom3P8RxwExxkZhjM= -go.opentelemetry.io/otel/bridge/opentracing v1.36.0 h1:GWGmcYhMCu6+K/Yz5KWSETU/esd/mkVGx+77uKtLjpk= -go.opentelemetry.io/otel/bridge/opentracing v1.36.0/go.mod h1:bW7xTHgtWSNqY8QjhqXzloXBkw3iQIa8uBqCF/0EUbc= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 h1:dNzwXjZKpMpE2JhmO+9HsPl42NIXFIFSUSSs0fiqra0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0/go.mod h1:90PoxvaEB5n6AOdZvi+yWJQoE95U8Dhhw2bSyRqnTD0= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 h1:JgtbA0xkWHnTmYk7YusopJFX6uleBmAuZ8n05NEh8nQ= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0/go.mod h1:179AK5aar5R3eS9FucPy6rggvU0g52cvKId8pv4+v0c= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0 h1:WDdP9acbMYjbKIyJUhTvtzj601sVJOqgWdUxSdR/Ysc= -go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.29.0/go.mod h1:BLbf7zbNIONBLPwvFnwNHGj4zge8uTCM/UPIVW1Mq2I= +go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48= +go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8= +go.opentelemetry.io/otel/bridge/opentracing v1.39.0 h1:eig9tBp5jLTJV0jda6dH5/qHn1ruPcur7EvDRgOfZ+g= +go.opentelemetry.io/otel/bridge/opentracing v1.39.0/go.mod h1:Eo4QwR1LXgmMZqJkvplH5IAvv9so3JBJKeuCxf87MXo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0 h1:in9O8ESIOlwJAEGTkkf34DesGRAc/Pn8qJ7k3r/42LM= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.39.0/go.mod h1:Rp0EXBm5tfnv0WL+ARyO/PHBEaEAT8UUHQ6AGJcSq6c= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0 h1:rixTyDGXFxRy1xzhKrotaHy3/KXdPhlWARrCgK+eqUY= +go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.36.0/go.mod h1:dowW6UsM9MKbJq5JTz2AMVp3/5iW5I/TStsk8S+CfHw= go.opentelemetry.io/otel/log v0.12.2 h1:yob9JVHn2ZY24byZeaXpTVoPS6l+UrrxmxmPKohXTwc= go.opentelemetry.io/otel/log v0.12.2/go.mod h1:ShIItIxSYxufUMt+1H5a2wbckGli3/iCfuEbVZi/98E= go.opentelemetry.io/otel/log/logtest v0.0.0-20250526142609-aa5bd0e64989 h1:4JF7oY9CcHrPGfBLijDcXZyCzGckVEyOjuat5ktmQRg= go.opentelemetry.io/otel/log/logtest v0.0.0-20250526142609-aa5bd0e64989/go.mod h1:NToOxLDCS1tXDSB2dIj44H9xGPOpKr0csIN+gnuihv4= go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= -go.opentelemetry.io/otel/metric v1.38.0 h1:Kl6lzIYGAh5M159u9NgiRkmoMKjvbsKtYRwgfrA6WpA= -go.opentelemetry.io/otel/metric v1.38.0/go.mod h1:kB5n/QoRM8YwmUahxvI3bO34eVtQf2i4utNVLr9gEmI= +go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0= +go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs= go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= -go.opentelemetry.io/otel/sdk v1.38.0 h1:l48sr5YbNf2hpCUj/FoGhW9yDkl+Ma+LrVl8qaM5b+E= -go.opentelemetry.io/otel/sdk v1.38.0/go.mod h1:ghmNdGlVemJI3+ZB5iDEuk4bWA3GkTpW+DOoZMYBVVg= +go.opentelemetry.io/otel/sdk v1.39.0 h1:nMLYcjVsvdui1B/4FRkwjzoRVsMK8uL/cj0OyhKzt18= +go.opentelemetry.io/otel/sdk v1.39.0/go.mod h1:vDojkC4/jsTJsE+kh+LXYQlbL8CgrEcwmt1ENZszdJE= go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= -go.opentelemetry.io/otel/sdk/metric v1.38.0 h1:aSH66iL0aZqo//xXzQLYozmWrXxyFkBJ6qT5wthqPoM= -go.opentelemetry.io/otel/sdk/metric v1.38.0/go.mod h1:dg9PBnW9XdQ1Hd6ZnRz689CbtrUp0wMMs9iPcgT9EZA= +go.opentelemetry.io/otel/sdk/metric v1.39.0 h1:cXMVVFVgsIf2YL6QkRF4Urbr/aMInf+2WKg+sEJTtB8= +go.opentelemetry.io/otel/sdk/metric v1.39.0/go.mod h1:xq9HEVH7qeX69/JnwEfp6fVq5wosJsY1mt4lLfYdVew= go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= -go.opentelemetry.io/otel/trace v1.38.0 h1:Fxk5bKrDZJUH+AMyyIXGcFAPah0oRcT+LuNtJrmcNLE= -go.opentelemetry.io/otel/trace v1.38.0/go.mod h1:j1P9ivuFsTceSWe1oY+EeW3sc+Pp42sO++GHkg4wwhs= +go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI= +go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= -go.opentelemetry.io/proto/otlp v1.7.0 h1:jX1VolD6nHuFzOYso2E73H85i92Mv8JQYk0K9vz09os= -go.opentelemetry.io/proto/otlp v1.7.0/go.mod h1:fSKjH6YJ7HDlwzltzyMj036AJ3ejJLCgCSHGj4efDDo= +go.opentelemetry.io/proto/otlp v1.9.0 h1:l706jCMITVouPOqEnii2fIAuO3IVGBRPV5ICjceRb/A= +go.opentelemetry.io/proto/otlp v1.9.0/go.mod h1:xE+Cx5E/eEHw+ISFkwPLwCZefwVjY+pqKg1qcK03+/4= +go.opentelemetry.io/proto/slim/otlp v1.9.0 h1:fPVMv8tP3TrsqlkH1HWYUpbCY9cAIemx184VGkS6vlE= +go.opentelemetry.io/proto/slim/otlp v1.9.0/go.mod h1:xXdeJJ90Gqyll+orzUkY4bOd2HECo5JofeoLpymVqdI= +go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.2.0 h1:o13nadWDNkH/quoDomDUClnQBpdQQ2Qqv0lQBjIXjE8= +go.opentelemetry.io/proto/slim/otlp/collector/profiles/v1development v0.2.0/go.mod h1:Gyb6Xe7FTi/6xBHwMmngGoHqL0w29Y4eW8TGFzpefGA= +go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.2.0 h1:EiUYvtwu6PMrMHVjcPfnsG3v+ajPkbUeH+IL93+QYyk= +go.opentelemetry.io/proto/slim/otlp/profiles/v1development v0.2.0/go.mod h1:mUUHKFiN2SST3AhJ8XhJxEoeVW12oqfXog0Bo8W3Ec4= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= @@ -1979,8 +1999,8 @@ golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5D golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= +golang.org/x/crypto v0.46.0 h1:cKRW/pmt1pKAfetfu+RCEvjvZkA9RimPbh7bhFjGVBU= +golang.org/x/crypto v0.46.0/go.mod h1:Evb/oLKmMraqjZ2iQTwDwvCtJkczlDuTmdJXoZVzqU0= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1996,8 +2016,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20220827204233-334a2380cb91/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE= -golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476 h1:bsqhLWFR6G6xiQcb+JoGqdKdRU6WzPWmK8E0jxTjzo4= -golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= +golang.org/x/exp v0.0.0-20250808145144-a408d31f581a h1:Y+7uR/b1Mw2iSXZ3G//1haIiSElDQZ8KWh0h+sZPG90= +golang.org/x/exp v0.0.0-20250808145144-a408d31f581a/go.mod h1:rT6SFzZ7oxADUDx58pcaKFTcZ+inxAa9fTrYx/uVYwg= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -2044,8 +2064,8 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= -golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= +golang.org/x/mod v0.30.0 h1:fDEXFVZ/fmCKProc/yAXXUijritrDzahmwwefnjoPFk= +golang.org/x/mod v0.30.0/go.mod h1:lAsf5O2EvJeSFMiBxXDki7sCgAxEUcZHXoXMKT4GJKc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2119,8 +2139,8 @@ golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/net v0.48.0 h1:zyQRTTrjc33Lhh0fBgT/H3oZq9WuvRR5gPC70xpDiQU= +golang.org/x/net v0.48.0/go.mod h1:+ndRgGjkh8FGtu1w1FGbEC31if4VrNVMuKTgcAAnQRY= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2152,8 +2172,8 @@ golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= -golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo= -golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY= +golang.org/x/oauth2 v0.32.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2176,8 +2196,8 @@ golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= +golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2278,7 +2298,6 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= @@ -2288,8 +2307,8 @@ golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk= +golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/telemetry v0.0.0-20240521205824-bda55230c457/go.mod h1:pRgIJT+bRLFKnoM1ldnzKoxTIn14Yxz928LQRYYgIN0= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -2310,8 +2329,8 @@ golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0= golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= +golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q= +golang.org/x/term v0.38.0/go.mod h1:bSEAKrOT1W+VSu9TSCMtoGEOUcKxOKgl3LE5QEF/xVg= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2334,16 +2353,16 @@ golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/text v0.32.0 h1:ZD01bjUt1FQ9WJ0ClOL5vxgxOI/sVCNgX1YtKwcY0mU= +golang.org/x/text v0.32.0/go.mod h1:o/rUWzghvpD5TXrTIBuJU77MTaN0ljMWE47kxGJQ7jY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= -golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= +golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -2412,8 +2431,8 @@ golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/tools v0.22.0/go.mod h1:aCwcsjqvq7Yqt6TNyX7QMU2enbQ/Gt0bo6krSeEri+c= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.39.0 h1:ik4ho21kwuQln40uelmciQPp9SipgNDdrafrYA4TmQQ= +golang.org/x/tools v0.39.0/go.mod h1:JnefbkDPyD8UU2kI5fuf8ZX4/yUeh9W877ZeBONxUqQ= golang.org/x/tools/godoc v0.1.0-deprecated h1:o+aZ1BOj6Hsx/GBdJO/s815sqftjSnrZZwyYTHODvtk= golang.org/x/tools/godoc v0.1.0-deprecated/go.mod h1:qM63CriJ961IHWmnWa9CjZnBndniPt4a3CK0PVB9bIg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2498,8 +2517,8 @@ google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZ google.golang.org/api v0.124.0/go.mod h1:xu2HQurE5gi/3t1aFCvhPD781p0a3p11sdunTJ2BlP4= google.golang.org/api v0.125.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/api v0.239.0 h1:2hZKUnFZEy81eugPs4e2XzIJ5SOwQg0G82bpXD65Puo= -google.golang.org/api v0.239.0/go.mod h1:cOVEm2TpdAGHL2z+UwyS+kmlGr3bVWQQ6sYEqkKje50= +google.golang.org/api v0.247.0 h1:tSd/e0QrUlLsrwMKmkbQhYVa109qIintOls2Wh6bngc= +google.golang.org/api v0.247.0/go.mod h1:r1qZOPmxXffXg6xS5uhx16Fa/UFY8QU/K4bfKrnvovM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -2650,8 +2669,8 @@ google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mR google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= google.golang.org/genproto v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:0ggbjUrZYpy1q+ANUS30SEoGZ53cdfwtbuG7Ptgy108= google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2 h1:1tXaIXCracvtsRxSBsYDiSBN0cuJvM7QYW+MrpIRY78= -google.golang.org/genproto v0.0.0-20250505200425-f936aa4a68b2/go.mod h1:49MsLSx0oWMOZqcpB3uL8ZOkAh1+TndpJ8ONoCBWiZk= +google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4= +google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= @@ -2663,8 +2682,8 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230822172742-b8732ec3820d/go. google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142/go.mod h1:d6be+8HhtEtucleCbxpPW9PA9XwISACu8nvpPqF0BVo= google.golang.org/genproto/googleapis/api v0.0.0-20241202173237-19429a94021a/go.mod h1:jehYqy3+AhJU9ve55aNOaSml7wUXjF9x6z2LcCfpAhY= google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422/go.mod h1:b6h1vNKhxaSoEI+5jc3PJUCustfli/mRab7295pY7rw= -google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822 h1:oWVWY3NzT7KJppx2UKhKmzPq4SRe0LdCijVRwvGeikY= -google.golang.org/genproto/googleapis/api v0.0.0-20250603155806-513f23925822/go.mod h1:h3c4v36UTKzUiuaOKQ6gr3S+0hovBtUrXzTG/i3+XEc= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls= +google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto= google.golang.org/genproto/googleapis/bytestream v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:ylj+BE99M198VPbBh6A8d9n3w8fChvyLK3wwBOjXBFA= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234015-3fc162c6f38a/go.mod h1:xURIpW9ES5+/GZhnV6beoEtxQrnkRGIfP5VQG2tCBLc= google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= @@ -2683,8 +2702,8 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20241118233622-e639e219e697/go. google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU= google.golang.org/genproto/googleapis/rpc v0.0.0-20250102185135-69823020774d/go.mod h1:3ENsm/5D1mzDyhpzeRi1NR784I0BcofWBoSc5QqqMK4= google.golang.org/genproto/googleapis/rpc v0.0.0-20250115164207-1a7da9e5054f/go.mod h1:+2Yz8+CLJbIfL9z73EW45avw8Lmge3xVElCP9zEKi50= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822 h1:fc6jSaCT0vBduLYZHYrBBNY4dsWuvgyff9noRNDdBeE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20250603155806-513f23925822/go.mod h1:qQ0YXyHHx3XkvlzUtpXDkS29lDSafHMZBAZDc03LQ3A= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww= +google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk= google.golang.org/grpc v1.71.2 h1:KnzCueW4s+8ojAPZ+NnyZAELjsIMJGteKjKejieEC7M= google.golang.org/grpc v1.71.2/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/vendor/cel.dev/expr/eval.pb.go b/vendor/cel.dev/expr/eval.pb.go index 8f651f9cc6a..a7aae0900c4 100644 --- a/vendor/cel.dev/expr/eval.pb.go +++ b/vendor/cel.dev/expr/eval.pb.go @@ -1,15 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v3.21.5 +// protoc-gen-go v1.36.3 +// protoc v5.27.1 // source: cel/expr/eval.proto package expr import ( - status "google.golang.org/genproto/googleapis/rpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" reflect "reflect" sync "sync" ) @@ -22,21 +22,18 @@ const ( ) type EvalState struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Values []*ExprValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` + Results []*EvalState_Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` unknownFields protoimpl.UnknownFields - - Values []*ExprValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` - Results []*EvalState_Result `protobuf:"bytes,3,rep,name=results,proto3" json:"results,omitempty"` + sizeCache protoimpl.SizeCache } func (x *EvalState) Reset() { *x = EvalState{} - if protoimpl.UnsafeEnabled { - mi := &file_cel_expr_eval_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_cel_expr_eval_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EvalState) String() string { @@ -47,7 +44,7 @@ func (*EvalState) ProtoMessage() {} func (x *EvalState) ProtoReflect() protoreflect.Message { mi := &file_cel_expr_eval_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -77,25 +74,22 @@ func (x *EvalState) GetResults() []*EvalState_Result { } type ExprValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Types that are assignable to Kind: + state protoimpl.MessageState `protogen:"open.v1"` + // Types that are valid to be assigned to Kind: // // *ExprValue_Value // *ExprValue_Error // *ExprValue_Unknown - Kind isExprValue_Kind `protobuf_oneof:"kind"` + Kind isExprValue_Kind `protobuf_oneof:"kind"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ExprValue) Reset() { *x = ExprValue{} - if protoimpl.UnsafeEnabled { - mi := &file_cel_expr_eval_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_cel_expr_eval_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ExprValue) String() string { @@ -106,7 +100,7 @@ func (*ExprValue) ProtoMessage() {} func (x *ExprValue) ProtoReflect() protoreflect.Message { mi := &file_cel_expr_eval_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -121,30 +115,36 @@ func (*ExprValue) Descriptor() ([]byte, []int) { return file_cel_expr_eval_proto_rawDescGZIP(), []int{1} } -func (m *ExprValue) GetKind() isExprValue_Kind { - if m != nil { - return m.Kind +func (x *ExprValue) GetKind() isExprValue_Kind { + if x != nil { + return x.Kind } return nil } func (x *ExprValue) GetValue() *Value { - if x, ok := x.GetKind().(*ExprValue_Value); ok { - return x.Value + if x != nil { + if x, ok := x.Kind.(*ExprValue_Value); ok { + return x.Value + } } return nil } func (x *ExprValue) GetError() *ErrorSet { - if x, ok := x.GetKind().(*ExprValue_Error); ok { - return x.Error + if x != nil { + if x, ok := x.Kind.(*ExprValue_Error); ok { + return x.Error + } } return nil } func (x *ExprValue) GetUnknown() *UnknownSet { - if x, ok := x.GetKind().(*ExprValue_Unknown); ok { - return x.Unknown + if x != nil { + if x, ok := x.Kind.(*ExprValue_Unknown); ok { + return x.Unknown + } } return nil } @@ -172,20 +172,17 @@ func (*ExprValue_Error) isExprValue_Kind() {} func (*ExprValue_Unknown) isExprValue_Kind() {} type ErrorSet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Errors []*Status `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` unknownFields protoimpl.UnknownFields - - Errors []*status.Status `protobuf:"bytes,1,rep,name=errors,proto3" json:"errors,omitempty"` + sizeCache protoimpl.SizeCache } func (x *ErrorSet) Reset() { *x = ErrorSet{} - if protoimpl.UnsafeEnabled { - mi := &file_cel_expr_eval_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_cel_expr_eval_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ErrorSet) String() string { @@ -196,7 +193,7 @@ func (*ErrorSet) ProtoMessage() {} func (x *ErrorSet) ProtoReflect() protoreflect.Message { mi := &file_cel_expr_eval_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -211,28 +208,85 @@ func (*ErrorSet) Descriptor() ([]byte, []int) { return file_cel_expr_eval_proto_rawDescGZIP(), []int{2} } -func (x *ErrorSet) GetErrors() []*status.Status { +func (x *ErrorSet) GetErrors() []*Status { if x != nil { return x.Errors } return nil } -type UnknownSet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache +type Status struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} - Exprs []int64 `protobuf:"varint,1,rep,packed,name=exprs,proto3" json:"exprs,omitempty"` +func (x *Status) Reset() { + *x = Status{} + mi := &file_cel_expr_eval_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x *UnknownSet) Reset() { - *x = UnknownSet{} - if protoimpl.UnsafeEnabled { - mi := &file_cel_expr_eval_proto_msgTypes[3] +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_cel_expr_eval_proto_msgTypes[3] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_cel_expr_eval_proto_rawDescGZIP(), []int{3} +} + +func (x *Status) GetCode() int32 { + if x != nil { + return x.Code } + return 0 +} + +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Status) GetDetails() []*anypb.Any { + if x != nil { + return x.Details + } + return nil +} + +type UnknownSet struct { + state protoimpl.MessageState `protogen:"open.v1"` + Exprs []int64 `protobuf:"varint,1,rep,packed,name=exprs,proto3" json:"exprs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UnknownSet) Reset() { + *x = UnknownSet{} + mi := &file_cel_expr_eval_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UnknownSet) String() string { @@ -242,8 +296,8 @@ func (x *UnknownSet) String() string { func (*UnknownSet) ProtoMessage() {} func (x *UnknownSet) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_cel_expr_eval_proto_msgTypes[4] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -255,7 +309,7 @@ func (x *UnknownSet) ProtoReflect() protoreflect.Message { // Deprecated: Use UnknownSet.ProtoReflect.Descriptor instead. func (*UnknownSet) Descriptor() ([]byte, []int) { - return file_cel_expr_eval_proto_rawDescGZIP(), []int{3} + return file_cel_expr_eval_proto_rawDescGZIP(), []int{4} } func (x *UnknownSet) GetExprs() []int64 { @@ -266,21 +320,18 @@ func (x *UnknownSet) GetExprs() []int64 { } type EvalState_Result struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Expr int64 `protobuf:"varint,1,opt,name=expr,proto3" json:"expr,omitempty"` + Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` unknownFields protoimpl.UnknownFields - - Expr int64 `protobuf:"varint,1,opt,name=expr,proto3" json:"expr,omitempty"` - Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` + sizeCache protoimpl.SizeCache } func (x *EvalState_Result) Reset() { *x = EvalState_Result{} - if protoimpl.UnsafeEnabled { - mi := &file_cel_expr_eval_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_cel_expr_eval_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *EvalState_Result) String() string { @@ -290,8 +341,8 @@ func (x *EvalState_Result) String() string { func (*EvalState_Result) ProtoMessage() {} func (x *EvalState_Result) ProtoReflect() protoreflect.Message { - mi := &file_cel_expr_eval_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + mi := &file_cel_expr_eval_proto_msgTypes[5] + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -325,39 +376,45 @@ var File_cel_expr_eval_proto protoreflect.FileDescriptor var file_cel_expr_eval_proto_rawDesc = []byte{ 0x0a, 0x13, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x65, 0x76, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x1a, - 0x14, 0x63, 0x65, 0x6c, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, - 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, - 0x01, 0x0a, 0x09, 0x45, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, 0x0a, 0x06, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x63, - 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x65, 0x6c, - 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2e, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x1a, - 0x32, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x78, 0x70, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2a, 0x0a, 0x05, 0x65, 0x72, - 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, 0x6c, 0x2e, - 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, - 0x70, 0x72, 0x2e, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x48, 0x00, 0x52, - 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, 0x6e, 0x64, - 0x22, 0x36, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x06, - 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x22, 0x0a, 0x0a, 0x55, 0x6e, 0x6b, 0x6e, - 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x78, 0x70, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x65, 0x78, 0x70, 0x72, 0x73, 0x42, 0x2c, 0x0a, 0x0c, - 0x64, 0x65, 0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x42, 0x09, 0x45, 0x76, - 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c, 0x2e, 0x64, - 0x65, 0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x63, 0x65, 0x6c, 0x2f, + 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0xa2, 0x01, 0x0a, 0x09, 0x45, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2b, + 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x07, 0x72, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, + 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x1a, 0x32, 0x0a, 0x06, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, + 0x78, 0x70, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x65, 0x78, 0x70, 0x72, 0x12, + 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x09, 0x45, 0x78, 0x70, 0x72, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2a, 0x0a, 0x05, + 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x65, + 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x48, + 0x00, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x07, 0x75, 0x6e, 0x6b, 0x6e, + 0x6f, 0x77, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x63, 0x65, 0x6c, 0x2e, + 0x65, 0x78, 0x70, 0x72, 0x2e, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x48, + 0x00, 0x52, 0x07, 0x75, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x42, 0x06, 0x0a, 0x04, 0x6b, 0x69, + 0x6e, 0x64, 0x22, 0x34, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x65, 0x74, 0x12, 0x28, + 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, + 0x2e, 0x63, 0x65, 0x6c, 0x2e, 0x65, 0x78, 0x70, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x22, 0x22, 0x0a, 0x0a, 0x55, 0x6e, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x78, 0x70, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x05, 0x65, + 0x78, 0x70, 0x72, 0x73, 0x42, 0x2c, 0x0a, 0x0c, 0x64, 0x65, 0x76, 0x2e, 0x63, 0x65, 0x6c, 0x2e, + 0x65, 0x78, 0x70, 0x72, 0x42, 0x09, 0x45, 0x76, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x0c, 0x63, 0x65, 0x6c, 0x2e, 0x64, 0x65, 0x76, 0x2f, 0x65, 0x78, 0x70, 0x72, 0xf8, + 0x01, 0x01, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -372,28 +429,30 @@ func file_cel_expr_eval_proto_rawDescGZIP() []byte { return file_cel_expr_eval_proto_rawDescData } -var file_cel_expr_eval_proto_msgTypes = make([]protoimpl.MessageInfo, 5) -var file_cel_expr_eval_proto_goTypes = []interface{}{ +var file_cel_expr_eval_proto_msgTypes = make([]protoimpl.MessageInfo, 6) +var file_cel_expr_eval_proto_goTypes = []any{ (*EvalState)(nil), // 0: cel.expr.EvalState (*ExprValue)(nil), // 1: cel.expr.ExprValue (*ErrorSet)(nil), // 2: cel.expr.ErrorSet - (*UnknownSet)(nil), // 3: cel.expr.UnknownSet - (*EvalState_Result)(nil), // 4: cel.expr.EvalState.Result - (*Value)(nil), // 5: cel.expr.Value - (*status.Status)(nil), // 6: google.rpc.Status + (*Status)(nil), // 3: cel.expr.Status + (*UnknownSet)(nil), // 4: cel.expr.UnknownSet + (*EvalState_Result)(nil), // 5: cel.expr.EvalState.Result + (*Value)(nil), // 6: cel.expr.Value + (*anypb.Any)(nil), // 7: google.protobuf.Any } var file_cel_expr_eval_proto_depIdxs = []int32{ 1, // 0: cel.expr.EvalState.values:type_name -> cel.expr.ExprValue - 4, // 1: cel.expr.EvalState.results:type_name -> cel.expr.EvalState.Result - 5, // 2: cel.expr.ExprValue.value:type_name -> cel.expr.Value + 5, // 1: cel.expr.EvalState.results:type_name -> cel.expr.EvalState.Result + 6, // 2: cel.expr.ExprValue.value:type_name -> cel.expr.Value 2, // 3: cel.expr.ExprValue.error:type_name -> cel.expr.ErrorSet - 3, // 4: cel.expr.ExprValue.unknown:type_name -> cel.expr.UnknownSet - 6, // 5: cel.expr.ErrorSet.errors:type_name -> google.rpc.Status - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name + 4, // 4: cel.expr.ExprValue.unknown:type_name -> cel.expr.UnknownSet + 3, // 5: cel.expr.ErrorSet.errors:type_name -> cel.expr.Status + 7, // 6: cel.expr.Status.details:type_name -> google.protobuf.Any + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_cel_expr_eval_proto_init() } @@ -402,69 +461,7 @@ func file_cel_expr_eval_proto_init() { return } file_cel_expr_value_proto_init() - if !protoimpl.UnsafeEnabled { - file_cel_expr_eval_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvalState); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cel_expr_eval_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExprValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cel_expr_eval_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ErrorSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cel_expr_eval_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnknownSet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_cel_expr_eval_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EvalState_Result); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - file_cel_expr_eval_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_cel_expr_eval_proto_msgTypes[1].OneofWrappers = []any{ (*ExprValue_Value)(nil), (*ExprValue_Error)(nil), (*ExprValue_Unknown)(nil), @@ -475,7 +472,7 @@ func file_cel_expr_eval_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cel_expr_eval_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/cloud.google.com/go/auth/CHANGES.md b/vendor/cloud.google.com/go/auth/CHANGES.md index 66131916eb7..d2354a8beed 100644 --- a/vendor/cloud.google.com/go/auth/CHANGES.md +++ b/vendor/cloud.google.com/go/auth/CHANGES.md @@ -1,5 +1,19 @@ # Changelog +## [0.16.4](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.3...auth/v0.16.4) (2025-08-06) + + +### Bug Fixes + +* **auth:** Add UseDefaultClient: true to metadata.Options ([#12666](https://github.com/googleapis/google-cloud-go/issues/12666)) ([1482191](https://github.com/googleapis/google-cloud-go/commit/1482191e88236693efef68769752638281566766)), refs [#11078](https://github.com/googleapis/google-cloud-go/issues/11078) [#12657](https://github.com/googleapis/google-cloud-go/issues/12657) + +## [0.16.3](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.2...auth/v0.16.3) (2025-07-17) + + +### Bug Fixes + +* **auth:** Fix race condition in cachedTokenProvider.tokenAsync ([#12586](https://github.com/googleapis/google-cloud-go/issues/12586)) ([73867cc](https://github.com/googleapis/google-cloud-go/commit/73867ccc1e9808d65361bcfc0776bd95fe34dbb3)) + ## [0.16.2](https://github.com/googleapis/google-cloud-go/compare/auth/v0.16.1...auth/v0.16.2) (2025-06-04) diff --git a/vendor/cloud.google.com/go/auth/auth.go b/vendor/cloud.google.com/go/auth/auth.go index cd5e9886848..fb24c43eb57 100644 --- a/vendor/cloud.google.com/go/auth/auth.go +++ b/vendor/cloud.google.com/go/auth/auth.go @@ -362,9 +362,6 @@ func (c *cachedTokenProvider) tokenState() tokenState { // blocking call to Token should likely return the same error on the main goroutine. func (c *cachedTokenProvider) tokenAsync(ctx context.Context) { fn := func() { - c.mu.Lock() - c.isRefreshRunning = true - c.mu.Unlock() t, err := c.tp.Token(ctx) c.mu.Lock() defer c.mu.Unlock() @@ -380,6 +377,7 @@ func (c *cachedTokenProvider) tokenAsync(ctx context.Context) { c.mu.Lock() defer c.mu.Unlock() if !c.isRefreshRunning && !c.isRefreshErr { + c.isRefreshRunning = true go fn() } } diff --git a/vendor/cloud.google.com/go/auth/credentials/detect.go b/vendor/cloud.google.com/go/auth/credentials/detect.go index d8f7d961466..ad3267eb285 100644 --- a/vendor/cloud.google.com/go/auth/credentials/detect.go +++ b/vendor/cloud.google.com/go/auth/credentials/detect.go @@ -116,7 +116,8 @@ func DetectDefault(opts *DetectOptions) (*auth.Credentials, error) { if OnGCE() { metadataClient := metadata.NewWithOptions(&metadata.Options{ - Logger: opts.logger(), + Logger: opts.logger(), + UseDefaultClient: true, }) return auth.NewCredentials(&auth.CredentialsOptions{ TokenProvider: computeTokenProvider(opts, metadataClient), diff --git a/vendor/cloud.google.com/go/compute/metadata/CHANGES.md b/vendor/cloud.google.com/go/compute/metadata/CHANGES.md index 1f848ce0b31..a2a643ef743 100644 --- a/vendor/cloud.google.com/go/compute/metadata/CHANGES.md +++ b/vendor/cloud.google.com/go/compute/metadata/CHANGES.md @@ -1,5 +1,12 @@ # Changes +## [0.8.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.7.0...compute/metadata/v0.8.0) (2025-08-06) + + +### Features + +* **compute/metadata:** Add Options.UseDefaultClient ([#12657](https://github.com/googleapis/google-cloud-go/issues/12657)) ([1a88209](https://github.com/googleapis/google-cloud-go/commit/1a8820900f20e038291c4bb2c5284a449196e81f)), refs [#11078](https://github.com/googleapis/google-cloud-go/issues/11078) + ## [0.7.0](https://github.com/googleapis/google-cloud-go/compare/compute/metadata/v0.6.0...compute/metadata/v0.7.0) (2025-05-13) diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go index 322be8032d7..6873ad8d1a0 100644 --- a/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ b/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -357,26 +357,52 @@ type Client struct { // Options for configuring a [Client]. type Options struct { // Client is the HTTP client used to make requests. Optional. + // If UseDefaultClient is true, this field is ignored. + // If this field is nil, a new default http.Client will be created. Client *http.Client // Logger is used to log information about HTTP request and responses. // If not provided, nothing will be logged. Optional. Logger *slog.Logger + // UseDefaultClient specifies that the client should use the same default + // internal http.Client that is used in functions such as GetWithContext. + // This is useful for sharing a single TCP connection pool across requests. + // The difference vs GetWithContext is the ability to use this struct + // to provide a custom logger. If this field is true, the Client + // field is ignored. + UseDefaultClient bool } // NewClient returns a Client that can be used to fetch metadata. // Returns the client that uses the specified http.Client for HTTP requests. -// If nil is specified, returns the default client. +// If nil is specified, returns the default internal Client that is +// also used in functions such as GetWithContext. This is useful for sharing +// a single TCP connection pool across requests. func NewClient(c *http.Client) *Client { - return NewWithOptions(&Options{ - Client: c, - }) + if c == nil { + // Preserve original behavior for nil argument. + return defaultClient + } + // Return a new client with a no-op logger for backward compatibility. + return &Client{hc: c, logger: slog.New(noOpHandler{})} } // NewWithOptions returns a Client that is configured with the provided Options. func NewWithOptions(opts *Options) *Client { + // Preserve original behavior for nil opts. if opts == nil { return defaultClient } + + // Handle explicit request for the internal default http.Client. + if opts.UseDefaultClient { + logger := opts.Logger + if logger == nil { + logger = slog.New(noOpHandler{}) + } + return &Client{hc: defaultClient.hc, logger: logger} + } + + // Handle isolated client creation. client := opts.Client if client == nil { client = newDefaultHTTPClient() diff --git a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json index d72e823299d..eaa1dab0939 100644 --- a/vendor/cloud.google.com/go/internal/.repo-metadata-full.json +++ b/vendor/cloud.google.com/go/internal/.repo-metadata-full.json @@ -239,6 +239,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/apps/events/subscriptions/apiv1beta": { + "api_shortname": "workspaceevents", + "distribution_name": "cloud.google.com/go/apps/events/subscriptions/apiv1beta", + "description": "Google Workspace Events API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/apps/latest/events/subscriptions/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/apps/meet/apiv2": { "api_shortname": "meet", "distribution_name": "cloud.google.com/go/apps/meet/apiv2", @@ -529,6 +539,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/bigquery/datapolicies/apiv2beta1": { + "api_shortname": "bigquerydatapolicy", + "distribution_name": "cloud.google.com/go/bigquery/datapolicies/apiv2beta1", + "description": "BigQuery Data Policy API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/bigquery/latest/datapolicies/apiv2beta1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/bigquery/datatransfer/apiv1": { "api_shortname": "bigquerydatatransfer", "distribution_name": "cloud.google.com/go/bigquery/datatransfer/apiv1", @@ -589,6 +609,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/bigquery/storage/apiv1beta": { + "api_shortname": "bigquerystorage", + "distribution_name": "cloud.google.com/go/bigquery/storage/apiv1beta", + "description": "BigQuery Storage API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/bigquery/latest/storage/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/bigquery/storage/apiv1beta1": { "api_shortname": "bigquerystorage", "distribution_name": "cloud.google.com/go/bigquery/storage/apiv1beta1", @@ -609,6 +639,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/bigquery/v2/apiv2": { + "api_shortname": "bigquery", + "distribution_name": "cloud.google.com/go/bigquery/v2/apiv2", + "description": "BigQuery API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/bigquery/v2/latest/apiv2", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/bigtable": { "api_shortname": "bigtable", "distribution_name": "cloud.google.com/go/bigtable", @@ -719,6 +759,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/chronicle/apiv1": { + "api_shortname": "chronicle", + "distribution_name": "cloud.google.com/go/chronicle/apiv1", + "description": "Chronicle API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/chronicle/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/cloudbuild/apiv1/v2": { "api_shortname": "cloudbuild", "distribution_name": "cloud.google.com/go/cloudbuild/apiv1/v2", @@ -849,6 +899,16 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/compute/apiv1beta": { + "api_shortname": "compute", + "distribution_name": "cloud.google.com/go/compute/apiv1beta", + "description": "Google Compute Engine API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/compute/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/compute/metadata": { "api_shortname": "compute-metadata", "distribution_name": "cloud.google.com/go/compute/metadata", @@ -889,6 +949,26 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/configdelivery/apiv1": { + "api_shortname": "configdelivery", + "distribution_name": "cloud.google.com/go/configdelivery/apiv1", + "description": "Config Delivery API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/configdelivery/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/configdelivery/apiv1beta": { + "api_shortname": "configdelivery", + "distribution_name": "cloud.google.com/go/configdelivery/apiv1beta", + "description": "Config Delivery API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/configdelivery/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/contactcenterinsights/apiv1": { "api_shortname": "contactcenterinsights", "distribution_name": "cloud.google.com/go/contactcenterinsights/apiv1", @@ -959,6 +1039,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/dataform/apiv1": { + "api_shortname": "dataform", + "distribution_name": "cloud.google.com/go/dataform/apiv1", + "description": "Dataform API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/dataform/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/dataform/apiv1beta1": { "api_shortname": "dataform", "distribution_name": "cloud.google.com/go/dataform/apiv1beta1", @@ -1069,16 +1159,6 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, - "cloud.google.com/go/debugger/apiv2": { - "api_shortname": "clouddebugger", - "distribution_name": "cloud.google.com/go/debugger/apiv2", - "description": "Stackdriver Debugger API", - "language": "go", - "client_library_type": "generated", - "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/latest/debugger/apiv2", - "release_level": "preview", - "library_type": "GAPIC_AUTO" - }, "cloud.google.com/go/deploy/apiv1": { "api_shortname": "clouddeploy", "distribution_name": "cloud.google.com/go/deploy/apiv1", @@ -1099,6 +1179,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/devicestreaming/apiv1": { + "api_shortname": "devicestreaming", + "distribution_name": "cloud.google.com/go/devicestreaming/apiv1", + "description": "Device Streaming API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/devicestreaming/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/dialogflow/apiv2": { "api_shortname": "dialogflow", "distribution_name": "cloud.google.com/go/dialogflow/apiv2", @@ -1459,6 +1549,26 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/iam/apiv3": { + "api_shortname": "iam", + "distribution_name": "cloud.google.com/go/iam/apiv3", + "description": "Identity and Access Management (IAM) API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/iam/latest/apiv3", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/iam/apiv3beta": { + "api_shortname": "iam", + "distribution_name": "cloud.google.com/go/iam/apiv3beta", + "description": "Identity and Access Management (IAM) API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/iam/latest/apiv3beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/iam/credentials/apiv1": { "api_shortname": "iamcredentials", "distribution_name": "cloud.google.com/go/iam/credentials/apiv1", @@ -1559,6 +1669,16 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/licensemanager/apiv1": { + "api_shortname": "licensemanager", + "distribution_name": "cloud.google.com/go/licensemanager/apiv1", + "description": "License Manager API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/licensemanager/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/lifesciences/apiv2beta": { "api_shortname": "lifesciences", "distribution_name": "cloud.google.com/go/lifesciences/apiv2beta", @@ -1599,6 +1719,26 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/lustre/apiv1": { + "api_shortname": "lustre", + "distribution_name": "cloud.google.com/go/lustre/apiv1", + "description": "Google Cloud Managed Lustre API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/lustre/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/maintenance/api/apiv1beta": { + "api_shortname": "maintenance", + "distribution_name": "cloud.google.com/go/maintenance/api/apiv1beta", + "description": "Maintenance API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/maintenance/latest/api/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/managedidentities/apiv1": { "api_shortname": "managedidentities", "distribution_name": "cloud.google.com/go/managedidentities/apiv1", @@ -1619,6 +1759,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/managedkafka/schemaregistry/apiv1": { + "api_shortname": "managedkafka", + "distribution_name": "cloud.google.com/go/managedkafka/schemaregistry/apiv1", + "description": "Managed Service for Apache Kafka API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/managedkafka/latest/schemaregistry/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/maps/addressvalidation/apiv1": { "api_shortname": "addressvalidation", "distribution_name": "cloud.google.com/go/maps/addressvalidation/apiv1", @@ -1632,7 +1782,7 @@ "cloud.google.com/go/maps/areainsights/apiv1": { "api_shortname": "areainsights", "distribution_name": "cloud.google.com/go/maps/areainsights/apiv1", - "description": "Places Insights API", + "description": "Places Aggregate API", "language": "go", "client_library_type": "generated", "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/maps/latest/areainsights/apiv1", @@ -1799,6 +1949,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/modelarmor/apiv1beta": { + "api_shortname": "modelarmor", + "distribution_name": "cloud.google.com/go/modelarmor/apiv1beta", + "description": "Model Armor API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/modelarmor/latest/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/monitoring/apiv3/v2": { "api_shortname": "monitoring", "distribution_name": "cloud.google.com/go/monitoring/apiv3/v2", @@ -2139,13 +2299,13 @@ "release_level": "stable", "library_type": "GAPIC_MANUAL" }, - "cloud.google.com/go/pubsub/apiv1": { + "cloud.google.com/go/pubsub/v2/apiv1": { "api_shortname": "pubsub", - "distribution_name": "cloud.google.com/go/pubsub/apiv1", + "distribution_name": "cloud.google.com/go/pubsub/v2/apiv1", "description": "Cloud Pub/Sub API", "language": "go", "client_library_type": "generated", - "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/pubsub/latest/apiv1", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/pubsub/v2/latest/apiv1", "release_level": "stable", "library_type": "GAPIC_AUTO" }, @@ -2282,7 +2442,7 @@ "cloud.google.com/go/retail/apiv2": { "api_shortname": "retail", "distribution_name": "cloud.google.com/go/retail/apiv2", - "description": "Vertex AI Search for Retail API", + "description": "Vertex AI Search for commerce API", "language": "go", "client_library_type": "generated", "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/retail/latest/apiv2", @@ -2292,7 +2452,7 @@ "cloud.google.com/go/retail/apiv2alpha": { "api_shortname": "retail", "distribution_name": "cloud.google.com/go/retail/apiv2alpha", - "description": "Vertex AI Search for Retail API", + "description": "Vertex AI Search for commerce API", "language": "go", "client_library_type": "generated", "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/retail/latest/apiv2alpha", @@ -2302,7 +2462,7 @@ "cloud.google.com/go/retail/apiv2beta": { "api_shortname": "retail", "distribution_name": "cloud.google.com/go/retail/apiv2beta", - "description": "Vertex AI Search for Retail API", + "description": "Vertex AI Search for commerce API", "language": "go", "client_library_type": "generated", "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/retail/latest/apiv2beta", @@ -2559,6 +2719,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/accounts/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/accounts/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/accounts/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/accounts/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/accounts/apiv1beta", @@ -2569,6 +2739,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/conversions/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/conversions/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/conversions/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/conversions/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/conversions/apiv1beta", @@ -2579,6 +2759,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/datasources/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/datasources/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/datasources/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/datasources/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/datasources/apiv1beta", @@ -2589,6 +2779,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/inventories/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/inventories/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/inventories/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/inventories/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/inventories/apiv1beta", @@ -2599,6 +2799,36 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/issueresolution/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/issueresolution/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/issueresolution/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/issueresolution/apiv1beta", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/issueresolution/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/shopping/merchant/lfp/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/lfp/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/lfp/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/lfp/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/lfp/apiv1beta", @@ -2609,6 +2839,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/notifications/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/notifications/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/notifications/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/notifications/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/notifications/apiv1beta", @@ -2619,6 +2859,36 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/ordertracking/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/ordertracking/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/ordertracking/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/shopping/merchant/ordertracking/apiv1beta": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/ordertracking/apiv1beta", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/ordertracking/apiv1beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/shopping/merchant/products/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/products/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/products/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/products/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/products/apiv1beta", @@ -2629,6 +2899,26 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/productstudio/apiv1alpha", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/productstudio/apiv1alpha", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, + "cloud.google.com/go/shopping/merchant/promotions/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/promotions/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/promotions/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/promotions/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/promotions/apiv1beta", @@ -2639,6 +2929,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/quota/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/quota/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/quota/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/quota/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/quota/apiv1beta", @@ -2649,6 +2949,16 @@ "release_level": "preview", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/shopping/merchant/reports/apiv1": { + "api_shortname": "merchantapi", + "distribution_name": "cloud.google.com/go/shopping/merchant/reports/apiv1", + "description": "Merchant API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/merchant/reports/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/shopping/merchant/reports/apiv1beta": { "api_shortname": "merchantapi", "distribution_name": "cloud.google.com/go/shopping/merchant/reports/apiv1beta", @@ -2679,6 +2989,16 @@ "release_level": "stable", "library_type": "GAPIC_MANUAL" }, + "cloud.google.com/go/spanner/adapter/apiv1": { + "api_shortname": "spanner", + "distribution_name": "cloud.google.com/go/spanner/adapter/apiv1", + "description": "Cloud Spanner API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/spanner/latest/adapter/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/spanner/admin/database/apiv1": { "api_shortname": "spanner", "distribution_name": "cloud.google.com/go/spanner/admin/database/apiv1", @@ -2692,7 +3012,7 @@ "cloud.google.com/go/spanner/admin/instance/apiv1": { "api_shortname": "spanner", "distribution_name": "cloud.google.com/go/spanner/admin/instance/apiv1", - "description": "Cloud Spanner Instance Admin API", + "description": "Cloud Spanner API", "language": "go", "client_library_type": "generated", "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/spanner/latest/admin/instance/apiv1", @@ -2779,6 +3099,16 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/storagebatchoperations/apiv1": { + "api_shortname": "storagebatchoperations", + "distribution_name": "cloud.google.com/go/storagebatchoperations/apiv1", + "description": "Storage Batch Operations API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/storagebatchoperations/latest/apiv1", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/storageinsights/apiv1": { "api_shortname": "storageinsights", "distribution_name": "cloud.google.com/go/storageinsights/apiv1", @@ -2819,6 +3149,16 @@ "release_level": "stable", "library_type": "GAPIC_AUTO" }, + "cloud.google.com/go/support/apiv2beta": { + "api_shortname": "cloudsupport", + "distribution_name": "cloud.google.com/go/support/apiv2beta", + "description": "Google Cloud Support API", + "language": "go", + "client_library_type": "generated", + "client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/support/latest/apiv2beta", + "release_level": "preview", + "library_type": "GAPIC_AUTO" + }, "cloud.google.com/go/talent/apiv4": { "api_shortname": "jobs", "distribution_name": "cloud.google.com/go/talent/apiv4", diff --git a/vendor/cloud.google.com/go/storage/CHANGES.md b/vendor/cloud.google.com/go/storage/CHANGES.md index e90454d01ad..cbe212871ff 100644 --- a/vendor/cloud.google.com/go/storage/CHANGES.md +++ b/vendor/cloud.google.com/go/storage/CHANGES.md @@ -1,6 +1,140 @@ # Changes +## [1.56.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.55.0...storage/v1.56.0) (2025-07-24) + + +### Features + +* **storage/control:** Update BUILD configs to support rest transportation for all client ([116a33a](https://github.com/googleapis/google-cloud-go/commit/116a33ab13c9fac6f6830dded55c24d38504707b)) + + +### Bug Fixes + +* **storage:** Avoid integration test segfaults. ([#12419](https://github.com/googleapis/google-cloud-go/issues/12419)) ([a9dec07](https://github.com/googleapis/google-cloud-go/commit/a9dec0763f85f083cc1da451249caae7ad97d904)) +* **storage:** Current object generation takeover. ([#12383](https://github.com/googleapis/google-cloud-go/issues/12383)) ([9ca8e01](https://github.com/googleapis/google-cloud-go/commit/9ca8e015405a523bbe68cbff2defbdff3dac0a61)) +* **storage:** Fix MultiRangeDownloader deadlock ([#12548](https://github.com/googleapis/google-cloud-go/issues/12548)) ([2eb23bb](https://github.com/googleapis/google-cloud-go/commit/2eb23bb01ffe92c967e772ef66c846357fbf5419)) +* **storage:** Remove object length limit for unfinalized reads ([#12489](https://github.com/googleapis/google-cloud-go/issues/12489)) ([5566d7d](https://github.com/googleapis/google-cloud-go/commit/5566d7dd5cc83afce38821961c447f5945e48456)) + + +### Performance Improvements + +* **storage:** Zero copy for MultiRangeDownloader ([#12542](https://github.com/googleapis/google-cloud-go/issues/12542)) ([a5e6a68](https://github.com/googleapis/google-cloud-go/commit/a5e6a681164d5be62270cde16891685a9f03bb12)) + + +### Documentation + +* **storage/internal:** Fix broken link for message `CustomPlacementConfig` ([9614487](https://github.com/googleapis/google-cloud-go/commit/96144875e01bfc8a59c2671c6eae87233710cef7)) +* **storage:** Fix typo in storage/doc.go ([#12391](https://github.com/googleapis/google-cloud-go/issues/12391)) ([bf74408](https://github.com/googleapis/google-cloud-go/commit/bf744088f0ed23ea510b914c994e1754ca1fc7c4)) +* **storage:** Improve error inspection documentation ([#12301](https://github.com/googleapis/google-cloud-go/issues/12301)) ([420da1a](https://github.com/googleapis/google-cloud-go/commit/420da1a64ac4040c8b2e6d6f0d66e7633426ac25)) + +## [1.55.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.54.0...storage/v1.55.0) (2025-05-29) + + +### Features + +* **storage/control:** Add Client Libraries Storage IntelligenceConfig ([2aaada3](https://github.com/googleapis/google-cloud-go/commit/2aaada3fb7a9d3eaacec3351019e225c4038646b)) +* **storage/internal:** Add IpFilter to Bucket ([#12309](https://github.com/googleapis/google-cloud-go/issues/12309)) ([d8ae687](https://github.com/googleapis/google-cloud-go/commit/d8ae6874a54b48fce49968664f14db63c055c6e2)) +* **storage/internal:** Add Object.Retention message ([d8ae687](https://github.com/googleapis/google-cloud-go/commit/d8ae6874a54b48fce49968664f14db63c055c6e2)) + + +### Bug Fixes + +* **storage:** Add EnableNewAuthLibrary internalOption to HTTP newClient ([#12320](https://github.com/googleapis/google-cloud-go/issues/12320)) ([0036073](https://github.com/googleapis/google-cloud-go/commit/0036073affee5451894654a983fba6b2638433cb)) +* **storage:** Migrate oauth2/google usages to cloud.google.com/go/auth ([#11191](https://github.com/googleapis/google-cloud-go/issues/11191)) ([3a22349](https://github.com/googleapis/google-cloud-go/commit/3a22349c1ba6a192d70269f77e5804a9957aa572)) +* **storage:** Omit check on MultiRangeDownloader ([#12342](https://github.com/googleapis/google-cloud-go/issues/12342)) ([774621c](https://github.com/googleapis/google-cloud-go/commit/774621c5baa5110f57fe79d817143416bd671d1e)) +* **storage:** Retry url.Error and net.OpErrors when they wrap an io.EOF ([#12289](https://github.com/googleapis/google-cloud-go/issues/12289)) ([080f6b0](https://github.com/googleapis/google-cloud-go/commit/080f6b05c5e8bd5baaef71ed47f8d54c695f63d3)) + + +### Documentation + +* **storage/internal:** Add explicit Optional annotations to fields that have always been treated as optional ([d8ae687](https://github.com/googleapis/google-cloud-go/commit/d8ae6874a54b48fce49968664f14db63c055c6e2)) +* **storage/internal:** Add note that Bucket.project output format is always project number format ([d8ae687](https://github.com/googleapis/google-cloud-go/commit/d8ae6874a54b48fce49968664f14db63c055c6e2)) +* **storage/internal:** Add note that managedFolders are supported for GetIamPolicy and SetIamPolicy ([d8ae687](https://github.com/googleapis/google-cloud-go/commit/d8ae6874a54b48fce49968664f14db63c055c6e2)) + +## [1.54.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.53.0...storage/v1.54.0) (2025-05-12) + + +### Features + +* **storage:** Add experimental ZB API option ([#12214](https://github.com/googleapis/google-cloud-go/issues/12214)) ([f669982](https://github.com/googleapis/google-cloud-go/commit/f669982de2abf64759eccf5c38bd669488b9cf6a)) + + +### Bug Fixes + +* **storage:** Fix append writer hang ([#12201](https://github.com/googleapis/google-cloud-go/issues/12201)) ([7ce2a2a](https://github.com/googleapis/google-cloud-go/commit/7ce2a2ad3ae9deff28c73c1bcc2e7001770464eb)) +* **storage:** Retry unwrapped EOFs ([#12202](https://github.com/googleapis/google-cloud-go/issues/12202)) ([b2d42bd](https://github.com/googleapis/google-cloud-go/commit/b2d42bda6a398f3aa00030b6e99bbcb40f132ff7)) + +## [1.53.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.52.0...storage/v1.53.0) (2025-05-02) + + +### Features + +* **storage/control:** Add Anywhere cache control APIs ([83ae06c](https://github.com/googleapis/google-cloud-go/commit/83ae06c3ec7d190e38856ba4cfd8a13f08356b4d)) + + +### Bug Fixes + +* **storage:** Fix append edge cases ([#12074](https://github.com/googleapis/google-cloud-go/issues/12074)) ([0eee1f9](https://github.com/googleapis/google-cloud-go/commit/0eee1f99a7dc0d1bfc36fa43d78933cae47962ee)) +* **storage:** Fix retries for redirection errors. ([#12093](https://github.com/googleapis/google-cloud-go/issues/12093)) ([3e177e7](https://github.com/googleapis/google-cloud-go/commit/3e177e755f5bf6aa96e8712cc4adcba7eb6f04f6)) +* **storage:** Handle gRPC deadlines in tests. ([#12092](https://github.com/googleapis/google-cloud-go/issues/12092)) ([30b7cd2](https://github.com/googleapis/google-cloud-go/commit/30b7cd27771ccbd49b70ee106da36362ba8f1e87)) +* **storage:** Update offset on resumable upload retry ([#12086](https://github.com/googleapis/google-cloud-go/issues/12086)) ([6ce8fe5](https://github.com/googleapis/google-cloud-go/commit/6ce8fe5aec0ec7916eda4d1405cab5f5f65a5de8)) +* **storage:** Validate Bidi option for MRD ([#12033](https://github.com/googleapis/google-cloud-go/issues/12033)) ([d9018cf](https://github.com/googleapis/google-cloud-go/commit/d9018cf640a9ac25e2b23b75b3bcfa734379ab09)) + + +### Documentation + +* **storage/control:** Added comments for Anywhere cache messages ([83ae06c](https://github.com/googleapis/google-cloud-go/commit/83ae06c3ec7d190e38856ba4cfd8a13f08356b4d)) + +## [1.52.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.51.0...storage/v1.52.0) (2025-04-22) + + +### Features + +* **storage/control:** Add Anywhere cache control APIs ([#11807](https://github.com/googleapis/google-cloud-go/issues/11807)) ([12bfa98](https://github.com/googleapis/google-cloud-go/commit/12bfa984f87099dbfbd5abf3436e440e62b04bad)) +* **storage:** Add CurrentState function to determine state of stream in MRD ([#11688](https://github.com/googleapis/google-cloud-go/issues/11688)) ([14e8e13](https://github.com/googleapis/google-cloud-go/commit/14e8e132d9d5808d1ca789792e7e39f0857991da)) +* **storage:** Add OwnerEntity to bucketAttrs ([#11857](https://github.com/googleapis/google-cloud-go/issues/11857)) ([4cd4a0c](https://github.com/googleapis/google-cloud-go/commit/4cd4a0ca1f6132ea6ed9df7b27310a3238a9c3fd)) +* **storage:** Takeover appendable object ([#11977](https://github.com/googleapis/google-cloud-go/issues/11977)) ([513b937](https://github.com/googleapis/google-cloud-go/commit/513b937420b945c4a76e20711f305c6ad8a77812)) +* **storage:** Unfinalized appendable objects. ([#11647](https://github.com/googleapis/google-cloud-go/issues/11647)) ([52c0218](https://github.com/googleapis/google-cloud-go/commit/52c02183fabf43fcba3893f493140ac28a7836d1)) + + +### Bug Fixes + +* **storage:** Fix Attrs for append takeover ([#11989](https://github.com/googleapis/google-cloud-go/issues/11989)) ([6db35b1](https://github.com/googleapis/google-cloud-go/commit/6db35b10567b7f1463bfef722b0fd72257190ee7)) +* **storage:** Fix panic when Flush called early ([#11934](https://github.com/googleapis/google-cloud-go/issues/11934)) ([7d0b8a7](https://github.com/googleapis/google-cloud-go/commit/7d0b8a75ae55731ae765c01f24920f9f11038f44)) +* **storage:** Fix unfinalized write size ([#12016](https://github.com/googleapis/google-cloud-go/issues/12016)) ([6217f8f](https://github.com/googleapis/google-cloud-go/commit/6217f8fd3cd8680a7e6b7b46fc9b7bda6ee6292e)) +* **storage:** Force first message on next sendBuffer when nothing sent on current ([#11871](https://github.com/googleapis/google-cloud-go/issues/11871)) ([a1a2292](https://github.com/googleapis/google-cloud-go/commit/a1a22927d6a4399e7392787bccb9707bc9e8f149)) +* **storage:** Populate Writer.Attrs after Flush() ([#12021](https://github.com/googleapis/google-cloud-go/issues/12021)) ([8e56f74](https://github.com/googleapis/google-cloud-go/commit/8e56f745e7f2175660838f96c1a12a46841cac40)) +* **storage:** Remove check for FinalizeOnClose ([#11992](https://github.com/googleapis/google-cloud-go/issues/11992)) ([2664b8c](https://github.com/googleapis/google-cloud-go/commit/2664b8cec00a606001184cb17c074fd0e79e66b8)) +* **storage:** Wrap read response parsing errors ([#11951](https://github.com/googleapis/google-cloud-go/issues/11951)) ([d2e6583](https://github.com/googleapis/google-cloud-go/commit/d2e658387b80ec8a3e41e048a9d520b8dd13dd00)) + + +## [1.51.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.50.0...storage/v1.51.0) (2025-03-07) + + +### Features + +* **storage/append:** Support appends in w1r3. ([#11483](https://github.com/googleapis/google-cloud-go/issues/11483)) ([48bb391](https://github.com/googleapis/google-cloud-go/commit/48bb39154479a2cf2d379316e0915f39d7b7a518)) +* **storage:** Benchmark with experimental MRD. ([#11501](https://github.com/googleapis/google-cloud-go/issues/11501)) ([7b49152](https://github.com/googleapis/google-cloud-go/commit/7b491520a693d258d3370a19c43c9dff6c8558c7)) +* **storage:** Implement RetryChunkDeadline for grpc writes ([#11476](https://github.com/googleapis/google-cloud-go/issues/11476)) ([03575d7](https://github.com/googleapis/google-cloud-go/commit/03575d74f5241cc714e4d3ac63635569a34f5633)) +* **storage:** Specify benchmark integrity check. ([#11465](https://github.com/googleapis/google-cloud-go/issues/11465)) ([da18845](https://github.com/googleapis/google-cloud-go/commit/da188453e0254c49a01d28788d0849a2d0e98e0c)) +* **storage:** Use ReadHandle for faster re-connect ([#11510](https://github.com/googleapis/google-cloud-go/issues/11510)) ([cac52f7](https://github.com/googleapis/google-cloud-go/commit/cac52f79a73d46774d33d76e3075c0a5b3e0b9f3)) +* **storage:** Wrap NotFound errors for buckets and objects ([#11519](https://github.com/googleapis/google-cloud-go/issues/11519)) ([0dd7d3d](https://github.com/googleapis/google-cloud-go/commit/0dd7d3d62e54c6c3bca395fcca8450ad3347a5a0)) + + +### Bug Fixes + +* **storage/append:** Report progress for appends. ([#11503](https://github.com/googleapis/google-cloud-go/issues/11503)) ([96dbb6c](https://github.com/googleapis/google-cloud-go/commit/96dbb6c12398fb3cbffab2bf61836bef2f704f66)) +* **storage:** Add a safety check for readhandle ([#11549](https://github.com/googleapis/google-cloud-go/issues/11549)) ([c9edb37](https://github.com/googleapis/google-cloud-go/commit/c9edb379ece70f065650702c9240ee540ca2f610)) +* **storage:** Add universe domain to defaultSignBytesFunc ([#11521](https://github.com/googleapis/google-cloud-go/issues/11521)) ([511608b](https://github.com/googleapis/google-cloud-go/commit/511608b8e8554aa06f9fe2e2e4f51ead0f484031)) +* **storage:** Clone the defaultRetry to avoid modifying it directly ([#11533](https://github.com/googleapis/google-cloud-go/issues/11533)) ([7f8d69d](https://github.com/googleapis/google-cloud-go/commit/7f8d69dcd6a7b1ad6c1df8d9fe8dfb5fe0947479)) +* **storage:** Fix adding multiple range on stream with same read id ([#11584](https://github.com/googleapis/google-cloud-go/issues/11584)) ([0bb3434](https://github.com/googleapis/google-cloud-go/commit/0bb3434e0e12563ff21ef72ad2e52ad7eb61d66e)) +* **storage:** Modify the callback of mrd to return length of data read instead of limit. ([#11687](https://github.com/googleapis/google-cloud-go/issues/11687)) ([9e359f0](https://github.com/googleapis/google-cloud-go/commit/9e359f0089f744c32d12bf77889d69a4db155357)) +* **storage:** Propagate ctx from invoke to grpc upload reqs ([#11475](https://github.com/googleapis/google-cloud-go/issues/11475)) ([9ad9d76](https://github.com/googleapis/google-cloud-go/commit/9ad9d7665ca2f4cfdcee75f5e683084ac49536a6)) +* **storage:** Remove duplicate routing header ([#11534](https://github.com/googleapis/google-cloud-go/issues/11534)) ([8eeb59c](https://github.com/googleapis/google-cloud-go/commit/8eeb59cbfb16d8f379f7aa4c6f11e53cebbd38a6)) +* **storage:** Return sentinel ErrObjectNotExist for copy and compose ([#11369](https://github.com/googleapis/google-cloud-go/issues/11369)) ([74d0c10](https://github.com/googleapis/google-cloud-go/commit/74d0c1096f897ca3c15646f3049ea540bed0a6a0)), refs [#10760](https://github.com/googleapis/google-cloud-go/issues/10760) +* **storage:** Wait for XML read req to finish to avoid data races ([#11527](https://github.com/googleapis/google-cloud-go/issues/11527)) ([782e12a](https://github.com/googleapis/google-cloud-go/commit/782e12a11c1dfe6d831f5d0b9b5f4409993e4d9e)) + ## [1.50.0](https://github.com/googleapis/google-cloud-go/compare/storage/v1.49.0...storage/v1.50.0) (2025-01-09) diff --git a/vendor/cloud.google.com/go/storage/TESTING.md b/vendor/cloud.google.com/go/storage/TESTING.md new file mode 100644 index 00000000000..65871ab58ef --- /dev/null +++ b/vendor/cloud.google.com/go/storage/TESTING.md @@ -0,0 +1,53 @@ +# Testing + +Package storage has unit, emulated integration tests, and integration tests +against the real GCS service. + +## Setup + +Assume that you're running from a directory which contains the `google-cloud-go` +git repository. + +```bash +git clone https://github.com/googleapis/google-cloud-go +git clone https://github.com/googleapis/storage-testbench # emulator +``` + +## Running unit tests + +```bash +go test ./google-cloud-go/storage -short +``` + +## Running emulated integration tests + +See +https://github.com/googleapis/storage-testbench?tab=readme-ov-file#how-to-use-this-testbench +for testbench setup instructions. After following those instructions, you should +have an emulator running an HTTP server on port 9000 and a gRPC server on port +8888. + +```bash +STORAGE_EMULATOR_HOST_GRPC="localhost:8888" STORAGE_EMULATOR_HOST="http://localhost:9000" go test ./google-cloud-go/storage -short -run="^Test(RetryConformance|.*Emulated)" +``` + +If you don't specify the `-run` filter, this will also run unit tests. + +## Running live service integration tests + +See the [general setup instructions](../CONTRIBUTING.md#local-setup) for more +details. The GCS integration tests require: + +- A project configured such that all bucket types can be created (e.g. with and + without UBLA, with and without HNS). A dedicated project which only stores + test data is recommended. +- A JSON key file for a service account with most GCS privileges in that + project. +- A VM in that project. + +Run with: + +```bash +GCLOUD_TESTS_GOLANG_PROJECT_ID="${PROJECT_ID?}" GCLOUD_TESTS_GOLANG_KEY="${KEYFILE?}" \ + go test ./google-cloud-go/storage -run="^Test.*Integration" +``` diff --git a/vendor/cloud.google.com/go/storage/acl.go b/vendor/cloud.google.com/go/storage/acl.go index 560a5605d0b..a894db605a9 100644 --- a/vendor/cloud.google.com/go/storage/acl.go +++ b/vendor/cloud.google.com/go/storage/acl.go @@ -17,7 +17,6 @@ package storage import ( "context" - "cloud.google.com/go/internal/trace" "cloud.google.com/go/storage/internal/apiv2/storagepb" raw "google.golang.org/api/storage/v1" ) @@ -77,8 +76,8 @@ type ACLHandle struct { // Delete permanently deletes the ACL entry for the given entity. func (a *ACLHandle) Delete(ctx context.Context, entity ACLEntity) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.ACL.Delete") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "ACL.Delete") + defer func() { endSpan(ctx, err) }() if a.object != "" { return a.objectDelete(ctx, entity) @@ -91,8 +90,8 @@ func (a *ACLHandle) Delete(ctx context.Context, entity ACLEntity) (err error) { // Set sets the role for the given entity. func (a *ACLHandle) Set(ctx context.Context, entity ACLEntity, role ACLRole) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.ACL.Set") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "ACL.Set") + defer func() { endSpan(ctx, err) }() if a.object != "" { return a.objectSet(ctx, entity, role, false) @@ -105,8 +104,8 @@ func (a *ACLHandle) Set(ctx context.Context, entity ACLEntity, role ACLRole) (er // List retrieves ACL entries. func (a *ACLHandle) List(ctx context.Context) (rules []ACLRule, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.ACL.List") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "ACL.List") + defer func() { endSpan(ctx, err) }() if a.object != "" { return a.objectList(ctx) diff --git a/vendor/cloud.google.com/go/storage/bucket.go b/vendor/cloud.google.com/go/storage/bucket.go index 43161f78382..60a5ffb5b31 100644 --- a/vendor/cloud.google.com/go/storage/bucket.go +++ b/vendor/cloud.google.com/go/storage/bucket.go @@ -26,7 +26,6 @@ import ( "cloud.google.com/go/compute/metadata" "cloud.google.com/go/internal/optional" - "cloud.google.com/go/internal/trace" "cloud.google.com/go/storage/internal/apiv2/storagepb" "google.golang.org/api/googleapi" "google.golang.org/api/iamcredentials/v1" @@ -82,8 +81,8 @@ func (c *Client) Bucket(name string) *BucketHandle { // Create creates the Bucket in the project. // If attrs is nil the API defaults will be used. func (b *BucketHandle) Create(ctx context.Context, projectID string, attrs *BucketAttrs) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Create") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.Create") + defer func() { endSpan(ctx, err) }() o := makeStorageOpts(true, b.retry, b.userProject) @@ -95,8 +94,8 @@ func (b *BucketHandle) Create(ctx context.Context, projectID string, attrs *Buck // Delete deletes the Bucket. func (b *BucketHandle) Delete(ctx context.Context) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Delete") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.Delete") + defer func() { endSpan(ctx, err) }() o := makeStorageOpts(true, b.retry, b.userProject) return b.c.tc.DeleteBucket(ctx, b.name, b.conds, o...) @@ -150,8 +149,8 @@ func (b *BucketHandle) Object(name string) *ObjectHandle { // Attrs returns the metadata for the bucket. func (b *BucketHandle) Attrs(ctx context.Context) (attrs *BucketAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Attrs") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.Attrs") + defer func() { endSpan(ctx, err) }() o := makeStorageOpts(true, b.retry, b.userProject) return b.c.tc.GetBucket(ctx, b.name, b.conds, o...) @@ -159,8 +158,8 @@ func (b *BucketHandle) Attrs(ctx context.Context) (attrs *BucketAttrs, err error // Update updates a bucket's attributes. func (b *BucketHandle) Update(ctx context.Context, uattrs BucketAttrsToUpdate) (attrs *BucketAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Update") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.Update") + defer func() { endSpan(ctx, err) }() isIdempotent := b.conds != nil && b.conds.MetagenerationMatch != 0 o := makeStorageOpts(isIdempotent, b.retry, b.userProject) @@ -200,11 +199,11 @@ func (b *BucketHandle) SignedURL(object string, opts *SignedURLOptions) (string, newopts.GoogleAccessID = id } if newopts.SignBytes == nil && len(newopts.PrivateKey) == 0 { - if b.c.creds != nil && len(b.c.creds.JSON) > 0 { + if j, ok := b.c.credsJSON(); ok { var sa struct { PrivateKey string `json:"private_key"` } - err := json.Unmarshal(b.c.creds.JSON, &sa) + err := json.Unmarshal(j, &sa) if err == nil && sa.PrivateKey != "" { newopts.PrivateKey = []byte(sa.PrivateKey) } @@ -248,11 +247,11 @@ func (b *BucketHandle) GenerateSignedPostPolicyV4(object string, opts *PostPolic newopts.GoogleAccessID = id } if newopts.SignBytes == nil && newopts.SignRawBytes == nil && len(newopts.PrivateKey) == 0 { - if b.c.creds != nil && len(b.c.creds.JSON) > 0 { + if j, ok := b.c.credsJSON(); ok { var sa struct { PrivateKey string `json:"private_key"` } - err := json.Unmarshal(b.c.creds.JSON, &sa) + err := json.Unmarshal(j, &sa) if err == nil && sa.PrivateKey != "" { newopts.PrivateKey = []byte(sa.PrivateKey) } @@ -270,14 +269,14 @@ func (b *BucketHandle) GenerateSignedPostPolicyV4(object string, opts *PostPolic func (b *BucketHandle) detectDefaultGoogleAccessID() (string, error) { returnErr := errors.New("no credentials found on client and not on GCE (Google Compute Engine)") - if b.c.creds != nil && len(b.c.creds.JSON) > 0 { + if j, ok := b.c.credsJSON(); ok { var sa struct { ClientEmail string `json:"client_email"` SAImpersonationURL string `json:"service_account_impersonation_url"` CredType string `json:"type"` } - err := json.Unmarshal(b.c.creds.JSON, &sa) + err := json.Unmarshal(j, &sa) if err != nil { returnErr = err } else { @@ -320,9 +319,19 @@ func (b *BucketHandle) defaultSignBytesFunc(email string) func([]byte) ([]byte, return func(in []byte) ([]byte, error) { ctx := context.Background() + opts := []option.ClientOption{option.WithHTTPClient(b.c.hc)} + + if b.c.creds != nil { + universeDomain, err := b.c.creds.UniverseDomain(ctx) + if err != nil { + return nil, err + } + opts = append(opts, option.WithUniverseDomain(universeDomain)) + } + // It's ok to recreate this service per call since we pass in the http client, // circumventing the cost of recreating the auth/transport layer - svc, err := iamcredentials.NewService(ctx, option.WithHTTPClient(b.c.hc)) + svc, err := iamcredentials.NewService(ctx, opts...) if err != nil { return nil, fmt.Errorf("unable to create iamcredentials client: %w", err) } @@ -505,6 +514,9 @@ type BucketAttrs struct { // It cannot be modified after bucket creation time. // UniformBucketLevelAccess must also also be enabled on the bucket. HierarchicalNamespace *HierarchicalNamespace + + // OwnerEntity contains entity information in the form "project-owner-projectId". + OwnerEntity string } // BucketPolicyOnly is an alias for UniformBucketLevelAccess. @@ -855,6 +867,7 @@ func newBucket(b *raw.Bucket) (*BucketAttrs, error) { Autoclass: toAutoclassFromRaw(b.Autoclass), SoftDeletePolicy: toSoftDeletePolicyFromRaw(b.SoftDeletePolicy), HierarchicalNamespace: toHierarchicalNamespaceFromRaw(b.HierarchicalNamespace), + OwnerEntity: ownerEntityFromRaw(b.Owner), }, nil } @@ -891,6 +904,7 @@ func newBucketFromProto(b *storagepb.Bucket) *BucketAttrs { Autoclass: toAutoclassFromProto(b.GetAutoclass()), SoftDeletePolicy: toSoftDeletePolicyFromProto(b.SoftDeletePolicy), HierarchicalNamespace: toHierarchicalNamespaceFromProto(b.HierarchicalNamespace), + OwnerEntity: ownerEntityFromProto(b.GetOwner()), } } @@ -2215,6 +2229,20 @@ func toHierarchicalNamespaceFromRaw(r *raw.BucketHierarchicalNamespace) *Hierarc } } +func ownerEntityFromRaw(r *raw.BucketOwner) string { + if r == nil { + return "" + } + return r.Entity +} + +func ownerEntityFromProto(p *storagepb.Owner) string { + if p == nil { + return "" + } + return p.GetEntity() +} + // Objects returns an iterator over the objects in the bucket that match the // Query q. If q is nil, no filtering is done. Objects will be iterated over // lexicographically by name. diff --git a/vendor/cloud.google.com/go/storage/client.go b/vendor/cloud.google.com/go/storage/client.go index 1ea1d98ce5d..3e4aceaeb0c 100644 --- a/vendor/cloud.google.com/go/storage/client.go +++ b/vendor/cloud.google.com/go/storage/client.go @@ -16,7 +16,6 @@ package storage import ( "context" - "io" "time" "cloud.google.com/go/iam/apiv1/iampb" @@ -88,7 +87,7 @@ type storageClient interface { RewriteObject(ctx context.Context, req *rewriteObjectRequest, opts ...storageOption) (*rewriteObjectResponse, error) NewRangeReader(ctx context.Context, params *newRangeReaderParams, opts ...storageOption) (*Reader, error) - OpenWriter(params *openWriterParams, opts ...storageOption) (*io.PipeWriter, error) + OpenWriter(params *openWriterParams, opts ...storageOption) (internalWriter, error) // IAM methods. @@ -257,6 +256,9 @@ type openWriterParams struct { // conds - see `Writer.o.conds`. // Optional. conds *Conditions + // appendGen -- object generation to write to. + // Optional; required for taking over appendable objects only + appendGen int64 // encryptionKey - see `Writer.o.encryptionKey` // Optional. encryptionKey []byte @@ -266,6 +268,10 @@ type openWriterParams struct { // append - Write with appendable object semantics. // Optional. append bool + // finalizeOnClose - Finalize the object when the storage.Writer is closed + // successfully. + // Optional. + finalizeOnClose bool // Writer callbacks @@ -281,6 +287,10 @@ type openWriterParams struct { // setObj callback for reporting the resulting object - see `Writer.obj`. // Required. setObj func(*ObjectAttrs) + // setSize callback for updated the persisted size in Writer.obj. + setSize func(int64) + // setTakeoverOffset callback for returning offset to start writing from to Writer. + setTakeoverOffset func(int64) } type newMultiRangeDownloaderParams struct { diff --git a/vendor/cloud.google.com/go/storage/doc.go b/vendor/cloud.google.com/go/storage/doc.go index 4fcfb732648..6a64c6c03b2 100644 --- a/vendor/cloud.google.com/go/storage/doc.go +++ b/vendor/cloud.google.com/go/storage/doc.go @@ -274,15 +274,43 @@ To generate the signature, you must have: # Errors -Errors returned by this client are often of the type [googleapi.Error]. -These errors can be introspected for more information by using [errors.As] -with the richer [googleapi.Error] type. For example: +Errors returned by this client are often of the type [github.com/googleapis/gax-go/v2/apierror]. +The [apierror.APIError] type can wrap a [google.golang.org/grpc/status.Status] +if gRPC was used, or a [google.golang.org/api/googleapi.Error] if HTTP/REST was used. +You might also encounter [googleapi.Error] directly from HTTP operations. +These types of errors can be inspected for more information by using [errors.As] +to access the specific underlying error types and retrieve detailed information, +including HTTP or gRPC status codes. For example: + + // APIErrors often wrap a googleapi.Error (for JSON and XML calls) or a status.Status (for gRPC calls) + var ae *apierror.APIError + if ok := errors.As(err, &ae); ok { + // ae.HTTPCode() is the HTTP status code. + // ae.GRPCStatus().Code() is the gRPC status code + log.Printf("APIError: HTTPCode: %d, GRPCStatusCode: %s", ae.HTTPCode(), ae.GRPCStatus().Code()) + + if ae.GRPCStatus().Code() == codes.Unavailable { + // ... handle gRPC unavailable ... + } + } + // This allows a user to get more information directly from googleapi.Errors (for JSON/XML calls) var e *googleapi.Error if ok := errors.As(err, &e); ok { - if e.Code == 409 { ... } + // e.Code is the HTTP status code. + // e.Message is the error message. + // e.Body is the raw response body. + // e.Header contains the HTTP response headers. + log.Printf("HTTP Code: %d, Message: %s", e.Code, e.Message) + + if e.Code == 409 { + // ... handle conflict ... + } } +This library may also return other errors that are not wrapped as [apierror.APIError]. For +example, errors with authentication may return [cloud.google.com/go/auth.Error]. + # Retrying failed requests Methods in this package may retry calls that fail with transient errors. @@ -333,12 +361,13 @@ to add a [custom audit logging] header: # gRPC API -This package includes support for the Cloud Storage gRPC API. The -implementation uses gRPC rather than the Default -JSON & XML APIs to make requests to Cloud Storage. -The Go Storage gRPC client is generally available. -The Notifications, Serivce Account HMAC -and GetServiceAccount RPCs are not supported through the gRPC client. +This package includes support for the [Cloud Storage gRPC API]. This +implementation uses gRPC rather than the default JSON & XML APIs +to make requests to Cloud Storage. All methods on the [Client] support +the gRPC API, with the exception of [GetServiceAccount], [Notification], +and [HMACKey] methods. + +The Cloud Storage gRPC API is generally available. To create a client which will use gRPC, use the alternate constructor: @@ -349,43 +378,31 @@ To create a client which will use gRPC, use the alternate constructor: } // Use client as usual. -Using the gRPC API inside GCP with a bucket in the same region can allow for -[Direct Connectivity] (enabling requests to skip some proxy steps and reducing -response latency). A warning is emmitted if gRPC is not used within GCP to -warn that Direct Connectivity could not be initialized. Direct Connectivity -is not required to access the gRPC API. +One major advantage of the gRPC API is that it can use [Direct Connectivity], +enabling requests to skip some proxy steps and reducing response latency. +Requirements to use Direct Connectivity include: + + - Your application must be running inside Google Cloud. + - Your Cloud Storage [bucket location] must overlap with your VM or compute + environment zone. For example, if your VM is in us-east1a, your bucket + must be located in either us-east1 (single region), nam4 (dual region), + or us (multi-region). + - Your client must use service account authentication. + +Additional requirements for Direct Connectivity are documented in the +[Cloud Storage gRPC docs]. Dependencies for the gRPC API may slightly increase the size of binaries for applications depending on this package. If you are not using gRPC, you can use the build tag `disable_grpc_modules` to opt out of these dependencies and reduce the binary size. -The gRPC client emits metrics by default and will export the -gRPC telemetry discussed in [gRFC/66] and [gRFC/78] to -[Google Cloud Monitoring]. The metrics are accessible through Cloud Monitoring -API and you incur no additional cost for publishing the metrics. Google Cloud -Support can use this information to more quickly diagnose problems related to -GCS and gRPC. -Sending this data does not incur any billing charges, and requires minimal -CPU (a single RPC every minute) or memory (a few KiB to batch the -telemetry). - -To access the metrics you can view them through Cloud Monitoring -[metric explorer] with the prefix `storage.googleapis.com/client`. Metrics are emitted -every minute. - -You can disable metrics using the following example when creating a new gRPC -client using [WithDisabledClientMetrics]. - -The metrics exporter uses Cloud Monitoring API which determines -project ID and credentials doing the following: - -* Project ID is determined using OTel Resource Detector for the environment -otherwise it falls back to the project provided by [google.FindCredentials]. - -* Credentials are determined using [Application Default Credentials]. The -principal must have `roles/monitoring.metricWriter` role granted. If not a -logged warning will be emitted. Subsequent are silenced to prevent noisy logs. +The gRPC client is instrumented with Open Telemetry metrics which export to +Cloud Monitoring by default. More information is available in the +[gRPC client-side metrics] documentation, including information about +roles which must be enabled in order to do the export successfully. To +disable this export, you can use the [WithDisabledClientMetrics] client +option. # Storage Control API @@ -394,11 +411,6 @@ and Managed Folder operations) are supported via the autogenerated Storage Contr client, which is available as a subpackage in this module. See package docs at [cloud.google.com/go/storage/control/apiv2] or reference the [Storage Control API] docs. -[Application Default Credentials]: https://cloud.google.com/docs/authentication/application-default-credentials -[google.FindCredentials]: https://pkg.go.dev/golang.org/x/oauth2/google#FindDefaultCredentials -[gRFC/66]: https://github.com/grpc/proposal/blob/master/A66-otel-stats.md -[gRFC/78]: https://github.com/grpc/proposal/blob/master/A78-grpc-metrics-wrr-pf-xds.md -[Google Cloud Monitoring]: https://cloud.google.com/monitoring/docs [Cloud Storage IAM docs]: https://cloud.google.com/storage/docs/access-control/iam [XML POST Object docs]: https://cloud.google.com/storage/docs/xml-api/post-object [Cloud Storage retry docs]: https://cloud.google.com/storage/docs/retry-strategy @@ -408,7 +420,10 @@ client, which is available as a subpackage in this module. See package docs at [IAM Service Account Credentials API]: https://console.developers.google.com/apis/api/iamcredentials.googleapis.com/overview [custom audit logging]: https://cloud.google.com/storage/docs/audit-logging#add-custom-metadata [Storage Control API]: https://cloud.google.com/storage/docs/reference/rpc/google.storage.control.v2 -[metric explorer]: https://console.cloud.google.com/projectselector/monitoring/metrics-explorer +[Cloud Storage gRPC API]: https://cloud.google.com/storage/docs/enable-grpc-api [Direct Connectivity]: https://cloud.google.com/vpc-service-controls/docs/set-up-private-connectivity#direct-connectivity +[bucket location]: https://cloud.google.com/storage/docs/locations +[Cloud Storage gRPC docs]: https://cloud.google.com/storage/docs/enable-grpc-api#limitations +[gRPC client-side metrics]: https://cloud.google.com/storage/docs/client-side-metrics */ package storage // import "cloud.google.com/go/storage" diff --git a/vendor/cloud.google.com/go/storage/emulator_test.sh b/vendor/cloud.google.com/go/storage/emulator_test.sh index 258201ec9e6..4d8da2eeb37 100644 --- a/vendor/cloud.google.com/go/storage/emulator_test.sh +++ b/vendor/cloud.google.com/go/storage/emulator_test.sh @@ -89,4 +89,5 @@ then fi # Run tests -go test -v -timeout 15m ./ ./dataflux -run="^Test(RetryConformance|.*Emulated)$" -short 2>&1 | tee -a sponge_log.log + +go test -v -timeout 17m ./ ./dataflux -run="^Test(RetryConformance|.*Emulated)$" -short -race 2>&1 | tee -a sponge_log.log diff --git a/vendor/cloud.google.com/go/storage/experimental/experimental.go b/vendor/cloud.google.com/go/storage/experimental/experimental.go index 5bcc59ad2f4..a178f9ebb31 100644 --- a/vendor/cloud.google.com/go/storage/experimental/experimental.go +++ b/vendor/cloud.google.com/go/storage/experimental/experimental.go @@ -77,7 +77,8 @@ type ReadStallTimeoutConfig struct { // WithGRPCBidiReads provides an [option.ClientOption] that may be passed to // [cloud.google.com/go/storage.NewGRPCClient]. // It enables the client to use bi-directional gRPC APIs for downloads rather than the -// server streaming API. In particular, it allows users to use the [storage.MultiRangeDownloader] +// server streaming API. In particular, it allows users to use the +// [cloud.google.com/go/storage.MultiRangeDownloader] // surface, which requires bi-directional streaming. // // The bi-directional API is in private preview; please contact your account manager if @@ -85,3 +86,16 @@ type ReadStallTimeoutConfig struct { func WithGRPCBidiReads() option.ClientOption { return internal.WithGRPCBidiReads.(func() option.ClientOption)() } + +// WithZonalBucketAPIs provides an [option.ClientOption] that may be passed to +// [cloud.google.com/go/storage.NewGRPCClient]. +// It enables the client to use bi-directional gRPC APIs for downloads rather than the +// server streaming API (same as [WithGRPCBidiReads]) as well as appendable +// object semantics for uploads. By setting this option, both upload and download +// paths will use zonal bucket compatible APIs by default. +// +// Zonal buckets and rapid storage is in private preview; please contact your +// account manager if interested. +func WithZonalBucketAPIs() option.ClientOption { + return internal.WithZonalBucketAPIs.(func() option.ClientOption)() +} diff --git a/vendor/cloud.google.com/go/storage/grpc_client.go b/vendor/cloud.google.com/go/storage/grpc_client.go index 2d243bf9fe1..19c969f7392 100644 --- a/vendor/cloud.google.com/go/storage/grpc_client.go +++ b/vendor/cloud.google.com/go/storage/grpc_client.go @@ -22,7 +22,6 @@ import ( "hash/crc32" "io" "log" - "net/url" "os" "sync" @@ -31,7 +30,6 @@ import ( gapic "cloud.google.com/go/storage/internal/apiv2" "cloud.google.com/go/storage/internal/apiv2/storagepb" "github.com/googleapis/gax-go/v2" - "google.golang.org/api/googleapi" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" @@ -57,12 +55,6 @@ const ( // This is only used for the gRPC client. defaultConnPoolSize = 1 - // maxPerMessageWriteSize is the maximum amount of content that can be sent - // per WriteObjectRequest message. A buffer reaching this amount will - // precipitate a flush of the buffer. It is only used by the gRPC Writer - // implementation. - maxPerMessageWriteSize int = int(storagepb.ServiceConstants_MAX_WRITE_CHUNK_BYTES) - // globalProjectAlias is the project ID alias used for global buckets. // // This is only used for the gRPC API. @@ -72,6 +64,10 @@ const ( // // This is only used for the gRPC API. msgEntityNotSupported = "The gRPC API currently does not support ACL entities using project ID, use project numbers instead" + + // Default value for Read ID on BidiReadObject streams. Used for NewRangeReader + // which only does a single read per stream. + defaultReadID = 1 ) // defaultGRPCOptions returns a set of the default client options @@ -105,6 +101,7 @@ func defaultGRPCOptions() []option.ClientOption { // Only enable DirectPath when the emulator is not being targeted. defaults = append(defaults, internaloption.EnableDirectPath(true), + internaloption.AllowNonDefaultServiceAccount(true), internaloption.EnableDirectPathXds()) } @@ -139,7 +136,7 @@ func enableClientMetrics(ctx context.Context, s *settings, config storageConfig) // newGRPCStorageClient initializes a new storageClient that uses the gRPC // Storage API. -func newGRPCStorageClient(ctx context.Context, opts ...storageOption) (storageClient, error) { +func newGRPCStorageClient(ctx context.Context, opts ...storageOption) (*grpcStorageClient, error) { s := initSettings(opts...) s.clientOption = append(defaultGRPCOptions(), s.clientOption...) // Disable all gax-level retries in favor of retry logic in the veneer client. @@ -305,17 +302,11 @@ func (c *grpcStorageClient) GetBucket(ctx context.Context, bucket string, conds var battrs *BucketAttrs err := run(ctx, func(ctx context.Context) error { res, err := c.raw.GetBucket(ctx, req, s.gax...) - battrs = newBucketFromProto(res) - return err }, s.retry, s.idempotent) - if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return nil, ErrBucketNotExist - } - - return battrs, err + return battrs, formatBucketError(err) } func (c *grpcStorageClient) UpdateBucket(ctx context.Context, bucket string, uattrs *BucketAttrsToUpdate, conds *BucketConditions, opts ...storageOption) (*BucketAttrs, error) { s := callSettings(c.settings, opts...) @@ -465,6 +456,9 @@ func (c *grpcStorageClient) ListObjects(ctx context.Context, bucket string, q *Q ctx = setUserProjectMetadata(ctx, s.userProject) } fetch := func(pageSize int, pageToken string) (token string, err error) { + // Add trace span around List API call within the fetch. + ctx, _ = startSpan(ctx, "grpcStorageClient.ObjectsListCall") + defer func() { endSpan(ctx, err) }() var objects []*storagepb.Object var gitr *gapic.ObjectIterator err = run(it.ctx, func(ctx context.Context) error { @@ -474,10 +468,7 @@ func (c *grpcStorageClient) ListObjects(ctx context.Context, bucket string, q *Q return err }, s.retry, s.idempotent) if err != nil { - if st, ok := status.FromError(err); ok && st.Code() == codes.NotFound { - err = ErrBucketNotExist - } - return "", err + return "", formatBucketError(err) } for _, obj := range objects { @@ -519,7 +510,7 @@ func (c *grpcStorageClient) DeleteObject(ctx context.Context, bucket, object str return c.raw.DeleteObject(ctx, req, s.gax...) }, s.retry, s.idempotent) if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return ErrObjectNotExist + return formatObjectErr(err) } return err } @@ -554,7 +545,7 @@ func (c *grpcStorageClient) GetObject(ctx context.Context, params *getObjectPara }, s.retry, s.idempotent) if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return nil, ErrObjectNotExist + return nil, formatObjectErr(err) } return attrs, err @@ -650,7 +641,7 @@ func (c *grpcStorageClient) UpdateObject(ctx context.Context, params *updateObje return err }, s.retry, s.idempotent) if e, ok := status.FromError(err); ok && e.Code() == codes.NotFound { - return nil, ErrObjectNotExist + return nil, formatObjectErr(err) } return attrs, err @@ -677,7 +668,7 @@ func (c *grpcStorageClient) RestoreObject(ctx context.Context, params *restoreOb return err }, s.retry, s.idempotent) if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return nil, ErrObjectNotExist + return nil, formatObjectErr(err) } return attrs, err } @@ -707,7 +698,7 @@ func (c *grpcStorageClient) MoveObject(ctx context.Context, params *moveObjectPa return err }, s.retry, s.idempotent) if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return nil, ErrObjectNotExist + return nil, formatObjectErr(err) } return attrs, err } @@ -949,6 +940,9 @@ func (c *grpcStorageClient) ComposeObject(ctx context.Context, req *composeObjec obj, err = c.raw.ComposeObject(ctx, rawReq, s.gax...) return err }, s.retry, s.idempotent); err != nil { + if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { + return nil, formatObjectErr(err) + } return nil, err } @@ -998,6 +992,9 @@ func (c *grpcStorageClient) RewriteObject(ctx context.Context, req *rewriteObjec retryCall := func(ctx context.Context) error { res, err = c.raw.RewriteObject(ctx, call, s.gax...); return err } if err := run(ctx, retryCall, s.retry, s.idempotent); err != nil { + if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { + return nil, formatObjectErr(err) + } return nil, err } @@ -1064,19 +1061,18 @@ func contextMetadataFromBidiReadObject(req *storagepb.BidiReadObjectRequest) []s return []string{"x-goog-request-params", fmt.Sprintf("bucket=%s", req.GetReadObjectSpec().GetBucket())} } -type rangeSpec struct { - readID int64 - writer io.Writer - offset int64 - limit int64 - bytesWritten int64 - callback func(int64, int64, error) -} - func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params *newMultiRangeDownloaderParams, opts ...storageOption) (mr *MultiRangeDownloader, err error) { + if !c.config.grpcBidiReads { + return nil, errors.New("storage: MultiRangeDownloader requires the experimental.WithGRPCBidiReads option") + } + ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.grpcStorageClient.NewMultiRangeDownloader") defer func() { trace.EndSpan(ctx, err) }() s := callSettings(c.settings, opts...) + // Force the use of the custom codec to enable zero-copy reads. + s.gax = append(s.gax, gax.WithGRPCOptions( + grpc.ForceCodecV2(bytesCodecV2{}), + )) if s.userProject != "" { ctx = setUserProjectMetadata(ctx, s.userProject) @@ -1084,7 +1080,7 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params b := bucketResourceName(globalProjectAlias, params.bucket) object := params.object - r := &storagepb.BidiReadObjectSpec{ + bidiObject := &storagepb.BidiReadObjectSpec{ Bucket: b, Object: object, CommonObjectRequestParams: toProtoCommonObjectRequestParams(params.encryptionKey), @@ -1092,26 +1088,31 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params // The default is a negative value, which means latest. if params.gen >= 0 { - r.Generation = params.gen + bidiObject.Generation = params.gen } - if params.handle != nil { - r.ReadHandle = &storagepb.BidiReadHandle{ + if params.handle != nil && len(*params.handle) != 0 { + bidiObject.ReadHandle = &storagepb.BidiReadHandle{ Handle: *params.handle, } } req := &storagepb.BidiReadObjectRequest{ - ReadObjectSpec: r, + ReadObjectSpec: bidiObject, } ctx = gax.InsertMetadataIntoOutgoingContext(ctx, contextMetadataFromBidiReadObject(req)...) - openStream := func() (*bidiReadStreamResponse, context.CancelFunc, error) { - if err := applyCondsProto("grpcStorageClient.BidiReadObject", params.gen, params.conds, r); err != nil { + openStream := func(readHandle ReadHandle) (*bidiReadStreamResponse, context.CancelFunc, error) { + if err := applyCondsProto("grpcStorageClient.BidiReadObject", params.gen, params.conds, bidiObject); err != nil { return nil, nil, err } + if len(readHandle) != 0 { + req.GetReadObjectSpec().ReadHandle = &storagepb.BidiReadHandle{ + Handle: readHandle, + } + } var stream storagepb.Storage_BidiReadObjectClient - var resp *storagepb.BidiReadObjectResponse + var decoder *readResponseDecoder cc, cancel := context.WithCancel(ctx) err = run(cc, func(ctx context.Context) error { stream, err = c.raw.BidiReadObject(ctx, s.gax...) @@ -1122,9 +1123,9 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params details := rpcStatus.Details() for _, detail := range details { if bidiError, ok := detail.(*storagepb.BidiReadObjectRedirectedError); ok { - r.ReadHandle = bidiError.ReadHandle - r.RoutingToken = bidiError.RoutingToken - req.ReadObjectSpec = r + bidiObject.ReadHandle = bidiError.ReadHandle + bidiObject.RoutingToken = bidiError.RoutingToken + req.ReadObjectSpec = bidiObject ctx = gax.InsertMetadataIntoOutgoingContext(ctx, contextMetadataFromBidiReadObject(req)...) } } @@ -1136,11 +1137,19 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params if err != nil { return err } - resp, err = stream.Recv() + // Use RecvMsg to get the raw buffer slice instead of Recv(). + databufs := mem.BufferSlice{} + err = stream.RecvMsg(&databufs) if err != nil { return err } - return nil + + // Use the custom decoder to parse the raw buffer without copying object data. + decoder = &readResponseDecoder{ + databufs: databufs, + } + err = decoder.readFullObjectResponse() + return err }, s.retry, s.idempotent) if err != nil { // Close the stream context we just created to ensure we don't leak @@ -1148,73 +1157,72 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params cancel() return nil, nil, err } - return &bidiReadStreamResponse{stream: stream, response: resp}, cancel, nil + return &bidiReadStreamResponse{stream: stream, decoder: decoder}, cancel, nil } // For the first time open stream without adding any range. - resp, cancel, err := openStream() + resp, cancel, err := openStream(nil) if err != nil { return nil, err } // The first message was Recv'd on stream open, use it to populate the // object metadata. - msg := resp.response + msg := resp.decoder.msg obj := msg.GetMetadata() - // This is the size of the entire object, even if only a range was requested. - size := obj.GetSize() - rr := &gRPCBidiReader{ + mrd := &gRPCBidiReader{ stream: resp.stream, cancel: cancel, settings: s, readHandle: msg.GetReadHandle().GetHandle(), - readID: 1, + readIDGenerator: &readIDGenerator{}, reopen: openStream, - readSpec: r, - data: make(chan []rangeSpec, 100), + readSpec: bidiObject, + rangesToRead: make(chan []mrdRange, 100), ctx: ctx, closeReceiver: make(chan bool, 10), - closeManager: make(chan bool, 10), - managerRetry: make(chan bool), // create unbuffered channel for closing the streamManager goroutine. + closeSender: make(chan bool, 10), + senderRetry: make(chan bool), // create unbuffered channel for closing the streamManager goroutine. receiverRetry: make(chan bool), // create unbuffered channel for closing the streamReceiver goroutine. - mp: make(map[int64]rangeSpec), + activeRanges: make(map[int64]mrdRange), done: false, - activeTask: 0, + numActiveRanges: 0, streamRecreation: false, } - // streamManager goroutine runs in background where we send message to gcs and process response. - streamManager := func() { - var currentSpec []rangeSpec + // sender receives ranges from user adds and requests these ranges from GCS. + sender := func() { + var currentSpec []mrdRange for { select { - case <-rr.ctx.Done(): - rr.mu.Lock() - rr.done = true - rr.mu.Unlock() + case <-mrd.ctx.Done(): + mrd.mu.Lock() + mrd.done = true + mrd.mu.Unlock() return - case <-rr.managerRetry: + case <-mrd.senderRetry: return - case <-rr.closeManager: - rr.mu.Lock() - if len(rr.mp) != 0 { - for key := range rr.mp { - rr.mp[key].callback(rr.mp[key].offset, rr.mp[key].limit, fmt.Errorf("stream closed early")) - delete(rr.mp, key) + case <-mrd.closeSender: + mrd.mu.Lock() + if len(mrd.activeRanges) != 0 { + for key := range mrd.activeRanges { + mrd.activeRanges[key].callback(mrd.activeRanges[key].offset, mrd.activeRanges[key].totalBytesWritten, fmt.Errorf("stream closed early")) + delete(mrd.activeRanges, key) } } - rr.mu.Unlock() + mrd.numActiveRanges = 0 + mrd.mu.Unlock() return - case currentSpec = <-rr.data: + case currentSpec = <-mrd.rangesToRead: var readRanges []*storagepb.ReadRange var err error - rr.mu.Lock() + mrd.mu.Lock() for _, v := range currentSpec { - rr.mp[v.readID] = v + mrd.activeRanges[v.readID] = v readRanges = append(readRanges, &storagepb.ReadRange{ReadOffset: v.offset, ReadLength: v.limit, ReadId: v.readID}) } - rr.mu.Unlock() + mrd.mu.Unlock() // We can just send 100 request to gcs in one request. // In case of Add we will send only one range request to gcs but in case of retry we can have more than 100 ranges. // Hence be will divide the request in chunk of 100. @@ -1230,13 +1238,13 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params end = len(readRanges) } curReq := readRanges[start:end] - err = rr.stream.Send(&storagepb.BidiReadObjectRequest{ + err = mrd.stream.Send(&storagepb.BidiReadObjectRequest{ ReadRanges: curReq, }) if err != nil { // cancel stream and reopen the stream again. // Incase again an error is thrown close the streamManager goroutine. - rr.retrier(err, "manager") + mrd.retrier(err, "manager") break } } @@ -1245,122 +1253,146 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params } } - streamReceiver := func() { - var resp *storagepb.BidiReadObjectResponse + // receives ranges responses on the stream and executes the callback. + receiver := func() { var err error for { select { - case <-rr.ctx.Done(): - rr.done = true + case <-mrd.ctx.Done(): + mrd.done = true return - case <-rr.receiverRetry: + case <-mrd.receiverRetry: return - case <-rr.closeReceiver: + case <-mrd.closeReceiver: return default: // This function reads the data sent for a particular range request and has a callback // to indicate that output buffer is filled. - resp, err = rr.stream.Recv() - if resp.GetReadHandle().GetHandle() != nil { - rr.readHandle = resp.GetReadHandle().GetHandle() - } + databufs := mem.BufferSlice{} + err = mrd.stream.RecvMsg(&databufs) if err == io.EOF { err = nil - } - if err != nil { - // cancel stream and reopen the stream again. - // Incase again an error is thrown close the streamManager goroutine. - rr.retrier(err, "receiver") + } else { + // Cancel stream and reopen the stream again. + // In case again an error is thrown, close the streamManager goroutine. + // TODO: special handling for not found error. + mrd.retrier(err, "receiver") } if err == nil { - rr.mu.Lock() - if len(rr.mp) == 0 && rr.activeTask == 0 { - rr.closeReceiver <- true - rr.closeManager <- true + // Use the custom decoder to parse the message. + decoder := &readResponseDecoder{databufs: databufs} + if err := decoder.readFullObjectResponse(); err != nil { + mrd.retrier(err, "receiver") + continue // Move to next iteration after retry + } + msg := decoder.msg + + if msg.GetReadHandle().GetHandle() != nil { + mrd.readHandle = msg.GetReadHandle().GetHandle() + } + + mrd.mu.Lock() + if len(mrd.activeRanges) == 0 && mrd.numActiveRanges == 0 { + mrd.mu.Unlock() + mrd.closeReceiver <- true + mrd.closeSender <- true return } - rr.mu.Unlock() - arr := resp.GetObjectDataRanges() - for _, val := range arr { + mrd.mu.Unlock() + for _, val := range msg.GetObjectDataRanges() { id := val.GetReadRange().GetReadId() - rr.mu.Lock() - _, err = rr.mp[id].writer.Write(val.GetChecksummedData().GetContent()) - if err != nil { - rr.mp[id].callback(rr.mp[id].offset, rr.mp[id].limit, err) - rr.activeTask-- - delete(rr.mp, id) - } else { - rr.mp[id] = rangeSpec{ - readID: rr.mp[id].readID, - writer: rr.mp[id].writer, - offset: rr.mp[id].offset, - limit: rr.mp[id].limit, - bytesWritten: rr.mp[id].bytesWritten + int64(len(val.GetChecksummedData().GetContent())), - callback: rr.mp[id].callback, + func() { + mrd.mu.Lock() + defer mrd.mu.Unlock() + currRange, ok := mrd.activeRanges[id] + if !ok { + // it's ok to ignore responses for read_id not in map as user would have been notified by callback. + return } - } - if val.GetRangeEnd() { - rr.mp[id].callback(rr.mp[id].offset, rr.mp[id].limit, nil) - rr.activeTask-- - delete(rr.mp, id) - } - rr.mu.Unlock() + + // The decoder holds the object content. writeToAndUpdateCRC writes + // it to the user's buffer without an intermediate copy. + written, _, err := decoder.writeToAndUpdateCRC(currRange.writer, id, func(b []byte) { + // crc update logic can be added here if needed + }) + + if err != nil { + currRange.callback(currRange.offset, currRange.totalBytesWritten, err) + mrd.numActiveRanges-- + delete(mrd.activeRanges, id) + } else { + currRange = mrdRange{ + readID: currRange.readID, + writer: currRange.writer, + offset: currRange.offset, + limit: currRange.limit, + currentBytesWritten: currRange.currentBytesWritten + written, + totalBytesWritten: currRange.totalBytesWritten + written, + callback: currRange.callback, + } + mrd.activeRanges[id] = currRange + } + if val.GetRangeEnd() { + currRange.callback(currRange.offset, currRange.totalBytesWritten, nil) + mrd.numActiveRanges-- + delete(mrd.activeRanges, id) + } + }() } + // Free the buffers once the message has been processed. + decoder.databufs.Free() } - } } } - rr.retrier = func(err error, thread string) { - rr.mu.Lock() - if !rr.streamRecreation { - rr.streamRecreation = true + mrd.retrier = func(err error, thread string) { + mrd.mu.Lock() + if !mrd.streamRecreation { + mrd.streamRecreation = true } else { - rr.mu.Unlock() + mrd.mu.Unlock() return } - rr.mu.Unlock() + mrd.mu.Unlock() // close both the go routines to make the stream recreation syncronous. if thread == "receiver" { - rr.managerRetry <- true + mrd.senderRetry <- true } else { - rr.receiverRetry <- true + mrd.receiverRetry <- true } - err = rr.retryStream(err) + err = mrd.retryStream(err) if err != nil { - rr.mu.Lock() - for key := range rr.mp { - rr.mp[key].callback(rr.mp[key].offset, rr.mp[key].limit, err) - delete(rr.mp, key) + mrd.mu.Lock() + for key := range mrd.activeRanges { + mrd.activeRanges[key].callback(mrd.activeRanges[key].offset, mrd.activeRanges[key].totalBytesWritten, err) + delete(mrd.activeRanges, key) } - rr.mu.Unlock() - rr.close() + // In case we hit an permanent error, delete entries from map and remove active tasks. + mrd.numActiveRanges = 0 + mrd.mu.Unlock() + mrd.close() } else { // If stream recreation happened successfully lets again start // both the goroutine making the whole flow asynchronous again. if thread == "receiver" { - go streamManager() + go sender() } else { - go streamReceiver() + go receiver() } } - rr.mu.Lock() - rr.streamRecreation = false - rr.mu.Unlock() + mrd.mu.Lock() + mrd.streamRecreation = false + mrd.mu.Unlock() } - rr.mu.Lock() - rr.objectSize = size - rr.mu.Unlock() - - go streamManager() - go streamReceiver() + go sender() + go receiver() return &MultiRangeDownloader{ Attrs: ReaderObjectAttrs{ - Size: size, + Size: obj.GetSize(), // this is the size of the entire object, even if only a range was requested. ContentType: obj.GetContentType(), ContentEncoding: obj.GetContentEncoding(), CacheControl: obj.GetCacheControl(), @@ -1368,120 +1400,194 @@ func (c *grpcStorageClient) NewMultiRangeDownloader(ctx context.Context, params Metageneration: obj.GetMetageneration(), Generation: obj.GetGeneration(), }, - reader: rr, + reader: mrd, }, nil } -func getActiveRange(r *gRPCBidiReader) []rangeSpec { - r.mu.Lock() - defer r.mu.Unlock() - var activeRange []rangeSpec - for k, v := range r.mp { - activeRange = append(activeRange, rangeSpec{ - readID: k, - writer: v.writer, - offset: (v.offset + v.bytesWritten), - limit: v.limit - v.bytesWritten, - callback: v.callback, - bytesWritten: 0, +type gRPCBidiReader struct { + ctx context.Context + stream storagepb.Storage_BidiReadObjectClient + cancel context.CancelFunc + settings *settings + readHandle ReadHandle + readIDGenerator *readIDGenerator + reopen func(ReadHandle) (*bidiReadStreamResponse, context.CancelFunc, error) + readSpec *storagepb.BidiReadObjectSpec + closeReceiver chan bool + closeSender chan bool + senderRetry chan bool + receiverRetry chan bool + // rangesToRead are ranges that have not yet been sent or have been sent but + // must be retried. + rangesToRead chan []mrdRange + // activeRanges are ranges that are currently being sent or are waiting for + // a response from GCS. + activeRanges map[int64]mrdRange // always use the mutex when accessing the map + numActiveRanges int64 // always use the mutex when accessing this variable + done bool // always use the mutex when accessing this variable, indicates whether stream is closed or not. + mu sync.Mutex // protects all vars in gRPCBidiReader from concurrent access + retrier func(error, string) + streamRecreation bool // This helps us identify if stream recreation is in progress or not. If stream recreation gets called from two goroutine then this will stop second one. +} + +func (mrd *gRPCBidiReader) activeRange() []mrdRange { + mrd.mu.Lock() + defer mrd.mu.Unlock() + var activeRange []mrdRange + for k, v := range mrd.activeRanges { + activeRange = append(activeRange, mrdRange{ + readID: k, + writer: v.writer, + offset: (v.offset + v.currentBytesWritten), + limit: v.limit - v.currentBytesWritten, + callback: v.callback, + currentBytesWritten: 0, + totalBytesWritten: v.totalBytesWritten, }) - r.mp[k] = activeRange[len(activeRange)-1] + mrd.activeRanges[k] = activeRange[len(activeRange)-1] } return activeRange } // retryStream cancel's stream and reopen the stream again. -func (r *gRPCBidiReader) retryStream(err error) error { - var shouldRetry = ShouldRetry - if r.settings.retry != nil && r.settings.retry.shouldRetry != nil { - shouldRetry = r.settings.retry.shouldRetry - } - if shouldRetry(err) { +func (mrd *gRPCBidiReader) retryStream(err error) error { + if mrd.settings.retry.runShouldRetry(err) { // This will "close" the existing stream and immediately attempt to // reopen the stream, but will backoff if further attempts are necessary. // When Reopening the stream only failed readID will be added to stream. - return r.reopenStream(getActiveRange(r)) + return mrd.reopenStream(mrd.activeRange()) } return err } // reopenStream "closes" the existing stream and attempts to reopen a stream and // sets the Reader's stream and cancelStream properties in the process. -func (r *gRPCBidiReader) reopenStream(failSpec []rangeSpec) error { +func (mrd *gRPCBidiReader) reopenStream(failSpec []mrdRange) error { // Close existing stream and initialize new stream with updated offset. - if r.cancel != nil { - r.cancel() + if mrd.cancel != nil { + mrd.cancel() } - res, cancel, err := r.reopen() + res, cancel, err := mrd.reopen(mrd.readHandle) if err != nil { return err } - r.stream = res.stream - r.cancel = cancel - r.readHandle = res.response.GetReadHandle().GetHandle() + mrd.stream = res.stream + mrd.cancel = cancel + msg := res.decoder.msg + if msg.GetReadHandle().GetHandle() != nil { + mrd.readHandle = msg.GetReadHandle().GetHandle() + } + + // Process any data ranges that came back in the initial response. + // This prevents data loss from the first message on the new stream. + for _, val := range msg.GetObjectDataRanges() { + id := val.GetReadRange().GetReadId() + mrd.mu.Lock() + activeRange, ok := mrd.activeRanges[id] + if !ok { + mrd.mu.Unlock() + continue + } + + // Use the decoder's zero-copy write method. + written, _, writeErr := res.decoder.writeToAndUpdateCRC(activeRange.writer, id, nil) + if writeErr != nil { + activeRange.callback(activeRange.offset, activeRange.totalBytesWritten, writeErr) + mrd.numActiveRanges-- + delete(mrd.activeRanges, id) + } else { + activeRange.currentBytesWritten += written + activeRange.totalBytesWritten += written + mrd.activeRanges[id] = activeRange + } + + if val.GetRangeEnd() { + activeRange.callback(activeRange.offset, activeRange.totalBytesWritten, nil) + mrd.numActiveRanges-- + delete(mrd.activeRanges, id) + } + mrd.mu.Unlock() + } + // Once all data in the initial response has been read out, free buffers. + res.decoder.databufs.Free() if failSpec != nil { - r.data <- failSpec + mrd.rangesToRead <- failSpec } return nil } -// Add will add current range to stream. -func (mr *gRPCBidiReader) add(output io.Writer, offset, limit int64, callback func(int64, int64, error)) { - mr.mu.Lock() - objectSize := mr.objectSize - mr.mu.Unlock() - - if offset > objectSize { - callback(offset, limit, fmt.Errorf("offset larger than size of object: %v", objectSize)) - return - } +// add will add current range to stream. The size of the range is not validated +// by add; if the client requests more bytes than are available in the object +// the server will return an error. +func (mrd *gRPCBidiReader) add(output io.Writer, offset, limit int64, callback func(int64, int64, error)) { if limit < 0 { - callback(offset, limit, fmt.Errorf("limit can't be negative")) + callback(offset, 0, errors.New("storage: cannot add range because the limit cannot be negative")) return } - mr.mu.Lock() - curentID := (*mr).readID - (*mr).readID++ - if !mr.done { - spec := rangeSpec{readID: curentID, writer: output, offset: offset, limit: limit, bytesWritten: 0, callback: callback} - mr.mp[curentID] = spec - mr.activeTask++ - mr.data <- []rangeSpec{spec} + + id := mrd.readIDGenerator.Next() + if !mrd.done { + spec := mrdRange{readID: id, writer: output, offset: offset, limit: limit, currentBytesWritten: 0, totalBytesWritten: 0, callback: callback} + mrd.mu.Lock() + mrd.numActiveRanges++ + mrd.mu.Unlock() + mrd.rangesToRead <- []mrdRange{spec} } else { - callback(offset, limit, fmt.Errorf("stream is closed, can't add range")) + callback(offset, 0, errors.New("storage: cannot add range because the stream is closed")) } - mr.mu.Unlock() } -func (mr *gRPCBidiReader) wait() { - mr.mu.Lock() - keepWaiting := len(mr.mp) != 0 && mr.activeTask != 0 - mr.mu.Unlock() +func (mrd *gRPCBidiReader) wait() { + mrd.mu.Lock() + // we should wait until there is active task or an entry in the map. + // there can be a scenario we have nothing in map for a moment or too but still have active task. + // hence in case we have permanent errors we reduce active task to 0 so that this does not block wait. + keepWaiting := len(mrd.activeRanges) != 0 || mrd.numActiveRanges != 0 + mrd.mu.Unlock() for keepWaiting { - mr.mu.Lock() - keepWaiting = len(mr.mp) != 0 && mr.activeTask != 0 - mr.mu.Unlock() + mrd.mu.Lock() + keepWaiting = len(mrd.activeRanges) != 0 || mrd.numActiveRanges != 0 + mrd.mu.Unlock() } } // Close will notify stream manager goroutine that the reader has been closed, if it's still running. -func (mr *gRPCBidiReader) close() error { - if mr.cancel != nil { - mr.cancel() - } - mr.mu.Lock() - mr.done = true - mr.activeTask = 0 - mr.mu.Unlock() - mr.closeReceiver <- true - mr.closeManager <- true +func (mrd *gRPCBidiReader) close() error { + if mrd.cancel != nil { + mrd.cancel() + } + mrd.mu.Lock() + mrd.done = true + mrd.numActiveRanges = 0 + mrd.mu.Unlock() + mrd.closeReceiver <- true + mrd.closeSender <- true return nil } -func (mrr *gRPCBidiReader) getHandle() []byte { - return mrr.readHandle +func (mrd *gRPCBidiReader) getHandle() []byte { + return mrd.readHandle +} + +func (mrd *gRPCBidiReader) error() error { + mrd.mu.Lock() + defer mrd.mu.Unlock() + if mrd.done { + return errors.New("storage: stream is permanently closed") + } + return nil +} + +type mrdRange struct { + readID int64 + writer io.Writer + offset int64 + limit int64 + currentBytesWritten int64 + totalBytesWritten int64 + callback func(int64, int64, error) } func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRangeReaderParams, opts ...storageOption) (r *Reader, err error) { @@ -1514,7 +1620,7 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange if err := applyCondsProto("gRPCReader.NewRangeReader", params.gen, params.conds, spec); err != nil { return nil, err } - if params.handle != nil { + if params.handle != nil && len(*params.handle) != 0 { spec.ReadHandle = &storagepb.BidiReadHandle{ Handle: *params.handle, } @@ -1538,7 +1644,7 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange // BidiReadObject can take multiple ranges, but we just request one in this case. readRange := &storagepb.ReadRange{ ReadOffset: params.offset + seen, - ReadId: 1, + ReadId: defaultReadID, } // Only set a ReadLength if length is greater than zero, because <= 0 means @@ -1573,7 +1679,7 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange // These types of errors show up on the RecvMsg call, rather than the // initialization of the stream via BidiReadObject above. if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return ErrObjectNotExist + return formatObjectErr(err) } if err != nil { return err @@ -1613,9 +1719,20 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange msg := res.decoder.msg obj := msg.GetMetadata() handle := ReadHandle(msg.GetReadHandle().GetHandle()) + // This is the size of the entire object, even if only a range was requested. + // Object size can be out of date in the case of unfinalized objects. size := obj.GetSize() + finalized := obj.GetFinalizeTime() != nil + negativeOffset := params.offset < 0 + if !finalized && negativeOffset { + // Fix the offset and length of a negative-offset read at time of first + // response to ensure data integrity. + params.offset = obj.Size + params.offset + params.length = obj.Size - params.offset + } + // Only support checksums when reading an entire object, not a range. var ( wantCRC uint32 @@ -1632,6 +1749,11 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange if params.offset < 0 { startOffset = size + params.offset } + // If caller has specified a negative start offset that's larger than the + // reported size, start at the beginning of the object. + if startOffset < 0 { + startOffset = 0 + } // The remaining bytes are the lesser of the requested range and all bytes // after params.offset. @@ -1663,15 +1785,18 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange cancel: cancel, size: size, // Preserve the decoder to read out object data when Read/WriteTo is called. - currMsg: res.decoder, - settings: s, - zeroRange: params.length == 0, - wantCRC: wantCRC, - checkCRC: checkCRC, + currMsg: res.decoder, + settings: s, + zeroRange: params.length == 0, + wantCRC: wantCRC, + checkCRC: checkCRC, + finalized: finalized, + negativeOffset: negativeOffset, }, - checkCRC: checkCRC, - handle: &handle, - remain: remain, + checkCRC: checkCRC, + handle: &handle, + remain: remain, + unfinalized: !finalized, } // For a zero-length request, explicitly close the stream and set remaining @@ -1684,72 +1809,6 @@ func (c *grpcStorageClient) NewRangeReader(ctx context.Context, params *newRange return r, nil } -func (c *grpcStorageClient) OpenWriter(params *openWriterParams, opts ...storageOption) (*io.PipeWriter, error) { - var offset int64 - errorf := params.setError - setObj := params.setObj - pr, pw := io.Pipe() - - s := callSettings(c.settings, opts...) - - // This function reads the data sent to the pipe and sends sets of messages - // on the gRPC client-stream as the buffer is filled. - go func() { - err := func() error { - // Unless the user told us the content type, we have to determine it from - // the first read. - var r io.Reader = pr - if params.attrs.ContentType == "" && !params.forceEmptyContentType { - r, params.attrs.ContentType = gax.DetermineContentType(r) - } - - var gw *gRPCWriter - gw, err := newGRPCWriter(c, s, params, r) - if err != nil { - return err - } - - // Loop until there is an error or the Object has been finalized. - for { - // Note: This blocks until either the buffer is full or EOF is read. - recvd, doneReading, err := gw.read() - if err != nil { - return err - } - - var o *storagepb.Object - uploadBuff := func(ctx context.Context) error { - obj, err := gw.uploadBuffer(recvd, offset, doneReading) - o = obj - return err - } - - err = run(gw.ctx, uploadBuff, gw.settings.retry, s.idempotent) - if err != nil { - return err - } - offset += int64(recvd) - - // When we are done reading data without errors, set the object and - // finish. - if doneReading { - // Build Object from server's response. - setObj(newObjectFromProto(o)) - return nil - } - } - }() - - // These calls are still valid if err is nil - err = checkCanceled(err) - errorf(err) - pr.CloseWithError(err) - close(params.donec) - }() - - return pw, nil -} - // IAM methods. func (c *grpcStorageClient) GetIamPolicy(ctx context.Context, resource string, version int32, opts ...storageOption) (*iampb.Policy, error) { @@ -1869,46 +1928,25 @@ type readStreamResponse struct { } type bidiReadStreamResponse struct { - stream storagepb.Storage_BidiReadObjectClient - response *storagepb.BidiReadObjectResponse -} - -type gRPCBidiReader struct { - stream storagepb.Storage_BidiReadObjectClient - cancel context.CancelFunc - settings *settings - readHandle ReadHandle - readID int64 - reopen func() (*bidiReadStreamResponse, context.CancelFunc, error) - readSpec *storagepb.BidiReadObjectSpec - data chan []rangeSpec - ctx context.Context - closeReceiver chan bool - closeManager chan bool - managerRetry chan bool - receiverRetry chan bool - mu sync.Mutex // protects all vars in gRPCBidiReader from concurrent access - mp map[int64]rangeSpec // always use the mutex when accessing the map - done bool // always use the mutex when accessing this variable - activeTask int64 // always use the mutex when accessing this variable - objectSize int64 // always use the mutex when accessing this variable - retrier func(error, string) - streamRecreation bool // This helps us identify if stream recreation is in progress or not. If stream recreation gets called from two goroutine then this will stop second one. + stream storagepb.Storage_BidiReadObjectClient + decoder *readResponseDecoder } // gRPCReader is used by storage.Reader if the experimental option WithGRPCBidiReads is passed. type gRPCReader struct { - seen, size int64 - zeroRange bool - stream storagepb.Storage_BidiReadObjectClient - reopen func(seen int64) (*readStreamResponse, context.CancelFunc, error) - leftovers []byte - currMsg *readResponseDecoder // decoder for the current message - cancel context.CancelFunc - settings *settings - checkCRC bool // should we check the CRC? - wantCRC uint32 // the CRC32c value the server sent in the header - gotCRC uint32 // running crc + seen, size int64 + zeroRange bool + finalized bool // if we are reading from a finalized object; in this case, remain and size may be inaccurate + negativeOffset bool + stream storagepb.Storage_BidiReadObjectClient + reopen func(seen int64) (*readStreamResponse, context.CancelFunc, error) + leftovers []byte + currMsg *readResponseDecoder // decoder for the current message + cancel context.CancelFunc + settings *settings + checkCRC bool // should we check the CRC? + wantCRC uint32 // the CRC32c value the server sent in the header + gotCRC uint32 // running crc } // Update the running CRC with the data in the slice, if CRC checking was enabled. @@ -1930,7 +1968,7 @@ func (r *gRPCReader) runCRCCheck() error { func (r *gRPCReader) Read(p []byte) (int, error) { // The entire object has been read by this reader, check the checksum if // necessary and return EOF. - if r.size == r.seen || r.zeroRange { + if (r.finalized || r.negativeOffset) && r.size == r.seen || r.zeroRange { if err := r.runCRCCheck(); err != nil { return 0, err } @@ -1945,39 +1983,30 @@ func (r *gRPCReader) Read(p []byte) (int, error) { return 0, fmt.Errorf("storage: reader has been closed") } - var n int - - // If there is data remaining in the current message, return what was - // available to conform to the Reader - // interface: https://pkg.go.dev/io#Reader. - if !r.currMsg.done { - n = r.currMsg.readAndUpdateCRC(p, func(b []byte) { - r.updateCRC(b) - }) - r.seen += int64(n) - return n, nil - } + for { + // If there is data remaining in the current message, try to read from it. + if r.currMsg != nil && !r.currMsg.done { + n, found := r.currMsg.readAndUpdateCRC(p, 1, func(b []byte) { + r.updateCRC(b) + }) + + // If data for our readID was found, we can update `seen` and return. + if found { + r.seen += int64(n) + return n, nil + } + // If not found, this message is exhausted for our purposes. + // Fall through to recv() to get a new one. + } - // Attempt to Recv the next message on the stream. - // This will update r.currMsg with the decoder for the new message. - err := r.recv() - if err != nil { - return 0, err + // Get the next message from the stream. + err := r.recv() + if err != nil { + // This correctly handles io.EOF, context canceled, and other terminal errors. + return 0, err + } + // The loop will now restart and try to read from the new r.currMsg. } - - // TODO: Determine if we need to capture incremental CRC32C for this - // chunk. The Object CRC32C checksum is captured when directed to read - // the entire Object. If directed to read a range, we may need to - // calculate the range's checksum for verification if the checksum is - // present in the response here. - // TODO: Figure out if we need to support decompressive transcoding - // https://cloud.google.com/storage/docs/transcoding. - - n = r.currMsg.readAndUpdateCRC(p, func(b []byte) { - r.updateCRC(b) - }) - r.seen += int64(n) - return n, nil } // WriteTo writes all the data requested by the Reader into w, implementing @@ -1985,7 +2014,7 @@ func (r *gRPCReader) Read(p []byte) (int, error) { func (r *gRPCReader) WriteTo(w io.Writer) (int64, error) { // The entire object has been read by this reader, check the checksum if // necessary and return nil. - if r.size == r.seen || r.zeroRange { + if (r.finalized || r.negativeOffset) && r.size == r.seen || r.zeroRange { if err := r.runCRCCheck(); err != nil { return 0, err } @@ -2005,47 +2034,37 @@ func (r *gRPCReader) WriteTo(w io.Writer) (int64, error) { // Write any already received message to the stream. There will be some leftovers from the // original NewRangeReader call. - if r.currMsg != nil && !r.currMsg.done { - written, err := r.currMsg.writeToAndUpdateCRC(w, func(b []byte) { - r.updateCRC(b) - }) - r.seen += int64(written) - r.currMsg = nil - if err != nil { - return r.seen - alreadySeen, err + for { + // Write any data from the current message buffer. + if r.currMsg != nil && !r.currMsg.done { + written, _, err := r.currMsg.writeToAndUpdateCRC(w, defaultReadID, func(b []byte) { + r.updateCRC(b) + }) + r.seen += written + if err != nil { + return r.seen - alreadySeen, err + } + // If no data was found, we still need to fetch the next message. + // If data was found, we also need the next message. So we always fall through. } - } - // Loop and receive additional messages until the entire data is written. - for { // Attempt to receive the next message on the stream. - // Will terminate with io.EOF once data has all come through. - // recv() handles stream reopening and retry logic so no need for retries here. err := r.recv() if err != nil { if err == io.EOF { - // We are done; check the checksum if necessary and return. - err = r.runCRCCheck() + // We are done; exit the loop. + break } return r.seen - alreadySeen, err } - - // TODO: Determine if we need to capture incremental CRC32C for this - // chunk. The Object CRC32C checksum is captured when directed to read - // the entire Object. If directed to read a range, we may need to - // calculate the range's checksum for verification if the checksum is - // present in the response here. - // TODO: Figure out if we need to support decompressive transcoding - // https://cloud.google.com/storage/docs/transcoding. - written, err := r.currMsg.writeToAndUpdateCRC(w, func(b []byte) { - r.updateCRC(b) - }) - r.seen += int64(written) - if err != nil { - return r.seen - alreadySeen, err - } + // Continue loop to process the new message. } - + // Propagate any checksum error. + var finalErr error + if err := r.runCRCCheck(); err != nil { + finalErr = err + } + return r.seen - alreadySeen, finalErr } // Close cancels the read stream's context in order for it to be closed and @@ -2054,6 +2073,7 @@ func (r *gRPCReader) Close() error { if r.cancel != nil { r.cancel() } + r.currMsg = nil return nil } @@ -2073,11 +2093,7 @@ func (r *gRPCReader) Close() error { func (r *gRPCReader) recv() error { databufs := mem.BufferSlice{} err := r.stream.RecvMsg(&databufs) - var shouldRetry = ShouldRetry - if r.settings.retry != nil && r.settings.retry.shouldRetry != nil { - shouldRetry = r.settings.retry.shouldRetry - } - if err != nil && shouldRetry(err) { + if err != nil && r.settings.retry.runShouldRetry(err) { // This will "close" the existing stream and immediately attempt to // reopen the stream, but will backoff if further attempts are necessary. // Reopening the stream Recvs the first message, so if retrying is @@ -2119,7 +2135,7 @@ type readResponseDecoder struct { currOff uint64 // offset in the current buffer // Processed data msg *storagepb.BidiReadObjectResponse // processed response message with all fields other than object data populated - dataOffsets bufferSliceOffsets // offsets of the object data in the message. + dataOffsets map[int64]bufferSliceOffsets // Map ReadId to the offsets of the object data for that ID in the message. done bool // true if the data has been completely read. } @@ -2205,69 +2221,95 @@ func (d *readResponseDecoder) advanceOffset(n uint64) error { // This copies object data from the message into the buffer and returns the number of // bytes copied. The data offsets are incremented in the message. The updateCRC // function is called on the copied bytes. -func (d *readResponseDecoder) readAndUpdateCRC(p []byte, updateCRC func([]byte)) int { - // For a completely empty message, just return 0 +func (d *readResponseDecoder) readAndUpdateCRC(p []byte, readID int64, updateCRC func([]byte)) (n int, found bool) { + // For a completely empty message, just return 0. if len(d.databufs) == 0 { - return 0 + return 0, false + } + + // Look up the specific offsets for the requested readID. + offsets, ok := d.dataOffsets[readID] + if !ok { + // If the message contains no data for this ID, return 0 bytes read. + return 0, false } - databuf := d.databufs[d.dataOffsets.currBuf] - startOff := d.dataOffsets.currOff + + databuf := d.databufs[offsets.currBuf] + startOff := offsets.currOff var b []byte - if d.dataOffsets.currBuf == d.dataOffsets.endBuf { - b = databuf.ReadOnlyData()[startOff:d.dataOffsets.endOff] + if offsets.currBuf == offsets.endBuf { + b = databuf.ReadOnlyData()[startOff:offsets.endOff] } else { b = databuf.ReadOnlyData()[startOff:] } - n := copy(p, b) - updateCRC(b[:n]) - d.dataOffsets.currOff += uint64(n) + n = copy(p, b) + if updateCRC != nil { + updateCRC(b[:n]) + } + offsets.currOff += uint64(n) - // We've read all the data from this message. Free the underlying buffers. - if d.dataOffsets.currBuf == d.dataOffsets.endBuf && d.dataOffsets.currOff == d.dataOffsets.endOff { - d.done = true - d.databufs.Free() + // We've read all the data for this specific range from this message. + if offsets.currBuf == offsets.endBuf && offsets.currOff == offsets.endOff { + d.done = true // Mark as done for this read, though the overall message might have more data. } - // We are at the end of the current buffer - if d.dataOffsets.currBuf != d.dataOffsets.endBuf && d.dataOffsets.currOff == uint64(databuf.Len()) { - d.dataOffsets.currOff = 0 - d.dataOffsets.currBuf++ + // We are at the end of the current buffer for this range. + if offsets.currBuf != offsets.endBuf && offsets.currOff == uint64(databuf.Len()) { + offsets.currOff = 0 + offsets.currBuf++ } - return n + + // Update the map with the new offsets. + d.dataOffsets[readID] = offsets + + return n, true } -func (d *readResponseDecoder) writeToAndUpdateCRC(w io.Writer, updateCRC func([]byte)) (int64, error) { +func (d *readResponseDecoder) writeToAndUpdateCRC(w io.Writer, readID int64, updateCRC func([]byte)) (totalWritten int64, found bool, err error) { // For a completely empty message, just return 0 if len(d.databufs) == 0 { - return 0, nil + return 0, false, nil } - var written int64 - for !d.done { - databuf := d.databufs[d.dataOffsets.currBuf] - startOff := d.dataOffsets.currOff - var b []byte - if d.dataOffsets.currBuf == d.dataOffsets.endBuf { - b = databuf.ReadOnlyData()[startOff:d.dataOffsets.endOff] - } else { - b = databuf.ReadOnlyData()[startOff:] + // Look up the specific offsets for the requested readID. + offsets, ok := d.dataOffsets[readID] + if !ok { + // It's normal for a message to not contain data for every active range, + // so we return 0 bytes written and no error. + return 0, false, nil + } + + // Loop from the current buffer to the ending buffer for this specific data range. + for i := offsets.currBuf; i <= offsets.endBuf; i++ { + databuf := d.databufs[i] + + // Determine the start and end of the data slice for the current buffer. + start := offsets.currOff + end := uint64(databuf.Len()) + if i == offsets.endBuf { + end = offsets.endOff } - var n int - // Write all remaining data from the current buffer - n, err := w.Write(b) - written += int64(n) - updateCRC(b) - if err != nil { - return written, err + + // It's possible for a buffer to be empty in some edge cases. + if start >= end { + continue } - d.dataOffsets.currOff = 0 - // We've read all the data from this message. - if d.dataOffsets.currBuf == d.dataOffsets.endBuf { - d.done = true - d.databufs.Free() - } else { - d.dataOffsets.currBuf++ + + dataSlice := databuf.ReadOnlyData()[start:end] + + // Write the data slice to the user's writer. + n, err := w.Write(dataSlice) + totalWritten += int64(n) + offsets.currOff = 0 // moving to the next buffer, currOff resets to zero. + if updateCRC != nil { + updateCRC(dataSlice[:n]) + } + if err != nil { + // Return immediately on a write error. + return totalWritten, true, err } } - return written, nil + d.done = true + + return totalWritten, true, nil } // Consume the next available tag in the input data and return the field number and type. @@ -2410,6 +2452,8 @@ func (d *readResponseDecoder) consumeBytesCopy() ([]byte, error) { // Unmarshal that does that, this function can be dropped. func (d *readResponseDecoder) readFullObjectResponse() error { msg := &storagepb.BidiReadObjectResponse{} + // Initialize the new map. + d.dataOffsets = make(map[int64]bufferSliceOffsets) // Loop over the entire message, extracting fields as we go. This does not // handle field concatenation, in which the contents of a single field @@ -2431,10 +2475,16 @@ func (d *readResponseDecoder) readFullObjectResponse() error { case fieldNum == objectRangeDataField && fieldType == protowire.BytesType: // The object data field was found. Initialize the data ranges assuming // exactly one range in the message. - msg.ObjectDataRanges = []*storagepb.ObjectRangeData{{ChecksummedData: &storagepb.ChecksummedData{}, ReadRange: &storagepb.ReadRange{}}} + // Create a new ObjectRangeData for each instance of this repeated field. + currentRange := &storagepb.ObjectRangeData{ChecksummedData: &storagepb.ChecksummedData{}, ReadRange: &storagepb.ReadRange{}} + msg.ObjectDataRanges = append(msg.ObjectDataRanges, currentRange) + // This variable will temporarily hold the data offsets until the ReadId is known. + var contentOffsets bufferSliceOffsets + var hasContent bool + bytesFieldLen, err := d.consumeVarint() if err != nil { - return fmt.Errorf("consuming bytes: %v", err) + return fmt.Errorf("consuming bytes: %w", err) } var contentEndOff = d.off + bytesFieldLen for d.off < contentEndOff { @@ -2447,7 +2497,7 @@ func (d *readResponseDecoder) readFullObjectResponse() error { case gotNum == checksummedDataField && gotTyp == protowire.BytesType: checksummedDataFieldLen, err := d.consumeVarint() if err != nil { - return fmt.Errorf("consuming bytes: %v", err) + return fmt.Errorf("consuming bytes: %w", err) } var checksummedDataEndOff = d.off + checksummedDataFieldLen for d.off < checksummedDataEndOff { @@ -2458,16 +2508,18 @@ func (d *readResponseDecoder) readFullObjectResponse() error { switch { case gotNum == checksummedDataContentField && gotTyp == protowire.BytesType: // Get the offsets of the content bytes. - d.dataOffsets, err = d.consumeBytes() + contentOffsets, err = d.consumeBytes() if err != nil { return fmt.Errorf("invalid BidiReadObjectResponse.ChecksummedData.Content: %w", err) } + hasContent = true + case gotNum == checksummedDataCRC32CField && gotTyp == protowire.Fixed32Type: v, err := d.consumeFixed32() if err != nil { return fmt.Errorf("invalid BidiReadObjectResponse.ChecksummedData.Crc32C: %w", err) } - msg.ObjectDataRanges[0].ChecksummedData.Crc32C = &v + currentRange.ChecksummedData.Crc32C = &v default: err := d.consumeFieldValue(gotNum, gotTyp) if err != nil { @@ -2478,10 +2530,10 @@ func (d *readResponseDecoder) readFullObjectResponse() error { case gotNum == readRangeField && gotTyp == protowire.BytesType: buf, err := d.consumeBytesCopy() if err != nil { - return fmt.Errorf("invalid ObjectDataRange.ReadRange: %v", err) + return fmt.Errorf("invalid ObjectDataRange.ReadRange: %w", err) } - if err := proto.Unmarshal(buf, msg.ObjectDataRanges[0].ReadRange); err != nil { + if err := proto.Unmarshal(buf, currentRange.ReadRange); err != nil { return err } case gotNum == rangeEndField && gotTyp == protowire.VarintType: // proto encodes bool as int32 @@ -2489,15 +2541,19 @@ func (d *readResponseDecoder) readFullObjectResponse() error { if err != nil { return fmt.Errorf("invalid ObjectDataRange.RangeEnd: %w", err) } - msg.ObjectDataRanges[0].RangeEnd = protowire.DecodeBool(b) + currentRange.RangeEnd = protowire.DecodeBool(b) } } + if hasContent { + // Store the offsets in the map, keyed by the ReadId of the current range. + d.dataOffsets[currentRange.ReadRange.GetReadId()] = contentOffsets + } case fieldNum == metadataField && fieldType == protowire.BytesType: msg.Metadata = &storagepb.Object{} buf, err := d.consumeBytesCopy() if err != nil { - return fmt.Errorf("invalid BidiReadObjectResponse.Metadata: %v", err) + return fmt.Errorf("invalid BidiReadObjectResponse.Metadata: %w", err) } if err := proto.Unmarshal(buf, msg.Metadata); err != nil { @@ -2507,7 +2563,7 @@ func (d *readResponseDecoder) readFullObjectResponse() error { msg.ReadHandle = &storagepb.BidiReadHandle{} buf, err := d.consumeBytesCopy() if err != nil { - return fmt.Errorf("invalid BidiReadObjectResponse.ReadHandle: %v", err) + return fmt.Errorf("invalid BidiReadObjectResponse.ReadHandle: %w", err) } if err := proto.Unmarshal(buf, msg.ReadHandle); err != nil { @@ -2540,411 +2596,3 @@ func (r *gRPCReader) reopenStream() error { r.cancel = cancel return nil } - -func newGRPCWriter(c *grpcStorageClient, s *settings, params *openWriterParams, r io.Reader) (*gRPCWriter, error) { - if params.attrs.Retention != nil { - // TO-DO: remove once ObjectRetention is available - see b/308194853 - return nil, status.Errorf(codes.Unimplemented, "storage: object retention is not supported in gRPC") - } - - size := googleapi.MinUploadChunkSize - // A completely bufferless upload (params.chunkSize <= 0) is not possible in - // gRPC because the buffer must be provided to the message. Use the minimum - // size possible. - if params.chunkSize > 0 { - size = params.chunkSize - } - - // Round up chunksize to nearest 256KiB - if size%googleapi.MinUploadChunkSize != 0 { - size += googleapi.MinUploadChunkSize - (size % googleapi.MinUploadChunkSize) - } - - if s.userProject != "" { - params.ctx = setUserProjectMetadata(params.ctx, s.userProject) - } - - spec := &storagepb.WriteObjectSpec{ - Resource: params.attrs.toProtoObject(params.bucket), - Appendable: proto.Bool(params.append), - } - // WriteObject doesn't support the generation condition, so use default. - if err := applyCondsProto("WriteObject", defaultGen, params.conds, spec); err != nil { - return nil, err - } - - return &gRPCWriter{ - buf: make([]byte, size), - c: c, - ctx: params.ctx, - reader: r, - bucket: params.bucket, - attrs: params.attrs, - conds: params.conds, - spec: spec, - encryptionKey: params.encryptionKey, - settings: s, - progress: params.progress, - sendCRC32C: params.sendCRC32C, - forceOneShot: params.chunkSize <= 0, - forceEmptyContentType: params.forceEmptyContentType, - append: params.append, - }, nil -} - -// gRPCWriter is a wrapper around the the gRPC client-stream API that manages -// sending chunks of data provided by the user over the stream. -type gRPCWriter struct { - c *grpcStorageClient - buf []byte - reader io.Reader - - ctx context.Context - - bucket string - attrs *ObjectAttrs - conds *Conditions - spec *storagepb.WriteObjectSpec - encryptionKey []byte - settings *settings - progress func(int64) - - sendCRC32C bool - forceOneShot bool - forceEmptyContentType bool - append bool - - streamSender gRPCBidiWriteBufferSender -} - -func bucketContext(ctx context.Context, bucket string) context.Context { - hds := []string{"x-goog-request-params", fmt.Sprintf("bucket=projects/_/buckets/%s", url.QueryEscape(bucket))} - return gax.InsertMetadataIntoOutgoingContext(ctx, hds...) -} - -// drainInboundStream calls stream.Recv() repeatedly until an error is returned. -// It returns the last Resource received on the stream, or nil if no Resource -// was returned. drainInboundStream always returns a non-nil error. io.EOF -// indicates all messages were successfully read. -func drainInboundStream(stream storagepb.Storage_BidiWriteObjectClient) (object *storagepb.Object, err error) { - for err == nil { - var resp *storagepb.BidiWriteObjectResponse - resp, err = stream.Recv() - // GetResource() returns nil on a nil response - if resp.GetResource() != nil { - object = resp.GetResource() - } - } - return object, err -} - -func bidiWriteObjectRequest(buf []byte, offset int64, flush, finishWrite bool) *storagepb.BidiWriteObjectRequest { - return &storagepb.BidiWriteObjectRequest{ - Data: &storagepb.BidiWriteObjectRequest_ChecksummedData{ - ChecksummedData: &storagepb.ChecksummedData{ - Content: buf, - }, - }, - WriteOffset: offset, - FinishWrite: finishWrite, - Flush: flush, - StateLookup: flush, - } -} - -type gRPCBidiWriteBufferSender interface { - // sendBuffer implementations should upload buf, respecting flush and - // finishWrite. Callers must guarantee that buf is not too long to fit in a - // gRPC message. - // - // If flush is true, implementations must not return until the data in buf is - // stable. If finishWrite is true, implementations must return the object on - // success. - sendBuffer(buf []byte, offset int64, flush, finishWrite bool) (*storagepb.Object, error) -} - -type gRPCOneshotBidiWriteBufferSender struct { - ctx context.Context - firstMessage *storagepb.BidiWriteObjectRequest - raw *gapic.Client - stream storagepb.Storage_BidiWriteObjectClient - settings *settings -} - -func (w *gRPCWriter) newGRPCOneshotBidiWriteBufferSender() (*gRPCOneshotBidiWriteBufferSender, error) { - firstMessage := &storagepb.BidiWriteObjectRequest{ - FirstMessage: &storagepb.BidiWriteObjectRequest_WriteObjectSpec{ - WriteObjectSpec: w.spec, - }, - CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), - // For a non-resumable upload, checksums must be sent in this message. - // TODO: Currently the checksums are only sent on the first message - // of the stream, but in the future, we must also support sending it - // on the *last* message of the stream (instead of the first). - ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), - } - - return &gRPCOneshotBidiWriteBufferSender{ - ctx: bucketContext(w.ctx, w.bucket), - firstMessage: firstMessage, - raw: w.c.raw, - settings: w.settings, - }, nil -} - -func (s *gRPCOneshotBidiWriteBufferSender) sendBuffer(buf []byte, offset int64, flush, finishWrite bool) (obj *storagepb.Object, err error) { - var firstMessage *storagepb.BidiWriteObjectRequest - if s.stream == nil { - s.stream, err = s.raw.BidiWriteObject(s.ctx, s.settings.gax...) - if err != nil { - return - } - firstMessage = s.firstMessage - } - req := bidiWriteObjectRequest(buf, offset, flush, finishWrite) - if firstMessage != nil { - proto.Merge(req, firstMessage) - } - - sendErr := s.stream.Send(req) - if sendErr != nil { - obj, err = drainInboundStream(s.stream) - s.stream = nil - if sendErr != io.EOF { - err = sendErr - } - return - } - // Oneshot uploads assume all flushes succeed - - if finishWrite { - s.stream.CloseSend() - // Oneshot uploads only read from the response stream on completion or - // failure - obj, err = drainInboundStream(s.stream) - s.stream = nil - if err == io.EOF { - err = nil - } - } - return -} - -type gRPCResumableBidiWriteBufferSender struct { - ctx context.Context - queryRetry *retryConfig - upid string - progress func(int64) - raw *gapic.Client - forceFirstMessage bool - stream storagepb.Storage_BidiWriteObjectClient - flushOffset int64 - settings *settings -} - -func (w *gRPCWriter) newGRPCResumableBidiWriteBufferSender() (*gRPCResumableBidiWriteBufferSender, error) { - req := &storagepb.StartResumableWriteRequest{ - WriteObjectSpec: w.spec, - CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), - // TODO: Currently the checksums are only sent on the request to initialize - // the upload, but in the future, we must also support sending it - // on the *last* message of the stream. - ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), - } - - ctx := bucketContext(w.ctx, w.bucket) - var upid string - err := run(ctx, func(ctx context.Context) error { - upres, err := w.c.raw.StartResumableWrite(ctx, req, w.settings.gax...) - upid = upres.GetUploadId() - return err - }, w.settings.retry, w.settings.idempotent) - if err != nil { - return nil, err - } - - // Set up an initial connection for the 0 offset, so we don't query state - // unnecessarily for the first buffer. If we fail, we'll just retry in the - // normal connect path. - stream, err := w.c.raw.BidiWriteObject(ctx, w.settings.gax...) - if err != nil { - stream = nil - } - - return &gRPCResumableBidiWriteBufferSender{ - ctx: ctx, - queryRetry: w.settings.retry, - upid: upid, - progress: w.progress, - raw: w.c.raw, - forceFirstMessage: true, - stream: stream, - settings: w.settings, - }, nil -} - -// queryProgress is a helper that queries the status of the resumable upload -// associated with the given upload ID. -func (s *gRPCResumableBidiWriteBufferSender) queryProgress() (int64, error) { - var persistedSize int64 - err := run(s.ctx, func(ctx context.Context) error { - q, err := s.raw.QueryWriteStatus(ctx, &storagepb.QueryWriteStatusRequest{ - UploadId: s.upid, - }, s.settings.gax...) - // q.GetPersistedSize() will return 0 if q is nil. - persistedSize = q.GetPersistedSize() - return err - }, s.queryRetry, true) - - return persistedSize, err -} - -func (s *gRPCResumableBidiWriteBufferSender) sendBuffer(buf []byte, offset int64, flush, finishWrite bool) (obj *storagepb.Object, err error) { - reconnected := false - if s.stream == nil { - // Determine offset and reconnect - s.flushOffset, err = s.queryProgress() - if err != nil { - return - } - s.stream, err = s.raw.BidiWriteObject(s.ctx, s.settings.gax...) - if err != nil { - return - } - reconnected = true - } - - // clean up buf. We'll still write the message if a flush/finishWrite was - // requested. - if offset < s.flushOffset { - trim := s.flushOffset - offset - if int64(len(buf)) <= trim { - trim = int64(len(buf)) - } - buf = buf[trim:] - } - if len(buf) == 0 && !flush && !finishWrite { - // no need to send anything - return nil, nil - } - - req := bidiWriteObjectRequest(buf, offset, flush, finishWrite) - if s.forceFirstMessage || reconnected { - req.FirstMessage = &storagepb.BidiWriteObjectRequest_UploadId{UploadId: s.upid} - s.forceFirstMessage = false - } - - sendErr := s.stream.Send(req) - if sendErr != nil { - obj, err = drainInboundStream(s.stream) - s.stream = nil - if err == io.EOF { - // This is unexpected - we got an error on Send(), but not on Recv(). - // Bubble up the sendErr. - err = sendErr - } - return - } - - if finishWrite { - s.stream.CloseSend() - obj, err = drainInboundStream(s.stream) - s.stream = nil - if err == io.EOF { - err = nil - if obj.GetSize() > s.flushOffset { - s.progress(obj.GetSize()) - } - } - return - } - - if flush { - resp, err := s.stream.Recv() - if err != nil { - return nil, err - } - persistedOffset := resp.GetPersistedSize() - if persistedOffset > s.flushOffset { - s.flushOffset = persistedOffset - s.progress(s.flushOffset) - } - } - return -} - -// uploadBuffer uploads the buffer at the given offset using a bi-directional -// Write stream. It will open a new stream if necessary (on the first call or -// after resuming from failure) and chunk the buffer per maxPerMessageWriteSize. -// The final Object is returned on success if doneReading is true. -// -// Returns object and any error that is not retriable. -func (w *gRPCWriter) uploadBuffer(recvd int, start int64, doneReading bool) (obj *storagepb.Object, err error) { - if w.streamSender == nil { - if w.append { - // Appendable object semantics - w.streamSender, err = w.newGRPCAppendBidiWriteBufferSender() - } else if doneReading || w.forceOneShot { - // One shot semantics - w.streamSender, err = w.newGRPCOneshotBidiWriteBufferSender() - } else { - // Resumable write semantics - w.streamSender, err = w.newGRPCResumableBidiWriteBufferSender() - } - if err != nil { - return - } - } - - data := w.buf[:recvd] - offset := start - // We want to go through this loop at least once, in case we have to - // finishWrite with an empty buffer. - for { - // Send as much as we can fit into a single gRPC message. Only flush once, - // when sending the very last message. - l := maxPerMessageWriteSize - flush := false - if len(data) <= l { - l = len(data) - flush = true - } - obj, err = w.streamSender.sendBuffer(data[:l], offset, flush, flush && doneReading) - if err != nil { - return nil, err - } - data = data[l:] - offset += int64(l) - if len(data) == 0 { - break - } - } - return -} - -// read copies the data in the reader to the given buffer and reports how much -// data was read into the buffer and if there is no more data to read (EOF). -func (w *gRPCWriter) read() (int, bool, error) { - // Set n to -1 to start the Read loop. - var n, recvd int = -1, 0 - var err error - for err == nil && n != 0 { - // The routine blocks here until data is received. - n, err = w.reader.Read(w.buf[recvd:]) - recvd += n - } - var done bool - if err == io.EOF { - done = true - err = nil - } - return recvd, done, err -} - -func checkCanceled(err error) error { - if status.Code(err) == codes.Canceled { - return context.Canceled - } - - return err -} diff --git a/vendor/cloud.google.com/go/storage/grpc_reader.go b/vendor/cloud.google.com/go/storage/grpc_reader.go index e1dd397819b..14ec5048d8f 100644 --- a/vendor/cloud.google.com/go/storage/grpc_reader.go +++ b/vendor/cloud.google.com/go/storage/grpc_reader.go @@ -26,10 +26,8 @@ import ( "cloud.google.com/go/storage/internal/apiv2/storagepb" "github.com/googleapis/gax-go/v2" "google.golang.org/grpc" - "google.golang.org/grpc/codes" "google.golang.org/grpc/encoding" "google.golang.org/grpc/mem" - "google.golang.org/grpc/status" "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/proto" ) @@ -83,6 +81,7 @@ func (bytesCodecReadObject) Name() string { return "" } +// NewRangeReaderReadObject is the legacy (non-bidi) implementation of reads. func (c *grpcStorageClient) NewRangeReaderReadObject(ctx context.Context, params *newRangeReaderParams, opts ...storageOption) (r *Reader, err error) { ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.grpcStorageClient.NewRangeReaderReadObject") defer func() { trace.EndSpan(ctx, err) }() @@ -146,13 +145,10 @@ func (c *grpcStorageClient) NewRangeReaderReadObject(ctx context.Context, params // use a custom decoder to avoid an extra copy at the protobuf layer. databufs := mem.BufferSlice{} err := stream.RecvMsg(&databufs) - // These types of errors show up on the Recv call, rather than the - // initialization of the stream via ReadObject above. - if s, ok := status.FromError(err); ok && s.Code() == codes.NotFound { - return ErrObjectNotExist - } if err != nil { - return err + // NotFound types of errors show up on the Recv call, rather than the + // initialization of the stream via ReadObject above. + return formatObjectErr(err) } // Use a custom decoder that uses protobuf unmarshalling for all // fields except the object data. Object data is handled separately @@ -429,11 +425,7 @@ func (r *gRPCReadObjectReader) recv() error { databufs := mem.BufferSlice{} err := r.stream.RecvMsg(&databufs) - var shouldRetry = ShouldRetry - if r.settings.retry != nil && r.settings.retry.shouldRetry != nil { - shouldRetry = r.settings.retry.shouldRetry - } - if err != nil && shouldRetry(err) { + if err != nil && r.settings.retry.runShouldRetry(err) { // This will "close" the existing stream and immediately attempt to // reopen the stream, but will backoff if further attempts are necessary. // Reopening the stream Recvs the first message, so if retrying is @@ -780,7 +772,7 @@ func (d *readObjectResponseDecoder) readFullObjectResponse() error { bytesFieldLen, err := d.consumeVarint() if err != nil { - return fmt.Errorf("consuming bytes: %v", err) + return fmt.Errorf("consuming bytes: %w", err) } var contentEndOff = d.off + bytesFieldLen @@ -816,7 +808,7 @@ func (d *readObjectResponseDecoder) readFullObjectResponse() error { // Consume the bytes and copy them into a single buffer if they are split across buffers. buf, err := d.consumeBytesCopy() if err != nil { - return fmt.Errorf("invalid ReadObjectResponse.ObjectChecksums: %v", err) + return fmt.Errorf("invalid ReadObjectResponse.ObjectChecksums: %w", err) } // Unmarshal. if err := proto.Unmarshal(buf, msg.ObjectChecksums); err != nil { @@ -826,7 +818,7 @@ func (d *readObjectResponseDecoder) readFullObjectResponse() error { msg.ContentRange = &storagepb.ContentRange{} buf, err := d.consumeBytesCopy() if err != nil { - return fmt.Errorf("invalid ReadObjectResponse.ContentRange: %v", err) + return fmt.Errorf("invalid ReadObjectResponse.ContentRange: %w", err) } if err := proto.Unmarshal(buf, msg.ContentRange); err != nil { return err @@ -836,7 +828,7 @@ func (d *readObjectResponseDecoder) readFullObjectResponse() error { buf, err := d.consumeBytesCopy() if err != nil { - return fmt.Errorf("invalid ReadObjectResponse.Metadata: %v", err) + return fmt.Errorf("invalid ReadObjectResponse.Metadata: %w", err) } if err := proto.Unmarshal(buf, msg.Metadata); err != nil { diff --git a/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go b/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go new file mode 100644 index 00000000000..14b78e1a1bd --- /dev/null +++ b/vendor/cloud.google.com/go/storage/grpc_reader_multi_range.go @@ -0,0 +1,40 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package storage + +import "sync" + +// readIDGenerator generates unique read IDs for multi-range reads. +// Call readIDGenerator.Next to get the next ID. Safe to be called concurrently. +type readIDGenerator struct { + initOnce sync.Once + nextID chan int64 // do not use this field directly +} + +func (g *readIDGenerator) init() { + g.nextID = make(chan int64, 1) + g.nextID <- 1 +} + +// Next returns the Next read ID. It initializes the readIDGenerator if needed. +func (g *readIDGenerator) Next() int64 { + g.initOnce.Do(g.init) + + id := <-g.nextID + n := id + 1 + g.nextID <- n + + return id +} diff --git a/vendor/cloud.google.com/go/storage/grpc_writer.go b/vendor/cloud.google.com/go/storage/grpc_writer.go index 9c8e8fc30e6..3d82e595172 100644 --- a/vendor/cloud.google.com/go/storage/grpc_writer.go +++ b/vendor/cloud.google.com/go/storage/grpc_writer.go @@ -19,17 +19,663 @@ import ( "errors" "fmt" "io" + "net/url" + "time" gapic "cloud.google.com/go/storage/internal/apiv2" "cloud.google.com/go/storage/internal/apiv2/storagepb" gax "github.com/googleapis/gax-go/v2" + "google.golang.org/api/googleapi" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" ) +const ( + // defaultWriteChunkRetryDeadline is the default deadline for the upload + // of a single chunk. It can be overwritten by Writer.ChunkRetryDeadline. + defaultWriteChunkRetryDeadline = 32 * time.Second + // maxPerMessageWriteSize is the maximum amount of content that can be sent + // per WriteObjectRequest message. A buffer reaching this amount will + // precipitate a flush of the buffer. It is only used by the gRPC Writer + // implementation. + maxPerMessageWriteSize int = int(storagepb.ServiceConstants_MAX_WRITE_CHUNK_BYTES) +) + +func withBidiWriteObjectRedirectionErrorRetries(s *settings) (newr *retryConfig) { + oldr := s.retry + newr = oldr.clone() + if newr == nil { + newr = &retryConfig{} + } + if (oldr.policy == RetryIdempotent && !s.idempotent) || oldr.policy == RetryNever { + // We still retry redirection errors even when settings indicate not to + // retry. + // + // The protocol requires us to respect redirection errors, so RetryNever has + // to ignore them. + // + // Idempotency is always protected by redirection errors: they either + // contain a handle which can be used as idempotency information, or they do + // not contain a handle and are "affirmative failures" which indicate that + // no server-side action occurred. + newr.policy = RetryAlways + newr.shouldRetry = func(err error) bool { + return errors.Is(err, bidiWriteObjectRedirectionError{}) + } + return newr + } + // If retry settings allow retries normally, fall back to that behavior. + newr.shouldRetry = func(err error) bool { + if errors.Is(err, bidiWriteObjectRedirectionError{}) { + return true + } + v := oldr.runShouldRetry(err) + return v + } + return newr +} + +type flushResult struct { + err error + offset int64 +} + +type gRPCInternalWriter struct { + flushSupported bool + flushInProgress bool + + pw *io.PipeWriter + + flushComplete chan flushResult +} + +func (giw *gRPCInternalWriter) Flush() (int64, error) { + if !giw.flushSupported { + return 0, errors.New("Flush is supported only if Writer.Append is set to true") + } + + giw.flushInProgress = true + giw.pw.Close() + + // Return the offset based on flushComplete. + r := <-giw.flushComplete + return r.offset, r.err +} + +// Forward other methods to *io.PipeWriter +func (giw *gRPCInternalWriter) Write(p []byte) (int, error) { + return giw.pw.Write(p) +} + +func (giw *gRPCInternalWriter) Close() error { + return giw.pw.Close() +} + +func (giw *gRPCInternalWriter) CloseWithError(err error) error { + return giw.pw.CloseWithError(err) +} + +func (c *grpcStorageClient) OpenWriter(params *openWriterParams, opts ...storageOption) (internalWriter, error) { + var offset int64 + errorf := params.setError + setObj := params.setObj + pr, pw := io.Pipe() + + s := callSettings(c.settings, opts...) + + retryDeadline := defaultWriteChunkRetryDeadline + if params.chunkRetryDeadline != 0 { + retryDeadline = params.chunkRetryDeadline + } + if s.retry == nil { + s.retry = defaultRetry.clone() + } + if params.append { + s.retry = withBidiWriteObjectRedirectionErrorRetries(s) + } + s.retry.maxRetryDuration = retryDeadline + + gw, err := newGRPCWriter(c, s, params, pr, pr, pw) + if err != nil { + errorf(err) + pr.CloseWithError(err) + close(params.donec) + return nil, err + } + + var o *storagepb.Object + + // If we are taking over an appendable object, send the first message here + // to get the append offset. + if params.append && params.appendGen >= 0 { + // Create the buffer sender. This opens a stream and blocks until we + // get a response that tells us what offset to write from. + wbs, err := gw.newGRPCAppendTakeoverWriteBufferSender(params.ctx) + if err != nil { + return nil, fmt.Errorf("storage: creating buffer sender: %w", err) + } + // Propagate append offset to caller and buffer sending logic below. + params.setTakeoverOffset(wbs.takeoverOffset) + offset = wbs.takeoverOffset + gw.streamSender = wbs + o = wbs.objResource + setObj(newObjectFromProto(o)) + } + + // This function reads the data sent to the pipe and sends sets of messages + // on the gRPC client-stream as the buffer is filled. + go func() { + err := func() error { + // Unless the user told us the content type, we have to determine it from + // the first read. + if params.attrs.ContentType == "" && !params.forceEmptyContentType { + gw.reader, gw.spec.Resource.ContentType = gax.DetermineContentType(gw.reader) + } + + // Loop until there is an error or the Object has been finalized. + for { + // Note: This blocks until either the buffer is full or EOF is read. + recvd, doneReading, err := gw.read() + if err != nil { + return err + } + + uploadBuff := func(ctx context.Context) error { + obj, err := gw.uploadBuffer(ctx, recvd, offset, doneReading) + if obj != nil { + o = obj + setObj(newObjectFromProto(o)) + } + return err + } + + // Add routing headers to the context metadata for single-shot and resumable + // writes. Append writes need to set this at a lower level to pass the routing + // token. + bctx := gw.ctx + if !gw.append { + bctx = bucketContext(bctx, gw.bucket) + } + err = run(bctx, uploadBuff, gw.settings.retry, s.idempotent) + offset += int64(recvd) + // If this buffer upload was triggered by a flush, reset and + // communicate back the result. + if gw.iw.flushInProgress { + gw.setSize(offset) + gw.iw.flushInProgress = false + gw.iw.flushComplete <- flushResult{offset: offset, err: err} + } + if err != nil { + return err + } + // When we are done reading data without errors, set the object and + // finish. + if doneReading { + // Build Object from server's response. + setObj(newObjectFromProto(o)) + return nil + } + } + }() + + // These calls are still valid if err is nil + err = checkCanceled(err) + errorf(err) + gw.pr.CloseWithError(err) + close(params.donec) + }() + + return gw.iw, nil +} + +func newGRPCWriter(c *grpcStorageClient, s *settings, params *openWriterParams, r io.Reader, pr *io.PipeReader, pw *io.PipeWriter) (*gRPCWriter, error) { + if params.attrs.Retention != nil { + // TO-DO: remove once ObjectRetention is available - see b/308194853 + return nil, status.Errorf(codes.Unimplemented, "storage: object retention is not supported in gRPC") + } + + size := googleapi.MinUploadChunkSize + // A completely bufferless upload (params.chunkSize <= 0) is not possible in + // gRPC because the buffer must be provided to the message. Use the minimum + // size possible. + if params.chunkSize > 0 { + size = params.chunkSize + } + + // Round up chunksize to nearest 256KiB + if size%googleapi.MinUploadChunkSize != 0 { + size += googleapi.MinUploadChunkSize - (size % googleapi.MinUploadChunkSize) + } + + if s.userProject != "" { + params.ctx = setUserProjectMetadata(params.ctx, s.userProject) + } + + spec := &storagepb.WriteObjectSpec{ + Resource: params.attrs.toProtoObject(params.bucket), + Appendable: proto.Bool(params.append), + } + var appendSpec *storagepb.AppendObjectSpec + if params.append && params.appendGen >= 0 { + appendSpec = &storagepb.AppendObjectSpec{ + Bucket: bucketResourceName(globalProjectAlias, params.bucket), + Object: params.attrs.Name, + Generation: params.appendGen, + } + } + // WriteObject doesn't support the generation condition, so use default. + if err := applyCondsProto("WriteObject", defaultGen, params.conds, spec); err != nil { + return nil, err + } + + return &gRPCWriter{ + buf: make([]byte, size), + c: c, + ctx: params.ctx, + reader: r, + pr: pr, + iw: &gRPCInternalWriter{ + flushSupported: params.append, + flushInProgress: false, + pw: pw, + flushComplete: make(chan flushResult), + }, + bucket: params.bucket, + attrs: params.attrs, + conds: params.conds, + spec: spec, + appendSpec: appendSpec, + encryptionKey: params.encryptionKey, + settings: s, + progress: params.progress, + setSize: params.setSize, + sendCRC32C: params.sendCRC32C, + forceOneShot: params.chunkSize <= 0, + forceEmptyContentType: params.forceEmptyContentType, + append: params.append, + finalizeOnClose: params.finalizeOnClose, + }, nil +} + +// gRPCWriter is a wrapper around the the gRPC client-stream API that manages +// sending chunks of data provided by the user over the stream. +type gRPCWriter struct { + c *grpcStorageClient + buf []byte + reader io.Reader + pr *io.PipeReader // Keep track of pr to update post-flush + iw *gRPCInternalWriter + + ctx context.Context + + bucket string + attrs *ObjectAttrs + conds *Conditions + spec *storagepb.WriteObjectSpec + appendSpec *storagepb.AppendObjectSpec + encryptionKey []byte + settings *settings + progress func(int64) + setSize func(int64) + + sendCRC32C bool + forceOneShot bool + forceEmptyContentType bool + append bool + finalizeOnClose bool + + streamSender gRPCBidiWriteBufferSender +} + +func bucketContext(ctx context.Context, bucket string) context.Context { + hds := []string{"x-goog-request-params", fmt.Sprintf("bucket=projects/_/buckets/%s", url.QueryEscape(bucket))} + return gax.InsertMetadataIntoOutgoingContext(ctx, hds...) +} + +// drainInboundStream calls stream.Recv() repeatedly until an error is returned. +// It returns the last Resource received on the stream, or nil if no Resource +// was returned. drainInboundStream always returns a non-nil error. io.EOF +// indicates all messages were successfully read. +func drainInboundStream(stream storagepb.Storage_BidiWriteObjectClient) (object *storagepb.Object, err error) { + for err == nil { + var resp *storagepb.BidiWriteObjectResponse + resp, err = stream.Recv() + // GetResource() returns nil on a nil response + if resp.GetResource() != nil { + object = resp.GetResource() + } + } + return object, err +} + +func bidiWriteObjectRequest(buf []byte, offset int64, flush, finishWrite bool) *storagepb.BidiWriteObjectRequest { + var data *storagepb.BidiWriteObjectRequest_ChecksummedData + if buf != nil { + data = &storagepb.BidiWriteObjectRequest_ChecksummedData{ + ChecksummedData: &storagepb.ChecksummedData{ + Content: buf, + }, + } + } + req := &storagepb.BidiWriteObjectRequest{ + Data: data, + WriteOffset: offset, + FinishWrite: finishWrite, + Flush: flush, + StateLookup: flush, + } + return req +} + +type gRPCBidiWriteBufferSender interface { + // sendBuffer implementations should upload buf, respecting flush and + // finishWrite. Callers must guarantee that buf is not too long to fit in a + // gRPC message. + // + // If flush is true, implementations must not return until the data in buf is + // stable. If finishWrite is true, implementations must return the object on + // success. + sendBuffer(ctx context.Context, buf []byte, offset int64, flush, finishWrite bool) (*storagepb.Object, error) +} + +type gRPCOneshotBidiWriteBufferSender struct { + firstMessage *storagepb.BidiWriteObjectRequest + raw *gapic.Client + stream storagepb.Storage_BidiWriteObjectClient + settings *settings +} + +func (w *gRPCWriter) newGRPCOneshotBidiWriteBufferSender() (*gRPCOneshotBidiWriteBufferSender, error) { + firstMessage := &storagepb.BidiWriteObjectRequest{ + FirstMessage: &storagepb.BidiWriteObjectRequest_WriteObjectSpec{ + WriteObjectSpec: w.spec, + }, + CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), + // For a non-resumable upload, checksums must be sent in this message. + // TODO: Currently the checksums are only sent on the first message + // of the stream, but in the future, we must also support sending it + // on the *last* message of the stream (instead of the first). + ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + } + + return &gRPCOneshotBidiWriteBufferSender{ + firstMessage: firstMessage, + raw: w.c.raw, + settings: w.settings, + }, nil +} + +func (s *gRPCOneshotBidiWriteBufferSender) sendBuffer(ctx context.Context, buf []byte, offset int64, flush, finishWrite bool) (obj *storagepb.Object, err error) { + var firstMessage *storagepb.BidiWriteObjectRequest + if s.stream == nil { + s.stream, err = s.raw.BidiWriteObject(ctx, s.settings.gax...) + if err != nil { + return + } + firstMessage = s.firstMessage + } + req := bidiWriteObjectRequest(buf, offset, flush, finishWrite) + if firstMessage != nil { + proto.Merge(req, firstMessage) + } + + sendErr := s.stream.Send(req) + if sendErr != nil { + obj, err = drainInboundStream(s.stream) + s.stream = nil + if sendErr != io.EOF { + err = sendErr + } + return + } + // Oneshot uploads assume all flushes succeed + + if finishWrite { + s.stream.CloseSend() + // Oneshot uploads only read from the response stream on completion or + // failure + obj, err = drainInboundStream(s.stream) + s.stream = nil + if err == io.EOF { + err = nil + } + } + return +} + +type gRPCResumableBidiWriteBufferSender struct { + queryRetry *retryConfig + upid string + progress func(int64) + raw *gapic.Client + forceFirstMessage bool + stream storagepb.Storage_BidiWriteObjectClient + flushOffset int64 + settings *settings +} + +func (w *gRPCWriter) newGRPCResumableBidiWriteBufferSender(ctx context.Context) (*gRPCResumableBidiWriteBufferSender, error) { + req := &storagepb.StartResumableWriteRequest{ + WriteObjectSpec: w.spec, + CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), + // TODO: Currently the checksums are only sent on the request to initialize + // the upload, but in the future, we must also support sending it + // on the *last* message of the stream. + ObjectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + } + + var upid string + err := run(ctx, func(ctx context.Context) error { + upres, err := w.c.raw.StartResumableWrite(ctx, req, w.settings.gax...) + upid = upres.GetUploadId() + return err + }, w.settings.retry, w.settings.idempotent) + if err != nil { + return nil, err + } + + // Set up an initial connection for the 0 offset, so we don't query state + // unnecessarily for the first buffer. If we fail, we'll just retry in the + // normal connect path. + stream, err := w.c.raw.BidiWriteObject(ctx, w.settings.gax...) + if err != nil { + stream = nil + } + + return &gRPCResumableBidiWriteBufferSender{ + queryRetry: w.settings.retry, + upid: upid, + progress: w.progress, + raw: w.c.raw, + forceFirstMessage: true, + stream: stream, + settings: w.settings, + }, nil +} + +// queryProgress is a helper that queries the status of the resumable upload +// associated with the given upload ID. +func (s *gRPCResumableBidiWriteBufferSender) queryProgress(ctx context.Context) (int64, error) { + var persistedSize int64 + err := run(ctx, func(ctx context.Context) error { + q, err := s.raw.QueryWriteStatus(ctx, &storagepb.QueryWriteStatusRequest{ + UploadId: s.upid, + }, s.settings.gax...) + // q.GetPersistedSize() will return 0 if q is nil. + persistedSize = q.GetPersistedSize() + return err + }, s.queryRetry, true) + + return persistedSize, err +} + +func (s *gRPCResumableBidiWriteBufferSender) sendBuffer(ctx context.Context, buf []byte, offset int64, flush, finishWrite bool) (obj *storagepb.Object, err error) { + if s.stream == nil { + // Determine offset and reconnect + s.flushOffset, err = s.queryProgress(ctx) + if err != nil { + return + } + s.stream, err = s.raw.BidiWriteObject(ctx, s.settings.gax...) + if err != nil { + return + } + s.forceFirstMessage = true + } + + // clean up buf. We'll still write the message if a flush/finishWrite was + // requested. + if offset < s.flushOffset { + trim := s.flushOffset - offset + if int64(len(buf)) <= trim { + trim = int64(len(buf)) + } + buf = buf[trim:] + offset += trim + } + if len(buf) == 0 && !flush && !finishWrite { + // no need to send anything + return nil, nil + } + + req := bidiWriteObjectRequest(buf, offset, flush, finishWrite) + if s.forceFirstMessage { + req.FirstMessage = &storagepb.BidiWriteObjectRequest_UploadId{UploadId: s.upid} + s.forceFirstMessage = false + } + + sendErr := s.stream.Send(req) + if sendErr != nil { + obj, err = drainInboundStream(s.stream) + s.stream = nil + if err == io.EOF { + // This is unexpected - we got an error on Send(), but not on Recv(). + // Bubble up the sendErr. + err = sendErr + } + return + } + + if finishWrite { + s.stream.CloseSend() + obj, err = drainInboundStream(s.stream) + s.stream = nil + if err == io.EOF { + err = nil + if obj.GetSize() > s.flushOffset { + s.progress(obj.GetSize()) + } + } + return + } + + if flush { + resp, err := s.stream.Recv() + if err != nil { + return nil, err + } + persistedOffset := resp.GetPersistedSize() + if persistedOffset > s.flushOffset { + s.flushOffset = persistedOffset + s.progress(s.flushOffset) + } + } + return +} + +// uploadBuffer uploads the buffer at the given offset using a bi-directional +// Write stream. It will open a new stream if necessary (on the first call or +// after resuming from failure) and chunk the buffer per maxPerMessageWriteSize. +// The final Object is returned on success if doneReading is true. +// +// Returns object and any error that is not retriable. +func (w *gRPCWriter) uploadBuffer(ctx context.Context, recvd int, start int64, doneReading bool) (obj *storagepb.Object, err error) { + if w.streamSender == nil { + if w.append { + // Appendable object semantics + w.streamSender, err = w.newGRPCAppendableObjectBufferSender() + } else if doneReading || w.forceOneShot { + // One shot semantics + w.streamSender, err = w.newGRPCOneshotBidiWriteBufferSender() + } else { + // Resumable write semantics + w.streamSender, err = w.newGRPCResumableBidiWriteBufferSender(ctx) + } + if err != nil { + return + } + } + + data := w.buf[:recvd] + offset := start + // We want to go through this loop at least once, in case we have to + // finishWrite with an empty buffer. + for { + // Send as much as we can fit into a single gRPC message. Only flush once, + // when sending the very last message. + l := maxPerMessageWriteSize + flush := false + if len(data) <= l { + l = len(data) + flush = true + } + obj, err = w.streamSender.sendBuffer(ctx, data[:l], offset, flush, flush && doneReading) + if err != nil { + return nil, err + } + data = data[l:] + offset += int64(l) + if len(data) == 0 { + // Update object size to match persisted offset. + if obj != nil { + obj.Size = offset + } + break + } + } + return +} + +// read copies the data in the reader to the given buffer and reports how much +// data was read into the buffer and if there is no more data to read (EOF). +// read returns when either 1. the buffer is full, 2. Writer.Flush was called, +// or 3. Writer.Close was called. +func (w *gRPCWriter) read() (int, bool, error) { + // Set n to -1 to start the Read loop. + var n, recvd int = -1, 0 + var err error + for err == nil && n != 0 { + // The routine blocks here until data is received. + n, err = w.reader.Read(w.buf[recvd:]) + recvd += n + } + var done bool + if err == io.EOF { + err = nil + // EOF can come from Writer.Flush or Writer.Close. + if w.iw.flushInProgress { + // Reset pipe for additional writes after the flush. + pr, pw := io.Pipe() + w.reader = pr + w.pr = pr + w.iw.pw = pw + } else { + done = true + } + } + return recvd, done, err +} + +func checkCanceled(err error) error { + if status.Code(err) == codes.Canceled { + return context.Canceled + } + + return err +} + type gRPCAppendBidiWriteBufferSender struct { - ctx context.Context bucket string routingToken *string raw *gapic.Client @@ -38,8 +684,13 @@ type gRPCAppendBidiWriteBufferSender struct { firstMessage *storagepb.BidiWriteObjectRequest objectChecksums *storagepb.ObjectChecksums + finalizeOnClose bool + forceFirstMessage bool + progress func(int64) flushOffset int64 + takeoverOffset int64 + objResource *storagepb.Object // Captures received obj to set w.Attrs. // Fields used to report responses from the receive side of the stream // recvs is closed when the current recv goroutine is complete. recvErr is set @@ -48,12 +699,12 @@ type gRPCAppendBidiWriteBufferSender struct { recvErr error } -func (w *gRPCWriter) newGRPCAppendBidiWriteBufferSender() (*gRPCAppendBidiWriteBufferSender, error) { +// Use for a newly created appendable object. +func (w *gRPCWriter) newGRPCAppendableObjectBufferSender() (*gRPCAppendBidiWriteBufferSender, error) { s := &gRPCAppendBidiWriteBufferSender{ - ctx: w.ctx, bucket: w.spec.GetResource().GetBucket(), raw: w.c.raw, - settings: w.c.settings, + settings: w.settings, firstMessage: &storagepb.BidiWriteObjectRequest{ FirstMessage: &storagepb.BidiWriteObjectRequest_WriteObjectSpec{ WriteObjectSpec: w.spec, @@ -61,12 +712,53 @@ func (w *gRPCWriter) newGRPCAppendBidiWriteBufferSender() (*gRPCAppendBidiWriteB CommonObjectRequestParams: toProtoCommonObjectRequestParams(w.encryptionKey), }, objectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + finalizeOnClose: w.finalizeOnClose, + forceFirstMessage: true, + progress: w.progress, + flushOffset: -1, // We should ack flushes to length 0. + } + return s, nil +} + +// Use for a takeover of an appendable object. +// Unlike newGRPCAppendableObjectBufferSender, this blocks until the stream is +// open because it needs to get the append offset from the server. +func (w *gRPCWriter) newGRPCAppendTakeoverWriteBufferSender(ctx context.Context) (*gRPCAppendBidiWriteBufferSender, error) { + s := &gRPCAppendBidiWriteBufferSender{ + bucket: w.spec.GetResource().GetBucket(), + raw: w.c.raw, + settings: w.settings, + firstMessage: &storagepb.BidiWriteObjectRequest{ + FirstMessage: &storagepb.BidiWriteObjectRequest_AppendObjectSpec{ + AppendObjectSpec: w.appendSpec, + }, + }, + objectChecksums: toProtoChecksums(w.sendCRC32C, w.attrs), + finalizeOnClose: w.finalizeOnClose, forceFirstMessage: true, + progress: w.progress, + } + if err := s.connect(ctx); err != nil { + return nil, fmt.Errorf("storage: opening appendable write stream: %w", err) } + _, err := s.sendOnConnectedStream(nil, 0, false, false, true) + if err != nil { + return nil, err + } + firstResp := <-s.recvs + // Check recvErr after getting the response. + if s.recvErr != nil { + return nil, s.recvErr + } + + // Object resource is returned in the first response on takeover, so capture + // this now. + s.objResource = firstResp.GetResource() + s.takeoverOffset = firstResp.GetResource().GetSize() return s, nil } -func (s *gRPCAppendBidiWriteBufferSender) connect() (err error) { +func (s *gRPCAppendBidiWriteBufferSender) connect(ctx context.Context) (err error) { err = func() error { // If this is a forced first message, we've already determined it's safe to // send. @@ -80,6 +772,14 @@ func (s *gRPCAppendBidiWriteBufferSender) connect() (err error) { if s.firstMessage.GetAppendObjectSpec().GetWriteHandle() != nil { return nil } + // Also always okay to reconnect if there is a generation. + if s.firstMessage.GetAppendObjectSpec().GetGeneration() != 0 { + return nil + } + // Also always ok to reconnect if we've seen a redirect token + if s.routingToken != nil { + return nil + } // We can also reconnect if the first message has an if_generation_match or // if_metageneration_match condition. Note that negative conditions like @@ -105,7 +805,7 @@ func (s *gRPCAppendBidiWriteBufferSender) connect() (err error) { return err } - return s.startReceiver() + return s.startReceiver(ctx) } func (s *gRPCAppendBidiWriteBufferSender) withRequestParams(ctx context.Context) context.Context { @@ -113,11 +813,11 @@ func (s *gRPCAppendBidiWriteBufferSender) withRequestParams(ctx context.Context) if s.routingToken != nil { param = param + fmt.Sprintf("&routing_token=%s", *s.routingToken) } - return gax.InsertMetadataIntoOutgoingContext(s.ctx, "x-goog-request-params", param) + return gax.InsertMetadataIntoOutgoingContext(ctx, "x-goog-request-params", param) } -func (s *gRPCAppendBidiWriteBufferSender) startReceiver() (err error) { - s.stream, err = s.raw.BidiWriteObject(s.withRequestParams(s.ctx), s.settings.gax...) +func (s *gRPCAppendBidiWriteBufferSender) startReceiver(ctx context.Context) (err error) { + s.stream, err = s.raw.BidiWriteObject(s.withRequestParams(ctx), s.settings.gax...) if err != nil { return } @@ -162,7 +862,7 @@ func (s *gRPCAppendBidiWriteBufferSender) maybeUpdateFirstMessage(resp *storagep type bidiWriteObjectRedirectionError struct{} func (e bidiWriteObjectRedirectionError) Error() string { - return "BidiWriteObjectRedirectedError" + return "" } func (s *gRPCAppendBidiWriteBufferSender) handleRedirectionError(e *storagepb.BidiWriteObjectRedirectedError) bool { @@ -207,10 +907,10 @@ func (s *gRPCAppendBidiWriteBufferSender) receiveMessages(resps chan<- *storagep if st, ok := status.FromError(err); ok && st.Code() == codes.Aborted { for _, d := range st.Details() { if e, ok := d.(*storagepb.BidiWriteObjectRedirectedError); ok { - // If we can handle this error, replace it with the sentinel. Otherwise, - // report it to the user. + // If we can handle this error, wrap it with the sentinel so it gets + // retried. if ok := s.handleRedirectionError(e); ok { - err = bidiWriteObjectRedirectionError{} + err = fmt.Errorf("%w%w", bidiWriteObjectRedirectionError{}, err) } } } @@ -223,9 +923,16 @@ func (s *gRPCAppendBidiWriteBufferSender) receiveMessages(resps chan<- *storagep } func (s *gRPCAppendBidiWriteBufferSender) sendOnConnectedStream(buf []byte, offset int64, flush, finishWrite, sendFirstMessage bool) (obj *storagepb.Object, err error) { - req := bidiWriteObjectRequest(buf, offset, flush, finishWrite) + var req *storagepb.BidiWriteObjectRequest + finalizeObject := finishWrite && s.finalizeOnClose if finishWrite { - // appendable objects pass checksums on the last message only + // Always flush when finishing the Write, even if not finalizing. + req = bidiWriteObjectRequest(buf, offset, true, finalizeObject) + } else { + req = bidiWriteObjectRequest(buf, offset, flush, false) + } + if finalizeObject { + // appendable objects pass checksums on the finalize message only req.ObjectChecksums = s.objectChecksums } if sendFirstMessage { @@ -242,46 +949,69 @@ func (s *gRPCAppendBidiWriteBufferSender) sendOnConnectedStream(buf []byte, offs if resp.GetResource() != nil { obj = resp.GetResource() } + // When closing the stream, update the object resource to reflect + // the persisted size. We get a new object from the stream if + // the object was finalized, but not if it's unfinalized. + if s.objResource != nil && resp.GetPersistedSize() > 0 { + s.objResource.Size = resp.GetPersistedSize() + } } if s.recvErr != io.EOF { return nil, s.recvErr } + if obj.GetSize() > s.flushOffset { + s.flushOffset = obj.GetSize() + s.progress(s.flushOffset) + } return } if flush { // We don't necessarily expect multiple responses for a single flush, but // this allows the server to send multiple responses if it wants to. - for s.flushOffset < offset+int64(len(buf)) { + flushOffset := s.flushOffset + + for flushOffset < offset+int64(len(buf)) { resp, ok := <-s.recvs if !ok { return nil, s.recvErr } pSize := resp.GetPersistedSize() rSize := resp.GetResource().GetSize() - if s.flushOffset < pSize { - s.flushOffset = pSize + if flushOffset < pSize { + flushOffset = pSize + } + if flushOffset < rSize { + flushOffset = rSize } - if s.flushOffset < rSize { - s.flushOffset = rSize + // On the first flush, we expect to get an object resource back and + // should return it. + if resp.GetResource() != nil { + obj = resp.GetResource() } } + if s.flushOffset < flushOffset { + s.flushOffset = flushOffset + s.progress(s.flushOffset) + } } - return } -func (s *gRPCAppendBidiWriteBufferSender) sendBuffer(buf []byte, offset int64, flush, finishWrite bool) (obj *storagepb.Object, err error) { +func (s *gRPCAppendBidiWriteBufferSender) sendBuffer(ctx context.Context, buf []byte, offset int64, flush, finishWrite bool) (obj *storagepb.Object, err error) { for { sendFirstMessage := false if s.stream == nil { sendFirstMessage = true - if err = s.connect(); err != nil { + if err = s.connect(ctx); err != nil { return } } obj, err = s.sendOnConnectedStream(buf, offset, flush, finishWrite, sendFirstMessage) + if obj != nil { + s.objResource = obj + } if err == nil { return } @@ -293,13 +1023,6 @@ func (s *gRPCAppendBidiWriteBufferSender) sendBuffer(buf []byte, offset int64, f err = s.recvErr } s.stream = nil - - // Retry transparently on a redirection error - if _, ok := err.(bidiWriteObjectRedirectionError); ok { - s.forceFirstMessage = true - continue - } - return } } diff --git a/vendor/cloud.google.com/go/storage/http_client.go b/vendor/cloud.google.com/go/storage/http_client.go index 61b20555f44..a4b601300dd 100644 --- a/vendor/cloud.google.com/go/storage/http_client.go +++ b/vendor/cloud.google.com/go/storage/http_client.go @@ -21,7 +21,6 @@ import ( "fmt" "hash/crc32" "io" - "io/ioutil" "log" "net/http" "net/url" @@ -31,24 +30,24 @@ import ( "strings" "time" + "cloud.google.com/go/auth" "cloud.google.com/go/iam/apiv1/iampb" "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" + "github.com/google/uuid" "github.com/googleapis/gax-go/v2/callctx" - "golang.org/x/oauth2/google" "google.golang.org/api/googleapi" "google.golang.org/api/iterator" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" raw "google.golang.org/api/storage/v1" - "google.golang.org/api/transport" htransport "google.golang.org/api/transport/http" ) // httpStorageClient is the HTTP-JSON API implementation of the transport-agnostic // storageClient interface. type httpStorageClient struct { - creds *google.Credentials + creds *auth.Credentials hc *http.Client xmlHost string raw *raw.Service @@ -65,7 +64,7 @@ func newHTTPStorageClient(ctx context.Context, opts ...storageOption) (storageCl o := s.clientOption config := newStorageConfig(o...) - var creds *google.Credentials + var creds *auth.Credentials // In general, it is recommended to use raw.NewService instead of htransport.NewClient // since raw.NewService configures the correct default endpoints when initializing the // internal http client. However, in our case, "NewRangeReader" in reader.go needs to @@ -83,10 +82,10 @@ func newHTTPStorageClient(ctx context.Context, opts ...storageOption) (storageCl ) // Don't error out here. The user may have passed in their own HTTP // client which does not auth with ADC or other common conventions. - c, err := transport.Creds(ctx, o...) + c, err := internaloption.AuthCreds(ctx, o) if err == nil { creds = c - o = append(o, internaloption.WithCredentials(creds)) + o = append(o, option.WithAuthCredentials(creds)) } } else { var hostURL *url.URL @@ -287,12 +286,8 @@ func (c *httpStorageClient) GetBucket(ctx context.Context, bucket string, conds return err }, s.retry, s.idempotent) - var e *googleapi.Error - if ok := errors.As(err, &e); ok && e.Code == http.StatusNotFound { - return nil, ErrBucketNotExist - } if err != nil { - return nil, err + return nil, formatBucketError(err) } return newBucket(resp) } @@ -348,6 +343,10 @@ func (c *httpStorageClient) ListObjects(ctx context.Context, bucket string, q *Q it.query = *q } fetch := func(pageSize int, pageToken string) (string, error) { + var err error + // Add trace span around List API call within the fetch. + ctx, _ = startSpan(ctx, "httpStorageClient.ObjectsListCall") + defer func() { endSpan(ctx, err) }() req := c.raw.Objects.List(bucket) if it.query.SoftDeleted { req.SoftDeleted(it.query.SoftDeleted) @@ -376,17 +375,12 @@ func (c *httpStorageClient) ListObjects(ctx context.Context, bucket string, q *Q req.MaxResults(int64(pageSize)) } var resp *raw.Objects - var err error err = run(it.ctx, func(ctx context.Context) error { resp, err = req.Context(ctx).Do() return err }, s.retry, s.idempotent) if err != nil { - var e *googleapi.Error - if ok := errors.As(err, &e); ok && e.Code == http.StatusNotFound { - err = ErrBucketNotExist - } - return "", err + return "", formatBucketError(err) } for _, item := range resp.Items { it.items = append(it.items, newObject(item)) @@ -416,11 +410,7 @@ func (c *httpStorageClient) DeleteObject(ctx context.Context, bucket, object str req.UserProject(s.userProject) } err := run(ctx, func(ctx context.Context) error { return req.Context(ctx).Do() }, s.retry, s.idempotent) - var e *googleapi.Error - if ok := errors.As(err, &e); ok && e.Code == http.StatusNotFound { - return ErrObjectNotExist - } - return err + return formatObjectErr(err) } func (c *httpStorageClient) GetObject(ctx context.Context, params *getObjectParams, opts ...storageOption) (*ObjectAttrs, error) { @@ -445,12 +435,8 @@ func (c *httpStorageClient) GetObject(ctx context.Context, params *getObjectPara obj, err = req.Context(ctx).Do() return err }, s.retry, s.idempotent) - var e *googleapi.Error - if ok := errors.As(err, &e); ok && e.Code == http.StatusNotFound { - return nil, ErrObjectNotExist - } if err != nil { - return nil, err + return nil, formatObjectErr(err) } return newObject(obj), nil } @@ -555,12 +541,8 @@ func (c *httpStorageClient) UpdateObject(ctx context.Context, params *updateObje var obj *raw.Object var err error err = run(ctx, func(ctx context.Context) error { obj, err = call.Context(ctx).Do(); return err }, s.retry, s.idempotent) - var e *googleapi.Error - if errors.As(err, &e) && e.Code == http.StatusNotFound { - return nil, ErrObjectNotExist - } if err != nil { - return nil, err + return nil, formatObjectErr(err) } return newObject(obj), nil } @@ -585,9 +567,8 @@ func (c *httpStorageClient) RestoreObject(ctx context.Context, params *restoreOb var obj *raw.Object var err error err = run(ctx, func(ctx context.Context) error { obj, err = req.Context(ctx).Do(); return err }, s.retry, s.idempotent) - var e *googleapi.Error - if ok := errors.As(err, &e); ok && e.Code == http.StatusNotFound { - return nil, ErrObjectNotExist + if err != nil { + return nil, formatObjectErr(err) } return newObject(obj), err } @@ -610,9 +591,8 @@ func (c *httpStorageClient) MoveObject(ctx context.Context, params *moveObjectPa var obj *raw.Object var err error err = run(ctx, func(ctx context.Context) error { obj, err = req.Context(ctx).Do(); return err }, s.retry, s.idempotent) - var e *googleapi.Error - if ok := errors.As(err, &e); ok && e.Code == http.StatusNotFound { - return nil, ErrObjectNotExist + if err != nil { + return nil, formatObjectErr(err) } return newObject(obj), err } @@ -800,7 +780,7 @@ func (c *httpStorageClient) ComposeObject(ctx context.Context, req *composeObjec retryCall := func(ctx context.Context) error { obj, err = call.Context(ctx).Do(); return err } if err := run(ctx, retryCall, s.retry, s.idempotent); err != nil { - return nil, err + return nil, formatObjectErr(err) } return newObject(obj), nil } @@ -847,7 +827,7 @@ func (c *httpStorageClient) RewriteObject(ctx context.Context, req *rewriteObjec retryCall := func(ctx context.Context) error { res, err = call.Context(ctx).Do(); return err } if err := run(ctx, retryCall, s.retry, s.idempotent); err != nil { - return nil, err + return nil, formatObjectErr(err) } r := &rewriteObjectResponse{ @@ -879,6 +859,7 @@ func (c *httpStorageClient) NewRangeReader(ctx context.Context, params *newRange } func (c *httpStorageClient) newRangeReaderXML(ctx context.Context, params *newRangeReaderParams, s *settings) (r *Reader, err error) { + requestID := uuid.New() u := &url.URL{ Scheme: c.scheme, Host: c.xmlHost, @@ -936,12 +917,13 @@ func (c *httpStorageClient) newRangeReaderXML(ctx context.Context, params *newRa timer := time.After(stallTimeout) select { case <-timer: - log.Printf("stalled read-req (%p) cancelled after %fs", req, stallTimeout.Seconds()) + log.Printf("[%s] stalled read-req cancelled after %fs", requestID, stallTimeout.Seconds()) cancel() - err = context.DeadlineExceeded + <-done if res != nil && res.Body != nil { res.Body.Close() } + return res, context.DeadlineExceeded case <-done: cancel = nil } @@ -981,7 +963,15 @@ func (c *httpStorageClient) newRangeReaderJSON(ctx context.Context, params *newR return parseReadResponse(res, params, reopen) } -func (c *httpStorageClient) OpenWriter(params *openWriterParams, opts ...storageOption) (*io.PipeWriter, error) { +type httpInternalWriter struct { + *io.PipeWriter +} + +func (hiw httpInternalWriter) Flush() (int64, error) { + return 0, errors.New("Writer.Flush is only supported for gRPC-based clients") +} + +func (c *httpStorageClient) OpenWriter(params *openWriterParams, opts ...storageOption) (internalWriter, error) { if params.append { return nil, errors.New("storage: append not supported on HTTP Client; use gRPC") } @@ -1074,7 +1064,7 @@ func (c *httpStorageClient) OpenWriter(params *openWriterParams, opts ...storage setObj(newObject(resp)) }() - return pw, nil + return httpInternalWriter{pw}, nil } // IAM methods. @@ -1273,9 +1263,6 @@ func (c *httpStorageClient) DeleteHMACKey(ctx context.Context, project string, a // Note: This API does not support pagination. However, entity limits cap the number of notifications on a single bucket, // so all results will be returned in the first response. See https://cloud.google.com/storage/quotas#buckets. func (c *httpStorageClient) ListNotifications(ctx context.Context, bucket string, opts ...storageOption) (n map[string]*Notification, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.httpStorageClient.ListNotifications") - defer func() { trace.EndSpan(ctx, err) }() - s := callSettings(c.settings, opts...) call := c.raw.Notifications.List(bucket) if s.userProject != "" { @@ -1293,9 +1280,6 @@ func (c *httpStorageClient) ListNotifications(ctx context.Context, bucket string } func (c *httpStorageClient) CreateNotification(ctx context.Context, bucket string, n *Notification, opts ...storageOption) (ret *Notification, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.httpStorageClient.CreateNotification") - defer func() { trace.EndSpan(ctx, err) }() - s := callSettings(c.settings, opts...) call := c.raw.Notifications.Insert(bucket, toRawNotification(n)) if s.userProject != "" { @@ -1313,9 +1297,6 @@ func (c *httpStorageClient) CreateNotification(ctx context.Context, bucket strin } func (c *httpStorageClient) DeleteNotification(ctx context.Context, bucket string, id string, opts ...storageOption) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.httpStorageClient.DeleteNotification") - defer func() { trace.EndSpan(ctx, err) }() - s := callSettings(c.settings, opts...) call := c.raw.Notifications.Delete(bucket, id) if s.userProject != "" { @@ -1420,13 +1401,7 @@ func readerReopen(ctx context.Context, header http.Header, params *newRangeReade err = run(ctx, func(ctx context.Context) error { res, err = doDownload(ctx) if err != nil { - var e *googleapi.Error - if errors.As(err, &e) { - if e.Code == http.StatusNotFound { - return ErrObjectNotExist - } - } - return err + return formatObjectErr(err) } if res.StatusCode == http.StatusNotFound { @@ -1435,7 +1410,7 @@ func readerReopen(ctx context.Context, header http.Header, params *newRangeReade return ErrObjectNotExist } if res.StatusCode < 200 || res.StatusCode > 299 { - body, _ := ioutil.ReadAll(res.Body) + body, _ := io.ReadAll(res.Body) res.Body.Close() return &googleapi.Error{ Code: res.StatusCode, @@ -1459,7 +1434,7 @@ func readerReopen(ctx context.Context, header http.Header, params *newRangeReade // https://cloud.google.com/storage/docs/transcoding#range, // thus we have to manually move the body forward by seen bytes. if decompressiveTranscoding(res) && seen > 0 { - _, _ = io.CopyN(ioutil.Discard, res.Body, seen) + _, _ = io.CopyN(io.Discard, res.Body, seen) } // If a generation hasn't been specified, and this is the first response we get, let's record the diff --git a/vendor/cloud.google.com/go/storage/iam.go b/vendor/cloud.google.com/go/storage/iam.go index 4c01bff4f3d..9c9a3a87292 100644 --- a/vendor/cloud.google.com/go/storage/iam.go +++ b/vendor/cloud.google.com/go/storage/iam.go @@ -19,7 +19,6 @@ import ( "cloud.google.com/go/iam" "cloud.google.com/go/iam/apiv1/iampb" - "cloud.google.com/go/internal/trace" raw "google.golang.org/api/storage/v1" "google.golang.org/genproto/googleapis/type/expr" ) @@ -45,16 +44,16 @@ func (c *iamClient) Get(ctx context.Context, resource string) (p *iampb.Policy, } func (c *iamClient) GetWithVersion(ctx context.Context, resource string, requestedPolicyVersion int32) (p *iampb.Policy, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.IAM.Get") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "storage.IAM.Get") + defer func() { endSpan(ctx, err) }() o := makeStorageOpts(true, c.retry, c.userProject) return c.client.tc.GetIamPolicy(ctx, resource, requestedPolicyVersion, o...) } func (c *iamClient) Set(ctx context.Context, resource string, p *iampb.Policy) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.IAM.Set") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "storage.IAM.Set") + defer func() { endSpan(ctx, err) }() isIdempotent := len(p.Etag) > 0 o := makeStorageOpts(isIdempotent, c.retry, c.userProject) @@ -62,8 +61,8 @@ func (c *iamClient) Set(ctx context.Context, resource string, p *iampb.Policy) ( } func (c *iamClient) Test(ctx context.Context, resource string, perms []string) (permissions []string, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.IAM.Test") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "storage.IAM.Test") + defer func() { endSpan(ctx, err) }() o := makeStorageOpts(true, c.retry, c.userProject) return c.client.tc.TestIamPermissions(ctx, resource, perms, o...) diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go b/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go index 502fa56786f..c46be7aa77b 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/doc.go @@ -17,15 +17,7 @@ // Package storage is an auto-generated package for the // Cloud Storage API. // -// This folder contains protocol buffer definitions for an API only -// accessible to select customers. Customers not participating should not -// depend on this file. Please contact Google Cloud sales if you are -// interested. Unless told otherwise by a Google Cloud representative, do not -// use or otherwise rely on any of the contents of this folder. If you would -// like to use Cloud Storage, please consult our official documentation (at -// https://cloud.google.com/storage/docs/apis) for details on our XML and -// JSON APIs, or else consider one of our client libraries (at -// https://cloud.google.com/storage/docs/reference/libraries). +// Lets you store and retrieve potentially-large, immutable data objects. // // # General documentation // diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/helpers.go b/vendor/cloud.google.com/go/storage/internal/apiv2/helpers.go index 0de9b31f641..78116e92485 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/helpers.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/helpers.go @@ -18,16 +18,20 @@ package storage import ( "context" + "fmt" "log/slog" "github.com/googleapis/gax-go/v2/internallog/grpclog" "google.golang.org/api/option" "google.golang.org/grpc" "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/runtime/protoimpl" ) const serviceName = "storage.googleapis.com" +var protoVersion = fmt.Sprintf("1.%d", protoimpl.MaxVersion) + // For more information on implementing a client constructor hook, see // https://github.com/googleapis/google-cloud-go/wiki/Customizing-constructors. type clientHookParams struct{} diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go index 4a50254d891..68133628c39 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storage_client.go @@ -510,14 +510,18 @@ func (c *Client) LockBucketRetentionPolicy(ctx context.Context, req *storagepb.L // GetIamPolicy gets the IAM policy for a specified bucket. // The resource field in the request should be -// projects/_/buckets/{bucket}. +// projects/_/buckets/{bucket} for a bucket, or +// projects/_/buckets/{bucket}/managedFolders/{managedFolder} +// for a managed folder. func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { return c.internalClient.GetIamPolicy(ctx, req, opts...) } // SetIamPolicy updates an IAM policy for the specified bucket. // The resource field in the request should be -// projects/_/buckets/{bucket}. +// projects/_/buckets/{bucket} for a bucket, or +// projects/_/buckets/{bucket}/managedFolders/{managedFolder} +// for a managed folder. func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error) { return c.internalClient.SetIamPolicy(ctx, req, opts...) } @@ -876,7 +880,7 @@ func (c *gRPCClient) Connection() *grpc.ClientConn { // use by Google-written clients. func (c *gRPCClient) setGoogleClientInfo(keyval ...string) { kv := append([]string{"gl-go", gax.GoVersion}, keyval...) - kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version) + kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "grpc", grpc.Version, "pb", protoVersion) c.xGoogHeaders = []string{ "x-goog-api-client", gax.XGoogHeader(kv...), } @@ -1056,6 +1060,9 @@ func (c *gRPCClient) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRe if reg := regexp.MustCompile("(?P.*)"); reg.MatchString(req.GetResource()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1])) > 0 { routingHeadersMap["bucket"] = url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1]) } + if reg := regexp.MustCompile("(?Pprojects/[^/]+/buckets/[^/]+)(?:/.*)?"); reg.MatchString(req.GetResource()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1])) > 0 { + routingHeadersMap["bucket"] = url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1]) + } for headerName, headerValue := range routingHeadersMap { routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) } @@ -1083,6 +1090,9 @@ func (c *gRPCClient) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRe if reg := regexp.MustCompile("(?P.*)"); reg.MatchString(req.GetResource()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1])) > 0 { routingHeadersMap["bucket"] = url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1]) } + if reg := regexp.MustCompile("(?Pprojects/[^/]+/buckets/[^/]+)(?:/.*)?"); reg.MatchString(req.GetResource()) && len(url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1])) > 0 { + routingHeadersMap["bucket"] = url.QueryEscape(reg.FindStringSubmatch(req.GetResource())[1]) + } for headerName, headerValue := range routingHeadersMap { routingHeaders = fmt.Sprintf("%s%s=%s&", routingHeaders, headerName, headerValue) } diff --git a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go index 7f286f3549e..ee6639e49d8 100644 --- a/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go +++ b/vendor/cloud.google.com/go/storage/internal/apiv2/storagepb/storage.pb.go @@ -1,4 +1,4 @@ -// Copyright 2024 Google LLC +// Copyright 2025 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,17 +15,14 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.35.2 -// protoc v4.25.3 +// protoc v4.25.7 // source: google/storage/v2/storage.proto package storagepb import ( - context "context" - reflect "reflect" - sync "sync" - iampb "cloud.google.com/go/iam/apiv1/iampb" + context "context" _ "google.golang.org/genproto/googleapis/api/annotations" status "google.golang.org/genproto/googleapis/rpc/status" date "google.golang.org/genproto/googleapis/type/date" @@ -38,6 +35,8 @@ import ( emptypb "google.golang.org/protobuf/types/known/emptypb" fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" ) const ( @@ -181,6 +180,63 @@ func (ServiceConstants_Values) EnumDescriptor() ([]byte, []int) { return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{42, 0} } +// Retention mode values. +type Object_Retention_Mode int32 + +const ( + // No specified mode. Object is not under retention. + Object_Retention_MODE_UNSPECIFIED Object_Retention_Mode = 0 + // Retention period may be decreased or increased. + // The Retention configuration may be removed. + // The mode may be changed to locked. + Object_Retention_UNLOCKED Object_Retention_Mode = 1 + // Retention period may be increased. + // The Retention configuration cannot be removed. + // The mode cannot be changed. + Object_Retention_LOCKED Object_Retention_Mode = 2 +) + +// Enum value maps for Object_Retention_Mode. +var ( + Object_Retention_Mode_name = map[int32]string{ + 0: "MODE_UNSPECIFIED", + 1: "UNLOCKED", + 2: "LOCKED", + } + Object_Retention_Mode_value = map[string]int32{ + "MODE_UNSPECIFIED": 0, + "UNLOCKED": 1, + "LOCKED": 2, + } +) + +func (x Object_Retention_Mode) Enum() *Object_Retention_Mode { + p := new(Object_Retention_Mode) + *p = x + return p +} + +func (x Object_Retention_Mode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Object_Retention_Mode) Descriptor() protoreflect.EnumDescriptor { + return file_google_storage_v2_storage_proto_enumTypes[1].Descriptor() +} + +func (Object_Retention_Mode) Type() protoreflect.EnumType { + return &file_google_storage_v2_storage_proto_enumTypes[1] +} + +func (x Object_Retention_Mode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Object_Retention_Mode.Descriptor instead. +func (Object_Retention_Mode) EnumDescriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{50, 0, 0} +} + // Request message for DeleteBucket. type DeleteBucketRequest struct { state protoimpl.MessageState @@ -331,9 +387,11 @@ type CreateBucketRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Required. The project to which this bucket will belong. + // Required. The project to which this bucket will belong. This field must + // either be empty or `projects/_`. The project ID that owns this bucket + // should be specified in the `bucket.project` field. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Properties of the new bucket being inserted. + // Optional. Properties of the new bucket being inserted. // The name of the bucket is specified in the `bucket_id` field. Populating // `bucket.name` field will result in an error. // The project of the bucket must be specified in the `bucket.project` field. @@ -345,14 +403,16 @@ type CreateBucketRequest struct { // component of the bucket's resource name. For example, the value `foo` might // result in a bucket with the name `projects/123456/buckets/foo`. BucketId string `protobuf:"bytes,3,opt,name=bucket_id,json=bucketId,proto3" json:"bucket_id,omitempty"` - // Apply a predefined set of access controls to this bucket. + // Optional. Apply a predefined set of access controls to this bucket. // Valid values are "authenticatedRead", "private", "projectPrivate", // "publicRead", or "publicReadWrite". PredefinedAcl string `protobuf:"bytes,6,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` - // Apply a predefined set of default object access controls to this bucket. - // Valid values are "authenticatedRead", "bucketOwnerFullControl", + // Optional. Apply a predefined set of default object access controls to this + // bucket. Valid values are "authenticatedRead", "bucketOwnerFullControl", // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". PredefinedDefaultObjectAcl string `protobuf:"bytes,7,opt,name=predefined_default_object_acl,json=predefinedDefaultObjectAcl,proto3" json:"predefined_default_object_acl,omitempty"` + // Optional. If true, enable object retention on the bucket. + EnableObjectRetention bool `protobuf:"varint,9,opt,name=enable_object_retention,json=enableObjectRetention,proto3" json:"enable_object_retention,omitempty"` } func (x *CreateBucketRequest) Reset() { @@ -420,6 +480,13 @@ func (x *CreateBucketRequest) GetPredefinedDefaultObjectAcl() string { return "" } +func (x *CreateBucketRequest) GetEnableObjectRetention() bool { + if x != nil { + return x.EnableObjectRetention + } + return false +} + // Request message for ListBuckets. type ListBucketsRequest struct { state protoimpl.MessageState @@ -428,15 +495,15 @@ type ListBucketsRequest struct { // Required. The project whose buckets we are listing. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Maximum number of buckets to return in a single response. The service will - // use this parameter or 1,000 items, whichever is smaller. If "acl" is - // present in the read_mask, the service will use this parameter of 200 items, - // whichever is smaller. + // Optional. Maximum number of buckets to return in a single response. The + // service will use this parameter or 1,000 items, whichever is smaller. If + // "acl" is present in the read_mask, the service will use this parameter of + // 200 items, whichever is smaller. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // A previously-returned page token representing part of the larger set of - // results to view. + // Optional. A previously-returned page token representing part of the larger + // set of results to view. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // Filter results to buckets whose names begin with this prefix. + // Optional. Filter results to buckets whose names begin with this prefix. Prefix string `protobuf:"bytes,4,opt,name=prefix,proto3" json:"prefix,omitempty"` // Mask specifying which fields to read from each result. // If no mask is specified, will default to all fields except items.owner, @@ -639,12 +706,12 @@ type UpdateBucketRequest struct { // If set, will only modify the bucket if its metageneration does not match // this value. IfMetagenerationNotMatch *int64 `protobuf:"varint,3,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // Apply a predefined set of access controls to this bucket. + // Optional. Apply a predefined set of access controls to this bucket. // Valid values are "authenticatedRead", "private", "projectPrivate", // "publicRead", or "publicReadWrite". PredefinedAcl string `protobuf:"bytes,8,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` - // Apply a predefined set of default object access controls to this bucket. - // Valid values are "authenticatedRead", "bucketOwnerFullControl", + // Optional. Apply a predefined set of default object access controls to this + // bucket. Valid values are "authenticatedRead", "bucketOwnerFullControl", // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". PredefinedDefaultObjectAcl string `protobuf:"bytes,9,opt,name=predefined_default_object_acl,json=predefinedDefaultObjectAcl,proto3" json:"predefined_default_object_acl,omitempty"` // Required. List of fields to be updated. @@ -738,10 +805,11 @@ type ComposeObjectRequest struct { // Required. Properties of the resulting object. Destination *Object `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` - // The list of source objects that will be concatenated into a single object. + // Optional. The list of source objects that will be concatenated into a + // single object. SourceObjects []*ComposeObjectRequest_SourceObject `protobuf:"bytes,2,rep,name=source_objects,json=sourceObjects,proto3" json:"source_objects,omitempty"` - // Apply a predefined set of access controls to the destination object. - // Valid values are "authenticatedRead", "bucketOwnerFullControl", + // Optional. Apply a predefined set of access controls to the destination + // object. Valid values are "authenticatedRead", "bucketOwnerFullControl", // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". DestinationPredefinedAcl string `protobuf:"bytes,9,opt,name=destination_predefined_acl,json=destinationPredefinedAcl,proto3" json:"destination_predefined_acl,omitempty"` // Makes the operation conditional on whether the object's current generation @@ -751,15 +819,16 @@ type ComposeObjectRequest struct { // Makes the operation conditional on whether the object's current // metageneration matches the given value. IfMetagenerationMatch *int64 `protobuf:"varint,5,opt,name=if_metageneration_match,json=ifMetagenerationMatch,proto3,oneof" json:"if_metageneration_match,omitempty"` - // Resource name of the Cloud KMS key, of the form + // Optional. Resource name of the Cloud KMS key, of the form // `projects/my-project/locations/my-location/keyRings/my-kr/cryptoKeys/my-key`, // that will be used to encrypt the object. Overrides the object // metadata's `kms_key_name` value, if any. KmsKey string `protobuf:"bytes,6,opt,name=kms_key,json=kmsKey,proto3" json:"kms_key,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,7,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` - // The checksums of the complete object. This will be validated against the - // combined checksums of the component objects. + // Optional. The checksums of the complete object. This will be validated + // against the combined checksums of the component objects. ObjectChecksums *ObjectChecksums `protobuf:"bytes,10,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` } @@ -862,8 +931,8 @@ type DeleteObjectRequest struct { // Note: If you want to delete an unfinalized resumable upload please use // `CancelResumableWrite`. Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` - // If present, permanently deletes a specific revision of this object (as - // opposed to the latest version, the default). + // Optional. If present, permanently deletes a specific revision of this + // object (as opposed to the latest version, the default). Generation int64 `protobuf:"varint,4,opt,name=generation,proto3" json:"generation,omitempty"` // Makes the operation conditional on whether the object's current generation // matches the given value. Setting to 0 makes the operation succeed only if @@ -880,7 +949,8 @@ type DeleteObjectRequest struct { // Makes the operation conditional on whether the object's current // metageneration does not match the given value. IfMetagenerationNotMatch *int64 `protobuf:"varint,8,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,10,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` } @@ -1008,7 +1078,8 @@ type RestoreObjectRequest struct { // If true, copy the source object's access controls. // Return an error if bucket has UBLA enabled. CopySourceAcl *bool `protobuf:"varint,9,opt,name=copy_source_acl,json=copySourceAcl,proto3,oneof" json:"copy_source_acl,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` } @@ -1209,11 +1280,11 @@ type ReadObjectRequest struct { Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` // Required. The name of the object to read. Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` - // If present, selects a specific revision of this object (as opposed - // to the latest version, the default). + // Optional. If present, selects a specific revision of this object (as + // opposed to the latest version, the default). Generation int64 `protobuf:"varint,3,opt,name=generation,proto3" json:"generation,omitempty"` - // The offset for the first byte to return in the read, relative to the start - // of the object. + // Optional. The offset for the first byte to return in the read, relative to + // the start of the object. // // A negative `read_offset` value will be interpreted as the number of bytes // back from the end of the object to be returned. For example, if an object's @@ -1222,9 +1293,10 @@ type ReadObjectRequest struct { // a negative offset with magnitude larger than the size of the object will // return the entire object. ReadOffset int64 `protobuf:"varint,4,opt,name=read_offset,json=readOffset,proto3" json:"read_offset,omitempty"` - // The maximum number of `data` bytes the server is allowed to return in the - // sum of all `Object` messages. A `read_limit` of zero indicates that there - // is no limit, and a negative `read_limit` will cause an error. + // Optional. The maximum number of `data` bytes the server is allowed to + // return in the sum of all `Object` messages. A `read_limit` of zero + // indicates that there is no limit, and a negative `read_limit` will cause an + // error. // // If the stream returns fewer bytes than allowed by the `read_limit` and no // error occurred, the stream includes all data from the `read_offset` to the @@ -1245,7 +1317,8 @@ type ReadObjectRequest struct { // Makes the operation conditional on whether the object's current // metageneration does not match the given value. IfMetagenerationNotMatch *int64 `protobuf:"varint,9,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,10,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` // Mask specifying which fields to read. // The checksummed_data field and its children will always be present. @@ -1372,8 +1445,8 @@ type GetObjectRequest struct { Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` // Required. Name of the object. Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` - // If present, selects a specific revision of this object (as opposed to the - // latest version, the default). + // Optional. If present, selects a specific revision of this object (as + // opposed to the latest version, the default). Generation int64 `protobuf:"varint,3,opt,name=generation,proto3" json:"generation,omitempty"` // If true, return the soft-deleted version of this object. SoftDeleted *bool `protobuf:"varint,11,opt,name=soft_deleted,json=softDeleted,proto3,oneof" json:"soft_deleted,omitempty"` @@ -1392,7 +1465,8 @@ type GetObjectRequest struct { // Makes the operation conditional on whether the object's current // metageneration does not match the given value. IfMetagenerationNotMatch *int64 `protobuf:"varint,7,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` // Mask specifying which fields to read. // If no mask is specified, will default to all fields except metadata.acl and @@ -1606,8 +1680,8 @@ type BidiReadObjectSpec struct { Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` // Required. The name of the object to read. Object string `protobuf:"bytes,2,opt,name=object,proto3" json:"object,omitempty"` - // If present, selects a specific revision of this object (as opposed - // to the latest version, the default). + // Optional. If present, selects a specific revision of this object (as + // opposed to the latest version, the default). Generation int64 `protobuf:"varint,3,opt,name=generation,proto3" json:"generation,omitempty"` // Makes the operation conditional on whether the object's current generation // matches the given value. Setting to 0 makes the operation succeed only if @@ -1624,7 +1698,8 @@ type BidiReadObjectSpec struct { // Makes the operation conditional on whether the object's current // metageneration does not match the given value. IfMetagenerationNotMatch *int64 `protobuf:"varint,7,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` // Mask specifying which fields to read. // The checksummed_data field and its children will always be present. @@ -1760,15 +1835,16 @@ type BidiReadObjectRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The first message of each stream should set this field. If this is not - // the first message, an error will be returned. Describes the object to read. + // Optional. The first message of each stream should set this field. If this + // is not the first message, an error will be returned. Describes the object + // to read. ReadObjectSpec *BidiReadObjectSpec `protobuf:"bytes,1,opt,name=read_object_spec,json=readObjectSpec,proto3" json:"read_object_spec,omitempty"` - // Provides a list of 0 or more (up to 100) ranges to read. If a single range - // is large enough to require multiple responses, they are guaranteed to be - // delivered in increasing offset order. There are no ordering guarantees - // across ranges. When no ranges are provided, the response message will not - // include ObjectRangeData. For full object downloads, the offset and size can - // be set to 0. + // Optional. Provides a list of 0 or more (up to 100) ranges to read. If a + // single range is large enough to require multiple responses, they are + // guaranteed to be delivered in increasing offset order. There are no + // ordering guarantees across ranges. When no ranges are provided, the + // response message will not include ObjectRangeData. For full object + // downloads, the offset and size can be set to 0. ReadRanges []*ReadRange `protobuf:"bytes,8,rep,name=read_ranges,json=readRanges,proto3" json:"read_ranges,omitempty"` } @@ -1891,17 +1967,19 @@ func (x *BidiReadObjectResponse) GetReadHandle() *BidiReadHandle { return nil } -// Error proto containing details for a redirected read. This error is only -// returned on initial open in case of a redirect. +// Error proto containing details for a redirected read. This error may be +// attached as details for an ABORTED response to BidiReadObject. type BidiReadObjectRedirectedError struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The read handle for the redirected read. The client can use this for the - // subsequent open. + // The read handle for the redirected read. If set, the client may use this in + // the BidiReadObjectSpec when retrying the read stream. ReadHandle *BidiReadHandle `protobuf:"bytes,1,opt,name=read_handle,json=readHandle,proto3" json:"read_handle,omitempty"` - // The routing token that should be used when reopening the read stream. + // The routing token the client must use when retrying the read stream. + // This value must be provided in the header `x-goog-request-params`, with key + // `routing_token` and this string verbatim as the value. RoutingToken *string `protobuf:"bytes,2,opt,name=routing_token,json=routingToken,proto3,oneof" json:"routing_token,omitempty"` } @@ -1949,21 +2027,24 @@ func (x *BidiReadObjectRedirectedError) GetRoutingToken() string { return "" } -// Error proto containing details for a redirected write. This error is only -// returned on initial open in case of a redirect. +// Error proto containing details for a redirected write. This error may be +// attached as details for an ABORTED response to BidiWriteObject. type BidiWriteObjectRedirectedError struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The routing token that should be used when reopening the write stream. + // The routing token the client must use when retrying the write stream. + // This value must be provided in the header `x-goog-request-params`, with key + // `routing_token` and this string verbatim as the value. RoutingToken *string `protobuf:"bytes,1,opt,name=routing_token,json=routingToken,proto3,oneof" json:"routing_token,omitempty"` - // Opaque value describing a previous write. + // Opaque value describing a previous write. If set, the client must use this + // in an AppendObjectSpec first_message when retrying the write stream. If not + // set, clients may retry the original request. WriteHandle *BidiWriteHandle `protobuf:"bytes,2,opt,name=write_handle,json=writeHandle,proto3,oneof" json:"write_handle,omitempty"` - // The generation of the object that triggered the redirect. - // Note that if this error was returned as part of an appendable object - // create, this object generation is now successfully created and - // append_object_spec should be used when reconnecting. + // The generation of the object that triggered the redirect. This will be set + // iff write_handle is set. If set, the client must use this in an + // AppendObjectSpec first_message when retrying the write stream. Generation *int64 `protobuf:"varint,3,opt,name=generation,proto3,oneof" json:"generation,omitempty"` } @@ -2380,7 +2461,7 @@ type WriteObjectSpec struct { // Required. Destination object, including its name and its metadata. Resource *Object `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` - // Apply a predefined set of access controls to this object. + // Optional. Apply a predefined set of access controls to this object. // Valid values are "authenticatedRead", "bucketOwnerFullControl", // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". PredefinedAcl string `protobuf:"bytes,7,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` @@ -2531,19 +2612,20 @@ type WriteObjectRequest struct { // // *WriteObjectRequest_ChecksummedData Data isWriteObjectRequest_Data `protobuf_oneof:"data"` - // Checksums for the complete object. If the checksums computed by the service - // don't match the specified checksums the call will fail. May only be - // provided in the first or last request (either with first_message, or - // finish_write set). + // Optional. Checksums for the complete object. If the checksums computed by + // the service don't match the specified checksums the call will fail. May + // only be provided in the first or last request (either with first_message, + // or finish_write set). ObjectChecksums *ObjectChecksums `protobuf:"bytes,6,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` - // If `true`, this indicates that the write is complete. Sending any + // Optional. If `true`, this indicates that the write is complete. Sending any // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` // will cause an error. // For a non-resumable write (where the upload_id was not set in the first // message), it is an error not to set this field in the final message of the // stream. FinishWrite bool `protobuf:"varint,7,opt,name=finish_write,json=finishWrite,proto3" json:"finish_write,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` } @@ -2772,15 +2854,24 @@ type AppendObjectSpec struct { Generation int64 `protobuf:"varint,3,opt,name=generation,proto3" json:"generation,omitempty"` // Makes the operation conditional on whether the object's current // metageneration matches the given value. + // + // Note that metageneration preconditions are only checked if `write_handle` + // is empty. IfMetagenerationMatch *int64 `protobuf:"varint,4,opt,name=if_metageneration_match,json=ifMetagenerationMatch,proto3,oneof" json:"if_metageneration_match,omitempty"` // Makes the operation conditional on whether the object's current // metageneration does not match the given value. + // + // Note that metageneration preconditions are only checked if `write_handle` + // is empty. IfMetagenerationNotMatch *int64 `protobuf:"varint,5,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` // An optional routing token that influences request routing for the stream. // Must be provided if a BidiWriteObjectRedirectedError is returned. RoutingToken *string `protobuf:"bytes,6,opt,name=routing_token,json=routingToken,proto3,oneof" json:"routing_token,omitempty"` // An optional write handle returned from a previous BidiWriteObjectResponse // message or a BidiWriteObjectRedirectedError error. + // + // Note that metageneration preconditions are only checked if `write_handle` + // is empty. WriteHandle *BidiWriteHandle `protobuf:"bytes,7,opt,name=write_handle,json=writeHandle,proto3,oneof" json:"write_handle,omitempty"` } @@ -2897,35 +2988,36 @@ type BidiWriteObjectRequest struct { // // *BidiWriteObjectRequest_ChecksummedData Data isBidiWriteObjectRequest_Data `protobuf_oneof:"data"` - // Checksums for the complete object. If the checksums computed by the service - // don't match the specified checksums the call will fail. May only be - // provided in the first request or the - // last request (with finish_write set). + // Optional. Checksums for the complete object. If the checksums computed by + // the service don't match the specified checksums the call will fail. May + // only be provided in the first request or the last request (with + // finish_write set). ObjectChecksums *ObjectChecksums `protobuf:"bytes,6,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` - // For each BidiWriteObjectRequest where state_lookup is `true` or the client - // closes the stream, the service will send a BidiWriteObjectResponse - // containing the current persisted size. The persisted size sent in responses - // covers all the bytes the server has persisted thus far and can be used to - // decide what data is safe for the client to drop. Note that the object's - // current size reported by the BidiWriteObjectResponse may lag behind the - // number of bytes written by the client. This field is ignored if - // `finish_write` is set to true. + // Optional. For each BidiWriteObjectRequest where state_lookup is `true` or + // the client closes the stream, the service will send a + // BidiWriteObjectResponse containing the current persisted size. The + // persisted size sent in responses covers all the bytes the server has + // persisted thus far and can be used to decide what data is safe for the + // client to drop. Note that the object's current size reported by the + // BidiWriteObjectResponse may lag behind the number of bytes written by the + // client. This field is ignored if `finish_write` is set to true. StateLookup bool `protobuf:"varint,7,opt,name=state_lookup,json=stateLookup,proto3" json:"state_lookup,omitempty"` - // Persists data written on the stream, up to and including the current - // message, to permanent storage. This option should be used sparingly as it - // may reduce performance. Ongoing writes will periodically be persisted on - // the server even when `flush` is not set. This field is ignored if + // Optional. Persists data written on the stream, up to and including the + // current message, to permanent storage. This option should be used sparingly + // as it may reduce performance. Ongoing writes will periodically be persisted + // on the server even when `flush` is not set. This field is ignored if // `finish_write` is set to true since there's no need to checkpoint or flush // if this message completes the write. Flush bool `protobuf:"varint,8,opt,name=flush,proto3" json:"flush,omitempty"` - // If `true`, this indicates that the write is complete. Sending any + // Optional. If `true`, this indicates that the write is complete. Sending any // `WriteObjectRequest`s subsequent to one in which `finish_write` is `true` // will cause an error. // For a non-resumable write (where the upload_id was not set in the first // message), it is an error not to set this field in the final message of the // stream. FinishWrite bool `protobuf:"varint,9,opt,name=finish_write,json=finishWrite,proto3" json:"finish_write,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,10,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` } @@ -3187,28 +3279,27 @@ type ListObjectsRequest struct { // Required. Name of the bucket in which to look for objects. Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - // Maximum number of `items` plus `prefixes` to return + // Optional. Maximum number of `items` plus `prefixes` to return // in a single page of responses. As duplicate `prefixes` are // omitted, fewer total results may be returned than requested. The service // will use this parameter or 1,000 items, whichever is smaller. PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // A previously-returned page token representing part of the larger set of - // results to view. + // Optional. A previously-returned page token representing part of the larger + // set of results to view. PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` - // If set, returns results in a directory-like mode. `items` will contain - // only objects whose names, aside from the `prefix`, do not - // contain `delimiter`. Objects whose names, aside from the - // `prefix`, contain `delimiter` will have their name, - // truncated after the `delimiter`, returned in - // `prefixes`. Duplicate `prefixes` are omitted. + // Optional. If set, returns results in a directory-like mode. `items` will + // contain only objects whose names, aside from the `prefix`, do not contain + // `delimiter`. Objects whose names, aside from the `prefix`, contain + // `delimiter` will have their name, truncated after the `delimiter`, returned + // in `prefixes`. Duplicate `prefixes` are omitted. Delimiter string `protobuf:"bytes,4,opt,name=delimiter,proto3" json:"delimiter,omitempty"` - // If true, objects that end in exactly one instance of `delimiter` + // Optional. If true, objects that end in exactly one instance of `delimiter` // will have their metadata included in `items` in addition to // `prefixes`. IncludeTrailingDelimiter bool `protobuf:"varint,5,opt,name=include_trailing_delimiter,json=includeTrailingDelimiter,proto3" json:"include_trailing_delimiter,omitempty"` - // Filter results to objects whose names begin with this prefix. + // Optional. Filter results to objects whose names begin with this prefix. Prefix string `protobuf:"bytes,6,opt,name=prefix,proto3" json:"prefix,omitempty"` - // If `true`, lists all versions of an object as distinct results. + // Optional. If `true`, lists all versions of an object as distinct results. // For more information, see // [Object // Versioning](https://cloud.google.com/storage/docs/object-versioning). @@ -3239,6 +3330,10 @@ type ListObjectsRequest struct { // Glob](https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-objects-and-prefixes-using-glob) // for the full syntax. MatchGlob string `protobuf:"bytes,14,opt,name=match_glob,json=matchGlob,proto3" json:"match_glob,omitempty"` + // Optional. Filter the returned objects. Currently only supported for the + // `contexts` field. If `delimiter` is set, the returned `prefixes` are exempt + // from this filter. + Filter string `protobuf:"bytes,15,opt,name=filter,proto3" json:"filter,omitempty"` } func (x *ListObjectsRequest) Reset() { @@ -3362,6 +3457,13 @@ func (x *ListObjectsRequest) GetMatchGlob() string { return "" } +func (x *ListObjectsRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + // Request object for `QueryWriteStatus`. type QueryWriteStatusRequest struct { state protoimpl.MessageState @@ -3371,7 +3473,8 @@ type QueryWriteStatusRequest struct { // Required. The name of the resume token for the object whose write status is // being requested. UploadId string `protobuf:"bytes,1,opt,name=upload_id,json=uploadId,proto3" json:"upload_id,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,2,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` } @@ -3531,13 +3634,13 @@ type RewriteObjectRequest struct { // Required. Immutable. The name of the bucket containing the destination // object. DestinationBucket string `protobuf:"bytes,25,opt,name=destination_bucket,json=destinationBucket,proto3" json:"destination_bucket,omitempty"` - // The name of the Cloud KMS key that will be used to encrypt the destination - // object. The Cloud KMS key must be located in same location as the object. - // If the parameter is not specified, the request uses the destination - // bucket's default encryption key, if any, or else the Google-managed - // encryption key. + // Optional. The name of the Cloud KMS key that will be used to encrypt the + // destination object. The Cloud KMS key must be located in same location as + // the object. If the parameter is not specified, the request uses the + // destination bucket's default encryption key, if any, or else the + // Google-managed encryption key. DestinationKmsKey string `protobuf:"bytes,27,opt,name=destination_kms_key,json=destinationKmsKey,proto3" json:"destination_kms_key,omitempty"` - // Properties of the destination, post-rewrite object. + // Optional. Properties of the destination, post-rewrite object. // The `name`, `bucket` and `kms_key` fields must not be populated (these // values are specified in the `destination_name`, `destination_bucket`, and // `destination_kms_key` fields). @@ -3549,17 +3652,17 @@ type RewriteObjectRequest struct { SourceBucket string `protobuf:"bytes,2,opt,name=source_bucket,json=sourceBucket,proto3" json:"source_bucket,omitempty"` // Required. Name of the source object. SourceObject string `protobuf:"bytes,3,opt,name=source_object,json=sourceObject,proto3" json:"source_object,omitempty"` - // If present, selects a specific revision of the source object (as opposed to - // the latest version, the default). + // Optional. If present, selects a specific revision of the source object (as + // opposed to the latest version, the default). SourceGeneration int64 `protobuf:"varint,4,opt,name=source_generation,json=sourceGeneration,proto3" json:"source_generation,omitempty"` - // Include this field (from the previous rewrite response) on each rewrite - // request after the first one, until the rewrite response 'done' flag is - // true. Calls that provide a rewriteToken can omit all other request fields, - // but if included those fields must match the values provided in the first - // rewrite request. + // Optional. Include this field (from the previous rewrite response) on each + // rewrite request after the first one, until the rewrite response 'done' flag + // is true. Calls that provide a rewriteToken can omit all other request + // fields, but if included those fields must match the values provided in the + // first rewrite request. RewriteToken string `protobuf:"bytes,5,opt,name=rewrite_token,json=rewriteToken,proto3" json:"rewrite_token,omitempty"` - // Apply a predefined set of access controls to the destination object. - // Valid values are "authenticatedRead", "bucketOwnerFullControl", + // Optional. Apply a predefined set of access controls to the destination + // object. Valid values are "authenticatedRead", "bucketOwnerFullControl", // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". DestinationPredefinedAcl string `protobuf:"bytes,28,opt,name=destination_predefined_acl,json=destinationPredefinedAcl,proto3" json:"destination_predefined_acl,omitempty"` // Makes the operation conditional on whether the object's current generation @@ -3589,30 +3692,30 @@ type RewriteObjectRequest struct { // Makes the operation conditional on whether the source object's current // metageneration does not match the given value. IfSourceMetagenerationNotMatch *int64 `protobuf:"varint,14,opt,name=if_source_metageneration_not_match,json=ifSourceMetagenerationNotMatch,proto3,oneof" json:"if_source_metageneration_not_match,omitempty"` - // The maximum number of bytes that will be rewritten per rewrite request. - // Most callers - // shouldn't need to specify this parameter - it is primarily in place to - // support testing. If specified the value must be an integral multiple of - // 1 MiB (1048576). Also, this only applies to requests where the source and - // destination span locations and/or storage classes. Finally, this value must - // not change across rewrite calls else you'll get an error that the - // `rewriteToken` is invalid. + // Optional. The maximum number of bytes that will be rewritten per rewrite + // request. Most callers shouldn't need to specify this parameter - it is + // primarily in place to support testing. If specified the value must be an + // integral multiple of 1 MiB (1048576). Also, this only applies to requests + // where the source and destination span locations and/or storage classes. + // Finally, this value must not change across rewrite calls else you'll get an + // error that the `rewriteToken` is invalid. MaxBytesRewrittenPerCall int64 `protobuf:"varint,15,opt,name=max_bytes_rewritten_per_call,json=maxBytesRewrittenPerCall,proto3" json:"max_bytes_rewritten_per_call,omitempty"` - // The algorithm used to encrypt the source object, if any. Used if the source - // object was encrypted with a Customer-Supplied Encryption Key. + // Optional. The algorithm used to encrypt the source object, if any. Used if + // the source object was encrypted with a Customer-Supplied Encryption Key. CopySourceEncryptionAlgorithm string `protobuf:"bytes,16,opt,name=copy_source_encryption_algorithm,json=copySourceEncryptionAlgorithm,proto3" json:"copy_source_encryption_algorithm,omitempty"` - // The raw bytes (not base64-encoded) AES-256 encryption key used to encrypt - // the source object, if it was encrypted with a Customer-Supplied Encryption - // Key. - CopySourceEncryptionKeyBytes []byte `protobuf:"bytes,21,opt,name=copy_source_encryption_key_bytes,json=copySourceEncryptionKeyBytes,proto3" json:"copy_source_encryption_key_bytes,omitempty"` - // The raw bytes (not base64-encoded) SHA256 hash of the encryption key used - // to encrypt the source object, if it was encrypted with a Customer-Supplied + // Optional. The raw bytes (not base64-encoded) AES-256 encryption key used to + // encrypt the source object, if it was encrypted with a Customer-Supplied // Encryption Key. + CopySourceEncryptionKeyBytes []byte `protobuf:"bytes,21,opt,name=copy_source_encryption_key_bytes,json=copySourceEncryptionKeyBytes,proto3" json:"copy_source_encryption_key_bytes,omitempty"` + // Optional. The raw bytes (not base64-encoded) SHA256 hash of the encryption + // key used to encrypt the source object, if it was encrypted with a + // Customer-Supplied Encryption Key. CopySourceEncryptionKeySha256Bytes []byte `protobuf:"bytes,22,opt,name=copy_source_encryption_key_sha256_bytes,json=copySourceEncryptionKeySha256Bytes,proto3" json:"copy_source_encryption_key_sha256_bytes,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,19,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` - // The checksums of the complete object. This will be used to validate the - // destination object after rewriting. + // Optional. The checksums of the complete object. This will be used to + // validate the destination object after rewriting. ObjectChecksums *ObjectChecksums `protobuf:"bytes,29,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` } @@ -4072,11 +4175,12 @@ type StartResumableWriteRequest struct { // Required. Contains the information necessary to start a resumable write. WriteObjectSpec *WriteObjectSpec `protobuf:"bytes,1,opt,name=write_object_spec,json=writeObjectSpec,proto3" json:"write_object_spec,omitempty"` - // A set of parameters common to Storage API requests related to an object. + // Optional. A set of parameters common to Storage API requests related to an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,3,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` - // The checksums of the complete object. This is used to validate the - // uploaded object. For each upload, `object_checksums` can be provided when - // initiating a resumable upload with`StartResumableWriteRequest` or when + // Optional. The checksums of the complete object. This is used to validate + // the uploaded object. For each upload, `object_checksums` can be provided + // when initiating a resumable upload with`StartResumableWriteRequest` or when // completing a write with `WriteObjectRequest` with // `finish_write` set to `true`. ObjectChecksums *ObjectChecksums `protobuf:"bytes,5,opt,name=object_checksums,json=objectChecksums,proto3" json:"object_checksums,omitempty"` @@ -4211,7 +4315,7 @@ type UpdateObjectRequest struct { // Makes the operation conditional on whether the object's current // metageneration does not match the given value. IfMetagenerationNotMatch *int64 `protobuf:"varint,5,opt,name=if_metageneration_not_match,json=ifMetagenerationNotMatch,proto3,oneof" json:"if_metageneration_not_match,omitempty"` - // Apply a predefined set of access controls to this object. + // Optional. Apply a predefined set of access controls to this object. // Valid values are "authenticatedRead", "bucketOwnerFullControl", // "bucketOwnerRead", "private", "projectPrivate", or "publicRead". PredefinedAcl string `protobuf:"bytes,10,opt,name=predefined_acl,json=predefinedAcl,proto3" json:"predefined_acl,omitempty"` @@ -4224,8 +4328,11 @@ type UpdateObjectRequest struct { // // Not specifying any fields is an error. UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,7,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` - // A set of parameters common to Storage API requests concerning an object. + // Optional. A set of parameters common to Storage API requests concerning an + // object. CommonObjectRequestParams *CommonObjectRequestParams `protobuf:"bytes,8,opt,name=common_object_request_params,json=commonObjectRequestParams,proto3" json:"common_object_request_params,omitempty"` + // Optional. Overrides the unlocked retention config on the object. + OverrideUnlockedRetention bool `protobuf:"varint,11,opt,name=override_unlocked_retention,json=overrideUnlockedRetention,proto3" json:"override_unlocked_retention,omitempty"` } func (x *UpdateObjectRequest) Reset() { @@ -4314,20 +4421,27 @@ func (x *UpdateObjectRequest) GetCommonObjectRequestParams() *CommonObjectReques return nil } +func (x *UpdateObjectRequest) GetOverrideUnlockedRetention() bool { + if x != nil { + return x.OverrideUnlockedRetention + } + return false +} + // Parameters that can be passed to any object request. type CommonObjectRequestParams struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Encryption algorithm used with the Customer-Supplied Encryption Keys - // feature. + // Optional. Encryption algorithm used with the Customer-Supplied Encryption + // Keys feature. EncryptionAlgorithm string `protobuf:"bytes,1,opt,name=encryption_algorithm,json=encryptionAlgorithm,proto3" json:"encryption_algorithm,omitempty"` - // Encryption key used with the Customer-Supplied Encryption Keys feature. - // In raw bytes format (not base64-encoded). + // Optional. Encryption key used with the Customer-Supplied Encryption Keys + // feature. In raw bytes format (not base64-encoded). EncryptionKeyBytes []byte `protobuf:"bytes,4,opt,name=encryption_key_bytes,json=encryptionKeyBytes,proto3" json:"encryption_key_bytes,omitempty"` - // SHA256 hash of encryption key used with the Customer-Supplied Encryption - // Keys feature. + // Optional. SHA256 hash of encryption key used with the Customer-Supplied + // Encryption Keys feature. EncryptionKeySha256Bytes []byte `protobuf:"bytes,5,opt,name=encryption_key_sha256_bytes,json=encryptionKeySha256Bytes,proto3" json:"encryption_key_sha256_bytes,omitempty"` } @@ -4425,7 +4539,7 @@ type Bucket struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Immutable. The name of the bucket. + // Identifier. The name of the bucket. // Format: `projects/{project}/buckets/{bucket}` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Output only. The user-chosen part of the bucket name. The `{bucket}` @@ -4439,6 +4553,7 @@ type Bucket struct { // Immutable. The project which owns this bucket, in the format of // "projects/{projectIdentifier}". // {projectIdentifier} can be the project ID or project number. + // Output values will always be in project number format. Project string `protobuf:"bytes,3,opt,name=project,proto3" json:"project,omitempty"` // Output only. The metadata generation of this bucket. Metageneration int64 `protobuf:"varint,4,opt,name=metageneration,proto3" json:"metageneration,omitempty"` @@ -4452,92 +4567,94 @@ type Bucket struct { // Output only. The location type of the bucket (region, dual-region, // multi-region, etc). LocationType string `protobuf:"bytes,6,opt,name=location_type,json=locationType,proto3" json:"location_type,omitempty"` - // The bucket's default storage class, used whenever no storageClass is - // specified for a newly-created object. This defines how objects in the + // Optional. The bucket's default storage class, used whenever no storageClass + // is specified for a newly-created object. This defines how objects in the // bucket are stored and determines the SLA and the cost of storage. // If this value is not specified when the bucket is created, it will default // to `STANDARD`. For more information, see // https://developers.google.com/storage/docs/storage-classes. StorageClass string `protobuf:"bytes,7,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` - // The recovery point objective for cross-region replication of the bucket. - // Applicable only for dual- and multi-region buckets. "DEFAULT" uses default - // replication. "ASYNC_TURBO" enables turbo replication, valid for dual-region - // buckets only. If rpo is not specified when the bucket is created, it - // defaults to "DEFAULT". For more information, see + // Optional. The recovery point objective for cross-region replication of the + // bucket. Applicable only for dual- and multi-region buckets. "DEFAULT" uses + // default replication. "ASYNC_TURBO" enables turbo replication, valid for + // dual-region buckets only. If rpo is not specified when the bucket is + // created, it defaults to "DEFAULT". For more information, see // https://cloud.google.com/storage/docs/availability-durability#turbo-replication. Rpo string `protobuf:"bytes,27,opt,name=rpo,proto3" json:"rpo,omitempty"` - // Access controls on the bucket. + // Optional. Access controls on the bucket. // If iam_config.uniform_bucket_level_access is enabled on this bucket, // requests to set, read, or modify acl is an error. Acl []*BucketAccessControl `protobuf:"bytes,8,rep,name=acl,proto3" json:"acl,omitempty"` - // Default access controls to apply to new objects when no ACL is provided. - // If iam_config.uniform_bucket_level_access is enabled on this bucket, - // requests to set, read, or modify acl is an error. + // Optional. Default access controls to apply to new objects when no ACL is + // provided. If iam_config.uniform_bucket_level_access is enabled on this + // bucket, requests to set, read, or modify acl is an error. DefaultObjectAcl []*ObjectAccessControl `protobuf:"bytes,9,rep,name=default_object_acl,json=defaultObjectAcl,proto3" json:"default_object_acl,omitempty"` - // The bucket's lifecycle config. See + // Optional. The bucket's lifecycle config. See // [https://developers.google.com/storage/docs/lifecycle]Lifecycle Management] // for more information. Lifecycle *Bucket_Lifecycle `protobuf:"bytes,10,opt,name=lifecycle,proto3" json:"lifecycle,omitempty"` // Output only. The creation time of the bucket. CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - // The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource Sharing] - // (CORS) config. + // Optional. The bucket's [https://www.w3.org/TR/cors/][Cross-Origin Resource + // Sharing] (CORS) config. Cors []*Bucket_Cors `protobuf:"bytes,12,rep,name=cors,proto3" json:"cors,omitempty"` // Output only. The modification time of the bucket. UpdateTime *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // The default value for event-based hold on newly created objects in this - // bucket. Event-based hold is a way to retain objects indefinitely until an - // event occurs, signified by the - // hold's release. After being released, such objects will be subject to - // bucket-level retention (if any). One sample use case of this flag is for - // banks to hold loan documents for at least 3 years after loan is paid in - // full. Here, bucket-level retention is 3 years and the event is loan being - // paid in full. In this example, these objects will be held intact for any - // number of years until the event has occurred (event-based hold on the - // object is released) and then 3 more years after that. That means retention - // duration of the objects begins from the moment event-based hold - // transitioned from true to false. Objects under event-based hold cannot be - // deleted, overwritten or archived until the hold is removed. + // Optional. The default value for event-based hold on newly created objects + // in this bucket. Event-based hold is a way to retain objects indefinitely + // until an event occurs, signified by the hold's release. After being + // released, such objects will be subject to bucket-level retention (if any). + // One sample use case of this flag is for banks to hold loan documents for at + // least 3 years after loan is paid in full. Here, bucket-level retention is 3 + // years and the event is loan being paid in full. In this example, these + // objects will be held intact for any number of years until the event has + // occurred (event-based hold on the object is released) and then 3 more years + // after that. That means retention duration of the objects begins from the + // moment event-based hold transitioned from true to false. Objects under + // event-based hold cannot be deleted, overwritten or archived until the hold + // is removed. DefaultEventBasedHold bool `protobuf:"varint,14,opt,name=default_event_based_hold,json=defaultEventBasedHold,proto3" json:"default_event_based_hold,omitempty"` - // User-provided labels, in key/value pairs. + // Optional. User-provided labels, in key/value pairs. Labels map[string]string `protobuf:"bytes,15,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - // The bucket's website config, controlling how the service behaves + // Optional. The bucket's website config, controlling how the service behaves // when accessing bucket contents as a web site. See the // [https://cloud.google.com/storage/docs/static-website][Static Website // Examples] for more information. Website *Bucket_Website `protobuf:"bytes,16,opt,name=website,proto3" json:"website,omitempty"` - // The bucket's versioning config. + // Optional. The bucket's versioning config. Versioning *Bucket_Versioning `protobuf:"bytes,17,opt,name=versioning,proto3" json:"versioning,omitempty"` - // The bucket's logging config, which defines the destination bucket + // Optional. The bucket's logging config, which defines the destination bucket // and name prefix (if any) for the current bucket's logs. Logging *Bucket_Logging `protobuf:"bytes,18,opt,name=logging,proto3" json:"logging,omitempty"` // Output only. The owner of the bucket. This is always the project team's // owner group. Owner *Owner `protobuf:"bytes,19,opt,name=owner,proto3" json:"owner,omitempty"` - // Encryption config for a bucket. + // Optional. Encryption config for a bucket. Encryption *Bucket_Encryption `protobuf:"bytes,20,opt,name=encryption,proto3" json:"encryption,omitempty"` - // The bucket's billing config. + // Optional. The bucket's billing config. Billing *Bucket_Billing `protobuf:"bytes,21,opt,name=billing,proto3" json:"billing,omitempty"` - // The bucket's retention policy. The retention policy enforces a minimum - // retention time for all objects contained in the bucket, based on their - // creation time. Any attempt to overwrite or delete objects younger than the - // retention period will result in a PERMISSION_DENIED error. An unlocked - // retention policy can be modified or removed from the bucket via a + // Optional. The bucket's retention policy. The retention policy enforces a + // minimum retention time for all objects contained in the bucket, based on + // their creation time. Any attempt to overwrite or delete objects younger + // than the retention period will result in a PERMISSION_DENIED error. An + // unlocked retention policy can be modified or removed from the bucket via a // storage.buckets.update operation. A locked retention policy cannot be // removed or shortened in duration for the lifetime of the bucket. // Attempting to remove or decrease period of a locked retention policy will // result in a PERMISSION_DENIED error. RetentionPolicy *Bucket_RetentionPolicy `protobuf:"bytes,22,opt,name=retention_policy,json=retentionPolicy,proto3" json:"retention_policy,omitempty"` - // The bucket's IAM config. + // Optional. The bucket's IAM config. IamConfig *Bucket_IamConfig `protobuf:"bytes,23,opt,name=iam_config,json=iamConfig,proto3" json:"iam_config,omitempty"` - // Reserved for future use. + // Optional. Reserved for future use. SatisfiesPzs bool `protobuf:"varint,25,opt,name=satisfies_pzs,json=satisfiesPzs,proto3" json:"satisfies_pzs,omitempty"` - // Configuration that, if present, specifies the data placement for a + // Optional. Configuration that, if present, specifies the data placement for + // a // [https://cloud.google.com/storage/docs/locations#location-dr][configurable // dual-region]. CustomPlacementConfig *Bucket_CustomPlacementConfig `protobuf:"bytes,26,opt,name=custom_placement_config,json=customPlacementConfig,proto3" json:"custom_placement_config,omitempty"` - // The bucket's Autoclass configuration. If there is no configuration, the - // Autoclass feature will be disabled and have no effect on the bucket. + // Optional. The bucket's Autoclass configuration. If there is no + // configuration, the Autoclass feature will be disabled and have no effect on + // the bucket. Autoclass *Bucket_Autoclass `protobuf:"bytes,28,opt,name=autoclass,proto3" json:"autoclass,omitempty"` // Optional. The bucket's hierarchical namespace configuration. If there is no // configuration, the hierarchical namespace feature will be disabled and have @@ -4546,6 +4663,11 @@ type Bucket struct { // Optional. The bucket's soft delete policy. The soft delete policy prevents // soft-deleted objects from being permanently deleted. SoftDeletePolicy *Bucket_SoftDeletePolicy `protobuf:"bytes,31,opt,name=soft_delete_policy,json=softDeletePolicy,proto3" json:"soft_delete_policy,omitempty"` + // Optional. The bucket's object retention configuration. Must be enabled + // before objects in the bucket may have retention configured. + ObjectRetention *Bucket_ObjectRetention `protobuf:"bytes,33,opt,name=object_retention,json=objectRetention,proto3" json:"object_retention,omitempty"` + // Optional. The bucket's IP filter configuration. + IpFilter *Bucket_IpFilter `protobuf:"bytes,38,opt,name=ip_filter,json=ipFilter,proto3,oneof" json:"ip_filter,omitempty"` } func (x *Bucket) Reset() { @@ -4788,17 +4910,31 @@ func (x *Bucket) GetSoftDeletePolicy() *Bucket_SoftDeletePolicy { return nil } +func (x *Bucket) GetObjectRetention() *Bucket_ObjectRetention { + if x != nil { + return x.ObjectRetention + } + return nil +} + +func (x *Bucket) GetIpFilter() *Bucket_IpFilter { + if x != nil { + return x.IpFilter + } + return nil +} + // An access-control entry. type BucketAccessControl struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The access permission for the entity. + // Optional. The access permission for the entity. Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - // The ID of the access-control entry. + // Optional. The ID of the access-control entry. Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - // The entity holding the permission, in one of the following forms: + // Optional. The entity holding the permission, in one of the following forms: // * `user-{userid}` // * `user-{email}` // * `group-{groupid}` @@ -4820,18 +4956,18 @@ type BucketAccessControl struct { // Output only. The alternative entity format, if exists. For project // entities, `project-{team}-{projectid}` format will be returned on response. EntityAlt string `protobuf:"bytes,9,opt,name=entity_alt,json=entityAlt,proto3" json:"entity_alt,omitempty"` - // The ID for the entity, if any. + // Optional. The ID for the entity, if any. EntityId string `protobuf:"bytes,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` - // The etag of the BucketAccessControl. + // Optional. The etag of the BucketAccessControl. // If included in the metadata of an update or delete request message, the // operation operation will only be performed if the etag matches that of the // bucket's BucketAccessControl. Etag string `protobuf:"bytes,8,opt,name=etag,proto3" json:"etag,omitempty"` - // The email address associated with the entity, if any. + // Optional. The email address associated with the entity, if any. Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` - // The domain associated with the entity, if any. + // Optional. The domain associated with the entity, if any. Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"` - // The project team associated with the entity, if any. + // Optional. The project team associated with the entity, if any. ProjectTeam *ProjectTeam `protobuf:"bytes,7,opt,name=project_team,json=projectTeam,proto3" json:"project_team,omitempty"` } @@ -4996,7 +5132,7 @@ type ObjectChecksums struct { // If set in a WriteObjectRequest, service will validate that the stored // object matches this checksum. Crc32C *uint32 `protobuf:"fixed32,1,opt,name=crc32c,proto3,oneof" json:"crc32c,omitempty"` - // 128 bit MD5 hash of the object data. + // Optional. 128 bit MD5 hash of the object data. // For more information about using the MD5 hash, see // [https://cloud.google.com/storage/docs/hashes-etags#json-api][Hashes and // ETags: Best Practices]. @@ -5050,6 +5186,118 @@ func (x *ObjectChecksums) GetMd5Hash() []byte { return nil } +// The payload of a single user-defined object context. +type ObjectCustomContextPayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Required. The value of the object context. + Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + // Output only. The time at which the object context was created. + CreateTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + // Output only. The time at which the object context was last updated. + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` +} + +func (x *ObjectCustomContextPayload) Reset() { + *x = ObjectCustomContextPayload{} + mi := &file_google_storage_v2_storage_proto_msgTypes[47] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ObjectCustomContextPayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectCustomContextPayload) ProtoMessage() {} + +func (x *ObjectCustomContextPayload) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[47] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectCustomContextPayload.ProtoReflect.Descriptor instead. +func (*ObjectCustomContextPayload) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{47} +} + +func (x *ObjectCustomContextPayload) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *ObjectCustomContextPayload) GetCreateTime() *timestamppb.Timestamp { + if x != nil { + return x.CreateTime + } + return nil +} + +func (x *ObjectCustomContextPayload) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +// All contexts of an object grouped by type. +type ObjectContexts struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. User-defined object contexts. + Custom map[string]*ObjectCustomContextPayload `protobuf:"bytes,1,rep,name=custom,proto3" json:"custom,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *ObjectContexts) Reset() { + *x = ObjectContexts{} + mi := &file_google_storage_v2_storage_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ObjectContexts) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ObjectContexts) ProtoMessage() {} + +func (x *ObjectContexts) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[48] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ObjectContexts.ProtoReflect.Descriptor instead. +func (*ObjectContexts) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{48} +} + +func (x *ObjectContexts) GetCustom() map[string]*ObjectCustomContextPayload { + if x != nil { + return x.Custom + } + return nil +} + // Describes the Customer-Supplied Encryption Key mechanism used to store an // Object's data at rest. type CustomerEncryption struct { @@ -5057,16 +5305,16 @@ type CustomerEncryption struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The encryption algorithm. + // Optional. The encryption algorithm. EncryptionAlgorithm string `protobuf:"bytes,1,opt,name=encryption_algorithm,json=encryptionAlgorithm,proto3" json:"encryption_algorithm,omitempty"` - // SHA256 hash value of the encryption key. + // Optional. SHA256 hash value of the encryption key. // In raw bytes format (not base64-encoded). KeySha256Bytes []byte `protobuf:"bytes,3,opt,name=key_sha256_bytes,json=keySha256Bytes,proto3" json:"key_sha256_bytes,omitempty"` } func (x *CustomerEncryption) Reset() { *x = CustomerEncryption{} - mi := &file_google_storage_v2_storage_proto_msgTypes[47] + mi := &file_google_storage_v2_storage_proto_msgTypes[49] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5078,7 +5326,7 @@ func (x *CustomerEncryption) String() string { func (*CustomerEncryption) ProtoMessage() {} func (x *CustomerEncryption) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[47] + mi := &file_google_storage_v2_storage_proto_msgTypes[49] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5091,7 +5339,7 @@ func (x *CustomerEncryption) ProtoReflect() protoreflect.Message { // Deprecated: Use CustomerEncryption.ProtoReflect.Descriptor instead. func (*CustomerEncryption) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{47} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{49} } func (x *CustomerEncryption) GetEncryptionAlgorithm() string { @@ -5124,7 +5372,7 @@ type Object struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Immutable. The name of the bucket containing this object. Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` - // The etag of the object. + // Optional. The etag of the object. // If included in the metadata of an update or delete request message, the // operation will only be performed if the etag matches that of the live // object. @@ -5141,27 +5389,27 @@ type Object struct { // metageneration number is only meaningful in the context of a particular // generation of a particular object. Metageneration int64 `protobuf:"varint,4,opt,name=metageneration,proto3" json:"metageneration,omitempty"` - // Storage class of the object. + // Optional. Storage class of the object. StorageClass string `protobuf:"bytes,5,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` // Output only. Content-Length of the object data in bytes, matching // [https://tools.ietf.org/html/rfc7230#section-3.3.2][RFC 7230 §3.3.2]. Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` - // Content-Encoding of the object data, matching + // Optional. Content-Encoding of the object data, matching // [https://tools.ietf.org/html/rfc7231#section-3.1.2.2][RFC 7231 §3.1.2.2] ContentEncoding string `protobuf:"bytes,7,opt,name=content_encoding,json=contentEncoding,proto3" json:"content_encoding,omitempty"` - // Content-Disposition of the object data, matching + // Optional. Content-Disposition of the object data, matching // [https://tools.ietf.org/html/rfc6266][RFC 6266]. ContentDisposition string `protobuf:"bytes,8,opt,name=content_disposition,json=contentDisposition,proto3" json:"content_disposition,omitempty"` - // Cache-Control directive for the object data, matching + // Optional. Cache-Control directive for the object data, matching // [https://tools.ietf.org/html/rfc7234#section-5.2"][RFC 7234 §5.2]. // If omitted, and the object is accessible to all anonymous users, the // default will be `public, max-age=3600`. CacheControl string `protobuf:"bytes,9,opt,name=cache_control,json=cacheControl,proto3" json:"cache_control,omitempty"` - // Access controls on the object. + // Optional. Access controls on the object. // If iam_config.uniform_bucket_level_access is enabled on the parent // bucket, requests to set, read, or modify acl is an error. Acl []*ObjectAccessControl `protobuf:"bytes,10,rep,name=acl,proto3" json:"acl,omitempty"` - // Content-Language of the object data, matching + // Optional. Content-Language of the object data, matching // [https://tools.ietf.org/html/rfc7231#section-3.1.3.2][RFC 7231 §3.1.3.2]. ContentLanguage string `protobuf:"bytes,11,opt,name=content_language,json=contentLanguage,proto3" json:"content_language,omitempty"` // Output only. If this object is noncurrent, this is the time when the object @@ -5169,7 +5417,7 @@ type Object struct { DeleteTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=delete_time,json=deleteTime,proto3" json:"delete_time,omitempty"` // Output only. The time when the object was finalized. FinalizeTime *timestamppb.Timestamp `protobuf:"bytes,36,opt,name=finalize_time,json=finalizeTime,proto3" json:"finalize_time,omitempty"` - // Content-Type of the object data, matching + // Optional. Content-Type of the object data, matching // [https://tools.ietf.org/html/rfc7231#section-3.1.1.5][RFC 7231 §3.1.1.5]. // If an object is stored without a Content-Type, it is served as // `application/octet-stream`. @@ -5192,28 +5440,32 @@ type Object struct { // on behalf of a requester, such as changing the storage class based on an // Object Lifecycle Configuration. UpdateTime *timestamppb.Timestamp `protobuf:"bytes,17,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - // Cloud KMS Key used to encrypt this object, if the object is encrypted by - // such a key. + // Optional. Cloud KMS Key used to encrypt this object, if the object is + // encrypted by such a key. KmsKey string `protobuf:"bytes,18,opt,name=kms_key,json=kmsKey,proto3" json:"kms_key,omitempty"` // Output only. The time at which the object's storage class was last changed. // When the object is initially created, it will be set to time_created. UpdateStorageClassTime *timestamppb.Timestamp `protobuf:"bytes,19,opt,name=update_storage_class_time,json=updateStorageClassTime,proto3" json:"update_storage_class_time,omitempty"` - // Whether an object is under temporary hold. While this flag is set to true, - // the object is protected against deletion and overwrites. A common use case - // of this flag is regulatory investigations where objects need to be retained - // while the investigation is ongoing. Note that unlike event-based hold, - // temporary hold does not impact retention expiration time of an object. + // Optional. Whether an object is under temporary hold. While this flag is set + // to true, the object is protected against deletion and overwrites. A common + // use case of this flag is regulatory investigations where objects need to be + // retained while the investigation is ongoing. Note that unlike event-based + // hold, temporary hold does not impact retention expiration time of an + // object. TemporaryHold bool `protobuf:"varint,20,opt,name=temporary_hold,json=temporaryHold,proto3" json:"temporary_hold,omitempty"` - // A server-determined value that specifies the earliest time that the - // object's retention period expires. - // Note 1: This field is not provided for objects with an active event-based - // hold, since retention expiration is unknown until the hold is removed. - // Note 2: This value can be provided even when temporary hold is set (so that - // the user can reason about policy without having to first unset the - // temporary hold). + // Optional. A server-determined value that specifies the earliest time that + // the object's retention period expires. Note 1: This field is not provided + // for objects with an active event-based hold, since retention expiration is + // unknown until the hold is removed. Note 2: This value can be provided even + // when temporary hold is set (so that the user can reason about policy + // without having to first unset the temporary hold). RetentionExpireTime *timestamppb.Timestamp `protobuf:"bytes,21,opt,name=retention_expire_time,json=retentionExpireTime,proto3" json:"retention_expire_time,omitempty"` - // User-provided metadata, in key/value pairs. + // Optional. User-provided metadata, in key/value pairs. Metadata map[string]string `protobuf:"bytes,22,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Optional. User-defined or system-defined object contexts. Each object + // context is a key-payload pair, where the key provides the identification + // and the payload holds the associated value and additional metadata. + Contexts *ObjectContexts `protobuf:"bytes,38,opt,name=contexts,proto3" json:"contexts,omitempty"` // Whether an object is under event-based hold. // An event-based hold is a way to force the retention of an object until // after some event occurs. Once the hold is released by explicitly setting @@ -5229,10 +5481,10 @@ type Object struct { // Output only. The owner of the object. This will always be the uploader of // the object. Owner *Owner `protobuf:"bytes,24,opt,name=owner,proto3" json:"owner,omitempty"` - // Metadata of Customer-Supplied Encryption Key, if the object is encrypted by - // such a key. + // Optional. Metadata of Customer-Supplied Encryption Key, if the object is + // encrypted by such a key. CustomerEncryption *CustomerEncryption `protobuf:"bytes,25,opt,name=customer_encryption,json=customerEncryption,proto3" json:"customer_encryption,omitempty"` - // A user-specified timestamp set on an object. + // Optional. A user-specified timestamp set on an object. CustomTime *timestamppb.Timestamp `protobuf:"bytes,26,opt,name=custom_time,json=customTime,proto3" json:"custom_time,omitempty"` // Output only. This is the time when the object became soft-deleted. // @@ -5244,11 +5496,14 @@ type Object struct { // Only set when an object becomes soft-deleted with a soft_delete_policy. // Otherwise, the object will not be accessible. HardDeleteTime *timestamppb.Timestamp `protobuf:"bytes,29,opt,name=hard_delete_time,json=hardDeleteTime,proto3,oneof" json:"hard_delete_time,omitempty"` + // Optional. Retention configuration of this object. + // May only be configured if the bucket has object retention enabled. + Retention *Object_Retention `protobuf:"bytes,30,opt,name=retention,proto3" json:"retention,omitempty"` } func (x *Object) Reset() { *x = Object{} - mi := &file_google_storage_v2_storage_proto_msgTypes[48] + mi := &file_google_storage_v2_storage_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5260,7 +5515,7 @@ func (x *Object) String() string { func (*Object) ProtoMessage() {} func (x *Object) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[48] + mi := &file_google_storage_v2_storage_proto_msgTypes[50] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5273,7 +5528,7 @@ func (x *Object) ProtoReflect() protoreflect.Message { // Deprecated: Use Object.ProtoReflect.Descriptor instead. func (*Object) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{48} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{50} } func (x *Object) GetName() string { @@ -5451,6 +5706,13 @@ func (x *Object) GetMetadata() map[string]string { return nil } +func (x *Object) GetContexts() *ObjectContexts { + if x != nil { + return x.Contexts + } + return nil +} + func (x *Object) GetEventBasedHold() bool { if x != nil && x.EventBasedHold != nil { return *x.EventBasedHold @@ -5493,20 +5755,28 @@ func (x *Object) GetHardDeleteTime() *timestamppb.Timestamp { return nil } +func (x *Object) GetRetention() *Object_Retention { + if x != nil { + return x.Retention + } + return nil +} + // An access-control entry. type ObjectAccessControl struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The access permission for the entity. One of the following values: + // Optional. The access permission for the entity. One of the following + // values: // * `READER` // * `WRITER` // * `OWNER` Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` - // The ID of the access-control entry. + // Optional. The ID of the access-control entry. Id string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - // The entity holding the permission, in one of the following forms: + // Optional. The entity holding the permission, in one of the following forms: // * `user-{userid}` // * `user-{email}` // * `group-{groupid}` @@ -5528,24 +5798,24 @@ type ObjectAccessControl struct { // Output only. The alternative entity format, if exists. For project // entities, `project-{team}-{projectid}` format will be returned on response. EntityAlt string `protobuf:"bytes,9,opt,name=entity_alt,json=entityAlt,proto3" json:"entity_alt,omitempty"` - // The ID for the entity, if any. + // Optional. The ID for the entity, if any. EntityId string `protobuf:"bytes,4,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` - // The etag of the ObjectAccessControl. + // Optional. The etag of the ObjectAccessControl. // If included in the metadata of an update or delete request message, the // operation will only be performed if the etag matches that of the live // object's ObjectAccessControl. Etag string `protobuf:"bytes,8,opt,name=etag,proto3" json:"etag,omitempty"` - // The email address associated with the entity, if any. + // Optional. The email address associated with the entity, if any. Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` - // The domain associated with the entity, if any. + // Optional. The domain associated with the entity, if any. Domain string `protobuf:"bytes,6,opt,name=domain,proto3" json:"domain,omitempty"` - // The project team associated with the entity, if any. + // Optional. The project team associated with the entity, if any. ProjectTeam *ProjectTeam `protobuf:"bytes,7,opt,name=project_team,json=projectTeam,proto3" json:"project_team,omitempty"` } func (x *ObjectAccessControl) Reset() { *x = ObjectAccessControl{} - mi := &file_google_storage_v2_storage_proto_msgTypes[49] + mi := &file_google_storage_v2_storage_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5557,7 +5827,7 @@ func (x *ObjectAccessControl) String() string { func (*ObjectAccessControl) ProtoMessage() {} func (x *ObjectAccessControl) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[49] + mi := &file_google_storage_v2_storage_proto_msgTypes[51] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5570,7 +5840,7 @@ func (x *ObjectAccessControl) ProtoReflect() protoreflect.Message { // Deprecated: Use ObjectAccessControl.ProtoReflect.Descriptor instead. func (*ObjectAccessControl) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{49} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{51} } func (x *ObjectAccessControl) GetRole() string { @@ -5654,7 +5924,7 @@ type ListObjectsResponse struct { func (x *ListObjectsResponse) Reset() { *x = ListObjectsResponse{} - mi := &file_google_storage_v2_storage_proto_msgTypes[50] + mi := &file_google_storage_v2_storage_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5666,7 +5936,7 @@ func (x *ListObjectsResponse) String() string { func (*ListObjectsResponse) ProtoMessage() {} func (x *ListObjectsResponse) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[50] + mi := &file_google_storage_v2_storage_proto_msgTypes[52] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5679,7 +5949,7 @@ func (x *ListObjectsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListObjectsResponse.ProtoReflect.Descriptor instead. func (*ListObjectsResponse) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{50} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{52} } func (x *ListObjectsResponse) GetObjects() []*Object { @@ -5709,15 +5979,15 @@ type ProjectTeam struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The project number. + // Optional. The project number. ProjectNumber string `protobuf:"bytes,1,opt,name=project_number,json=projectNumber,proto3" json:"project_number,omitempty"` - // The team. + // Optional. The team. Team string `protobuf:"bytes,2,opt,name=team,proto3" json:"team,omitempty"` } func (x *ProjectTeam) Reset() { *x = ProjectTeam{} - mi := &file_google_storage_v2_storage_proto_msgTypes[51] + mi := &file_google_storage_v2_storage_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5729,7 +5999,7 @@ func (x *ProjectTeam) String() string { func (*ProjectTeam) ProtoMessage() {} func (x *ProjectTeam) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[51] + mi := &file_google_storage_v2_storage_proto_msgTypes[53] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5742,7 +6012,7 @@ func (x *ProjectTeam) ProtoReflect() protoreflect.Message { // Deprecated: Use ProjectTeam.ProtoReflect.Descriptor instead. func (*ProjectTeam) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{51} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{53} } func (x *ProjectTeam) GetProjectNumber() string { @@ -5765,15 +6035,15 @@ type Owner struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The entity, in the form `user-`*userId*. + // Optional. The entity, in the form `user-`*userId*. Entity string `protobuf:"bytes,1,opt,name=entity,proto3" json:"entity,omitempty"` - // The ID for the entity. + // Optional. The ID for the entity. EntityId string `protobuf:"bytes,2,opt,name=entity_id,json=entityId,proto3" json:"entity_id,omitempty"` } func (x *Owner) Reset() { *x = Owner{} - mi := &file_google_storage_v2_storage_proto_msgTypes[52] + mi := &file_google_storage_v2_storage_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5785,7 +6055,7 @@ func (x *Owner) String() string { func (*Owner) ProtoMessage() {} func (x *Owner) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[52] + mi := &file_google_storage_v2_storage_proto_msgTypes[54] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5798,7 +6068,7 @@ func (x *Owner) ProtoReflect() protoreflect.Message { // Deprecated: Use Owner.ProtoReflect.Descriptor instead. func (*Owner) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{52} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{54} } func (x *Owner) GetEntity() string { @@ -5831,7 +6101,7 @@ type ContentRange struct { func (x *ContentRange) Reset() { *x = ContentRange{} - mi := &file_google_storage_v2_storage_proto_msgTypes[53] + mi := &file_google_storage_v2_storage_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5843,7 +6113,7 @@ func (x *ContentRange) String() string { func (*ContentRange) ProtoMessage() {} func (x *ContentRange) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[53] + mi := &file_google_storage_v2_storage_proto_msgTypes[55] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5856,7 +6126,7 @@ func (x *ContentRange) ProtoReflect() protoreflect.Message { // Deprecated: Use ContentRange.ProtoReflect.Descriptor instead. func (*ContentRange) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{53} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{55} } func (x *ContentRange) GetStart() int64 { @@ -5889,15 +6159,15 @@ type ComposeObjectRequest_SourceObject struct { // Required. The source object's name. All source objects must reside in the // same bucket. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // The generation of this object to use as the source. + // Optional. The generation of this object to use as the source. Generation int64 `protobuf:"varint,2,opt,name=generation,proto3" json:"generation,omitempty"` - // Conditions that must be met for this operation to execute. + // Optional. Conditions that must be met for this operation to execute. ObjectPreconditions *ComposeObjectRequest_SourceObject_ObjectPreconditions `protobuf:"bytes,3,opt,name=object_preconditions,json=objectPreconditions,proto3" json:"object_preconditions,omitempty"` } func (x *ComposeObjectRequest_SourceObject) Reset() { *x = ComposeObjectRequest_SourceObject{} - mi := &file_google_storage_v2_storage_proto_msgTypes[54] + mi := &file_google_storage_v2_storage_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5909,7 +6179,7 @@ func (x *ComposeObjectRequest_SourceObject) String() string { func (*ComposeObjectRequest_SourceObject) ProtoMessage() {} func (x *ComposeObjectRequest_SourceObject) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[54] + mi := &file_google_storage_v2_storage_proto_msgTypes[56] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5960,7 +6230,7 @@ type ComposeObjectRequest_SourceObject_ObjectPreconditions struct { func (x *ComposeObjectRequest_SourceObject_ObjectPreconditions) Reset() { *x = ComposeObjectRequest_SourceObject_ObjectPreconditions{} - mi := &file_google_storage_v2_storage_proto_msgTypes[55] + mi := &file_google_storage_v2_storage_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -5972,7 +6242,7 @@ func (x *ComposeObjectRequest_SourceObject_ObjectPreconditions) String() string func (*ComposeObjectRequest_SourceObject_ObjectPreconditions) ProtoMessage() {} func (x *ComposeObjectRequest_SourceObject_ObjectPreconditions) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[55] + mi := &file_google_storage_v2_storage_proto_msgTypes[57] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6001,13 +6271,13 @@ type Bucket_Billing struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // When set to true, Requester Pays is enabled for this bucket. + // Optional. When set to true, Requester Pays is enabled for this bucket. RequesterPays bool `protobuf:"varint,1,opt,name=requester_pays,json=requesterPays,proto3" json:"requester_pays,omitempty"` } func (x *Bucket_Billing) Reset() { *x = Bucket_Billing{} - mi := &file_google_storage_v2_storage_proto_msgTypes[56] + mi := &file_google_storage_v2_storage_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6019,7 +6289,7 @@ func (x *Bucket_Billing) String() string { func (*Bucket_Billing) ProtoMessage() {} func (x *Bucket_Billing) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[56] + mi := &file_google_storage_v2_storage_proto_msgTypes[58] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6051,19 +6321,20 @@ type Bucket_Cors struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The list of Origins eligible to receive CORS response headers. See - // [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins. + // Optional. The list of Origins eligible to receive CORS response headers. + // See [https://tools.ietf.org/html/rfc6454][RFC 6454] for more on origins. // Note: "*" is permitted in the list of origins, and means "any Origin". Origin []string `protobuf:"bytes,1,rep,name=origin,proto3" json:"origin,omitempty"` - // The list of HTTP methods on which to include CORS response headers, + // Optional. The list of HTTP methods on which to include CORS response + // headers, // (`GET`, `OPTIONS`, `POST`, etc) Note: "*" is permitted in the list of // methods, and means "any method". Method []string `protobuf:"bytes,2,rep,name=method,proto3" json:"method,omitempty"` - // The list of HTTP headers other than the + // Optional. The list of HTTP headers other than the // [https://www.w3.org/TR/cors/#simple-response-header][simple response // headers] to give permission for the user-agent to share across domains. ResponseHeader []string `protobuf:"bytes,3,rep,name=response_header,json=responseHeader,proto3" json:"response_header,omitempty"` - // The value, in seconds, to return in the + // Optional. The value, in seconds, to return in the // [https://www.w3.org/TR/cors/#access-control-max-age-response-header][Access-Control-Max-Age // header] used in preflight responses. MaxAgeSeconds int32 `protobuf:"varint,4,opt,name=max_age_seconds,json=maxAgeSeconds,proto3" json:"max_age_seconds,omitempty"` @@ -6071,7 +6342,7 @@ type Bucket_Cors struct { func (x *Bucket_Cors) Reset() { *x = Bucket_Cors{} - mi := &file_google_storage_v2_storage_proto_msgTypes[57] + mi := &file_google_storage_v2_storage_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6083,7 +6354,7 @@ func (x *Bucket_Cors) String() string { func (*Bucket_Cors) ProtoMessage() {} func (x *Bucket_Cors) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[57] + mi := &file_google_storage_v2_storage_proto_msgTypes[59] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6133,14 +6404,29 @@ type Bucket_Encryption struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The name of the Cloud KMS key that will be used to encrypt objects - // inserted into this bucket, if no encryption method is specified. + // Optional. The name of the Cloud KMS key that will be used to encrypt + // objects inserted into this bucket, if no encryption method is specified. DefaultKmsKey string `protobuf:"bytes,1,opt,name=default_kms_key,json=defaultKmsKey,proto3" json:"default_kms_key,omitempty"` + // Optional. If omitted, then new objects with GMEK encryption-type is + // allowed. If set, then new objects created in this bucket must comply with + // enforcement config. Changing this has no effect on existing objects; it + // applies to new objects only. + GoogleManagedEncryptionEnforcementConfig *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig `protobuf:"bytes,2,opt,name=google_managed_encryption_enforcement_config,json=googleManagedEncryptionEnforcementConfig,proto3,oneof" json:"google_managed_encryption_enforcement_config,omitempty"` + // Optional. If omitted, then new objects with CMEK encryption-type is + // allowed. If set, then new objects created in this bucket must comply with + // enforcement config. Changing this has no effect on existing objects; it + // applies to new objects only. + CustomerManagedEncryptionEnforcementConfig *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig `protobuf:"bytes,3,opt,name=customer_managed_encryption_enforcement_config,json=customerManagedEncryptionEnforcementConfig,proto3,oneof" json:"customer_managed_encryption_enforcement_config,omitempty"` + // Optional. If omitted, then new objects with CSEK encryption-type is + // allowed. If set, then new objects created in this bucket must comply with + // enforcement config. Changing this has no effect on existing objects; it + // applies to new objects only. + CustomerSuppliedEncryptionEnforcementConfig *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig `protobuf:"bytes,4,opt,name=customer_supplied_encryption_enforcement_config,json=customerSuppliedEncryptionEnforcementConfig,proto3,oneof" json:"customer_supplied_encryption_enforcement_config,omitempty"` } func (x *Bucket_Encryption) Reset() { *x = Bucket_Encryption{} - mi := &file_google_storage_v2_storage_proto_msgTypes[58] + mi := &file_google_storage_v2_storage_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6152,7 +6438,7 @@ func (x *Bucket_Encryption) String() string { func (*Bucket_Encryption) ProtoMessage() {} func (x *Bucket_Encryption) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[58] + mi := &file_google_storage_v2_storage_proto_msgTypes[60] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6175,22 +6461,43 @@ func (x *Bucket_Encryption) GetDefaultKmsKey() string { return "" } -// Bucket restriction options. -type Bucket_IamConfig struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Bucket restriction options currently enforced on the bucket. - UniformBucketLevelAccess *Bucket_IamConfig_UniformBucketLevelAccess `protobuf:"bytes,1,opt,name=uniform_bucket_level_access,json=uniformBucketLevelAccess,proto3" json:"uniform_bucket_level_access,omitempty"` - // Whether IAM will enforce public access prevention. Valid values are - // "enforced" or "inherited". - PublicAccessPrevention string `protobuf:"bytes,3,opt,name=public_access_prevention,json=publicAccessPrevention,proto3" json:"public_access_prevention,omitempty"` +func (x *Bucket_Encryption) GetGoogleManagedEncryptionEnforcementConfig() *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig { + if x != nil { + return x.GoogleManagedEncryptionEnforcementConfig + } + return nil } -func (x *Bucket_IamConfig) Reset() { +func (x *Bucket_Encryption) GetCustomerManagedEncryptionEnforcementConfig() *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig { + if x != nil { + return x.CustomerManagedEncryptionEnforcementConfig + } + return nil +} + +func (x *Bucket_Encryption) GetCustomerSuppliedEncryptionEnforcementConfig() *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig { + if x != nil { + return x.CustomerSuppliedEncryptionEnforcementConfig + } + return nil +} + +// Bucket restriction options. +type Bucket_IamConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Bucket restriction options currently enforced on the bucket. + UniformBucketLevelAccess *Bucket_IamConfig_UniformBucketLevelAccess `protobuf:"bytes,1,opt,name=uniform_bucket_level_access,json=uniformBucketLevelAccess,proto3" json:"uniform_bucket_level_access,omitempty"` + // Optional. Whether IAM will enforce public access prevention. Valid values + // are "enforced" or "inherited". + PublicAccessPrevention string `protobuf:"bytes,3,opt,name=public_access_prevention,json=publicAccessPrevention,proto3" json:"public_access_prevention,omitempty"` +} + +func (x *Bucket_IamConfig) Reset() { *x = Bucket_IamConfig{} - mi := &file_google_storage_v2_storage_proto_msgTypes[59] + mi := &file_google_storage_v2_storage_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6202,7 +6509,7 @@ func (x *Bucket_IamConfig) String() string { func (*Bucket_IamConfig) ProtoMessage() {} func (x *Bucket_IamConfig) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[59] + mi := &file_google_storage_v2_storage_proto_msgTypes[61] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6239,14 +6546,14 @@ type Bucket_Lifecycle struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // A lifecycle management rule, which is made of an action to take and the - // condition(s) under which the action will be taken. + // Optional. A lifecycle management rule, which is made of an action to take + // and the condition(s) under which the action will be taken. Rule []*Bucket_Lifecycle_Rule `protobuf:"bytes,1,rep,name=rule,proto3" json:"rule,omitempty"` } func (x *Bucket_Lifecycle) Reset() { *x = Bucket_Lifecycle{} - mi := &file_google_storage_v2_storage_proto_msgTypes[60] + mi := &file_google_storage_v2_storage_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6258,7 +6565,7 @@ func (x *Bucket_Lifecycle) String() string { func (*Bucket_Lifecycle) ProtoMessage() {} func (x *Bucket_Lifecycle) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[60] + mi := &file_google_storage_v2_storage_proto_msgTypes[62] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6287,16 +6594,16 @@ type Bucket_Logging struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The destination bucket where the current bucket's logs should be placed, - // using path format (like `projects/123456/buckets/foo`). + // Optional. The destination bucket where the current bucket's logs should + // be placed, using path format (like `projects/123456/buckets/foo`). LogBucket string `protobuf:"bytes,1,opt,name=log_bucket,json=logBucket,proto3" json:"log_bucket,omitempty"` - // A prefix for log object names. + // Optional. A prefix for log object names. LogObjectPrefix string `protobuf:"bytes,2,opt,name=log_object_prefix,json=logObjectPrefix,proto3" json:"log_object_prefix,omitempty"` } func (x *Bucket_Logging) Reset() { *x = Bucket_Logging{} - mi := &file_google_storage_v2_storage_proto_msgTypes[61] + mi := &file_google_storage_v2_storage_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6308,7 +6615,7 @@ func (x *Bucket_Logging) String() string { func (*Bucket_Logging) ProtoMessage() {} func (x *Bucket_Logging) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[61] + mi := &file_google_storage_v2_storage_proto_msgTypes[63] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6338,28 +6645,76 @@ func (x *Bucket_Logging) GetLogObjectPrefix() string { return "" } +// Object Retention related properties of a bucket. +type Bucket_ObjectRetention struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Output only. If true, object retention is enabled for the + // bucket. + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` +} + +func (x *Bucket_ObjectRetention) Reset() { + *x = Bucket_ObjectRetention{} + mi := &file_google_storage_v2_storage_proto_msgTypes[64] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_ObjectRetention) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_ObjectRetention) ProtoMessage() {} + +func (x *Bucket_ObjectRetention) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[64] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_ObjectRetention.ProtoReflect.Descriptor instead. +func (*Bucket_ObjectRetention) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 6} +} + +func (x *Bucket_ObjectRetention) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + // Retention policy properties of a bucket. type Bucket_RetentionPolicy struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Server-determined value that indicates the time from which policy was - // enforced and effective. + // Optional. Server-determined value that indicates the time from which + // policy was enforced and effective. EffectiveTime *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=effective_time,json=effectiveTime,proto3" json:"effective_time,omitempty"` - // Once locked, an object retention policy cannot be modified. + // Optional. Once locked, an object retention policy cannot be modified. IsLocked bool `protobuf:"varint,2,opt,name=is_locked,json=isLocked,proto3" json:"is_locked,omitempty"` - // The duration that objects need to be retained. Retention duration must be - // greater than zero and less than 100 years. Note that enforcement of - // retention periods less than a day is not guaranteed. Such periods should - // only be used for testing purposes. Any `nanos` value specified will be - // rounded down to the nearest second. + // Optional. The duration that objects need to be retained. Retention + // duration must be greater than zero and less than 100 years. Note that + // enforcement of retention periods less than a day is not guaranteed. Such + // periods should only be used for testing purposes. Any `nanos` value + // specified will be rounded down to the nearest second. RetentionDuration *durationpb.Duration `protobuf:"bytes,4,opt,name=retention_duration,json=retentionDuration,proto3" json:"retention_duration,omitempty"` } func (x *Bucket_RetentionPolicy) Reset() { *x = Bucket_RetentionPolicy{} - mi := &file_google_storage_v2_storage_proto_msgTypes[62] + mi := &file_google_storage_v2_storage_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6371,7 +6726,7 @@ func (x *Bucket_RetentionPolicy) String() string { func (*Bucket_RetentionPolicy) ProtoMessage() {} func (x *Bucket_RetentionPolicy) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[62] + mi := &file_google_storage_v2_storage_proto_msgTypes[65] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6384,7 +6739,7 @@ func (x *Bucket_RetentionPolicy) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_RetentionPolicy.ProtoReflect.Descriptor instead. func (*Bucket_RetentionPolicy) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 6} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 7} } func (x *Bucket_RetentionPolicy) GetEffectiveTime() *timestamppb.Timestamp { @@ -6424,7 +6779,7 @@ type Bucket_SoftDeletePolicy struct { func (x *Bucket_SoftDeletePolicy) Reset() { *x = Bucket_SoftDeletePolicy{} - mi := &file_google_storage_v2_storage_proto_msgTypes[63] + mi := &file_google_storage_v2_storage_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6436,7 +6791,7 @@ func (x *Bucket_SoftDeletePolicy) String() string { func (*Bucket_SoftDeletePolicy) ProtoMessage() {} func (x *Bucket_SoftDeletePolicy) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[63] + mi := &file_google_storage_v2_storage_proto_msgTypes[66] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6449,7 +6804,7 @@ func (x *Bucket_SoftDeletePolicy) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_SoftDeletePolicy.ProtoReflect.Descriptor instead. func (*Bucket_SoftDeletePolicy) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 7} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 8} } func (x *Bucket_SoftDeletePolicy) GetRetentionDuration() *durationpb.Duration { @@ -6474,13 +6829,13 @@ type Bucket_Versioning struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // While set to true, versioning is fully enabled for this bucket. + // Optional. While set to true, versioning is fully enabled for this bucket. Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` } func (x *Bucket_Versioning) Reset() { *x = Bucket_Versioning{} - mi := &file_google_storage_v2_storage_proto_msgTypes[64] + mi := &file_google_storage_v2_storage_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6492,7 +6847,7 @@ func (x *Bucket_Versioning) String() string { func (*Bucket_Versioning) ProtoMessage() {} func (x *Bucket_Versioning) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[64] + mi := &file_google_storage_v2_storage_proto_msgTypes[67] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6505,7 +6860,7 @@ func (x *Bucket_Versioning) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_Versioning.ProtoReflect.Descriptor instead. func (*Bucket_Versioning) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 8} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 9} } func (x *Bucket_Versioning) GetEnabled() bool { @@ -6523,12 +6878,12 @@ type Bucket_Website struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // If the requested object path is missing, the service will ensure the path - // has a trailing '/', append this suffix, and attempt to retrieve the - // resulting object. This allows the creation of `index.html` + // Optional. If the requested object path is missing, the service will + // ensure the path has a trailing '/', append this suffix, and attempt to + // retrieve the resulting object. This allows the creation of `index.html` // objects to represent directory pages. MainPageSuffix string `protobuf:"bytes,1,opt,name=main_page_suffix,json=mainPageSuffix,proto3" json:"main_page_suffix,omitempty"` - // If the requested object path is missing, and any + // Optional. If the requested object path is missing, and any // `mainPageSuffix` object is missing, if applicable, the service // will return the named object from this bucket as the content for a // [https://tools.ietf.org/html/rfc7231#section-6.5.4][404 Not Found] @@ -6538,7 +6893,7 @@ type Bucket_Website struct { func (x *Bucket_Website) Reset() { *x = Bucket_Website{} - mi := &file_google_storage_v2_storage_proto_msgTypes[65] + mi := &file_google_storage_v2_storage_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6550,7 +6905,7 @@ func (x *Bucket_Website) String() string { func (*Bucket_Website) ProtoMessage() {} func (x *Bucket_Website) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[65] + mi := &file_google_storage_v2_storage_proto_msgTypes[68] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6563,7 +6918,7 @@ func (x *Bucket_Website) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_Website.ProtoReflect.Descriptor instead. func (*Bucket_Website) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 9} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 10} } func (x *Bucket_Website) GetMainPageSuffix() string { @@ -6582,19 +6937,19 @@ func (x *Bucket_Website) GetNotFoundPage() string { // Configuration for Custom Dual Regions. It should specify precisely two // eligible regions within the same Multiregion. More information on regions -// may be found [https://cloud.google.com/storage/docs/locations][here]. +// may be found [here](https://cloud.google.com/storage/docs/locations). type Bucket_CustomPlacementConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // List of locations to use for data placement. + // Optional. List of locations to use for data placement. DataLocations []string `protobuf:"bytes,1,rep,name=data_locations,json=dataLocations,proto3" json:"data_locations,omitempty"` } func (x *Bucket_CustomPlacementConfig) Reset() { *x = Bucket_CustomPlacementConfig{} - mi := &file_google_storage_v2_storage_proto_msgTypes[66] + mi := &file_google_storage_v2_storage_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6606,7 +6961,7 @@ func (x *Bucket_CustomPlacementConfig) String() string { func (*Bucket_CustomPlacementConfig) ProtoMessage() {} func (x *Bucket_CustomPlacementConfig) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[66] + mi := &file_google_storage_v2_storage_proto_msgTypes[69] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6619,7 +6974,7 @@ func (x *Bucket_CustomPlacementConfig) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_CustomPlacementConfig.ProtoReflect.Descriptor instead. func (*Bucket_CustomPlacementConfig) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 10} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 11} } func (x *Bucket_CustomPlacementConfig) GetDataLocations() []string { @@ -6635,7 +6990,7 @@ type Bucket_Autoclass struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Enables Autoclass. + // Optional. Enables Autoclass. Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // Output only. Latest instant at which the `enabled` field was set to true // after being disabled/unconfigured or set to false after being enabled. If @@ -6653,7 +7008,7 @@ type Bucket_Autoclass struct { func (x *Bucket_Autoclass) Reset() { *x = Bucket_Autoclass{} - mi := &file_google_storage_v2_storage_proto_msgTypes[67] + mi := &file_google_storage_v2_storage_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6665,7 +7020,7 @@ func (x *Bucket_Autoclass) String() string { func (*Bucket_Autoclass) ProtoMessage() {} func (x *Bucket_Autoclass) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[67] + mi := &file_google_storage_v2_storage_proto_msgTypes[70] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6678,7 +7033,7 @@ func (x *Bucket_Autoclass) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_Autoclass.ProtoReflect.Descriptor instead. func (*Bucket_Autoclass) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 11} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 12} } func (x *Bucket_Autoclass) GetEnabled() bool { @@ -6709,6 +7064,102 @@ func (x *Bucket_Autoclass) GetTerminalStorageClassUpdateTime() *timestamppb.Time return nil } +// The [bucket IP +// filtering](https://cloud.google.com/storage/docs/ip-filtering-overview) +// configuration. Specifies the network sources that can access the bucket, as +// well as its underlying objects. +type Bucket_IpFilter struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The state of the IP filter configuration. Valid values are `Enabled` and + // `Disabled`. When set to `Enabled`, IP filtering rules are applied to a + // bucket and all incoming requests to the bucket are evaluated against + // these rules. When set to `Disabled`, IP filtering rules are not applied + // to a bucket.". + Mode *string `protobuf:"bytes,1,opt,name=mode,proto3,oneof" json:"mode,omitempty"` + // Public IPs allowed to operate or access the bucket. + PublicNetworkSource *Bucket_IpFilter_PublicNetworkSource `protobuf:"bytes,2,opt,name=public_network_source,json=publicNetworkSource,proto3,oneof" json:"public_network_source,omitempty"` + // Optional. The list of network sources that are allowed to access + // operations on the bucket or the underlying objects. + VpcNetworkSources []*Bucket_IpFilter_VpcNetworkSource `protobuf:"bytes,3,rep,name=vpc_network_sources,json=vpcNetworkSources,proto3" json:"vpc_network_sources,omitempty"` + // Optional. Whether or not to allow VPCs from orgs different than the + // bucket's parent org to access the bucket. When set to true, validations + // on the existence of the VPCs won't be performed. If set to false, each + // VPC network source will be checked to belong to the same org as the + // bucket as well as validated for existence. + AllowCrossOrgVpcs bool `protobuf:"varint,4,opt,name=allow_cross_org_vpcs,json=allowCrossOrgVpcs,proto3" json:"allow_cross_org_vpcs,omitempty"` + // Whether or not to allow all P4SA access to the bucket. When set to true, + // IP filter config validation will not apply. + AllowAllServiceAgentAccess *bool `protobuf:"varint,5,opt,name=allow_all_service_agent_access,json=allowAllServiceAgentAccess,proto3,oneof" json:"allow_all_service_agent_access,omitempty"` +} + +func (x *Bucket_IpFilter) Reset() { + *x = Bucket_IpFilter{} + mi := &file_google_storage_v2_storage_proto_msgTypes[71] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_IpFilter) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_IpFilter) ProtoMessage() {} + +func (x *Bucket_IpFilter) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[71] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_IpFilter.ProtoReflect.Descriptor instead. +func (*Bucket_IpFilter) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 13} +} + +func (x *Bucket_IpFilter) GetMode() string { + if x != nil && x.Mode != nil { + return *x.Mode + } + return "" +} + +func (x *Bucket_IpFilter) GetPublicNetworkSource() *Bucket_IpFilter_PublicNetworkSource { + if x != nil { + return x.PublicNetworkSource + } + return nil +} + +func (x *Bucket_IpFilter) GetVpcNetworkSources() []*Bucket_IpFilter_VpcNetworkSource { + if x != nil { + return x.VpcNetworkSources + } + return nil +} + +func (x *Bucket_IpFilter) GetAllowCrossOrgVpcs() bool { + if x != nil { + return x.AllowCrossOrgVpcs + } + return false +} + +func (x *Bucket_IpFilter) GetAllowAllServiceAgentAccess() bool { + if x != nil && x.AllowAllServiceAgentAccess != nil { + return *x.AllowAllServiceAgentAccess + } + return false +} + // Configuration for a bucket's hierarchical namespace feature. type Bucket_HierarchicalNamespace struct { state protoimpl.MessageState @@ -6721,7 +7172,7 @@ type Bucket_HierarchicalNamespace struct { func (x *Bucket_HierarchicalNamespace) Reset() { *x = Bucket_HierarchicalNamespace{} - mi := &file_google_storage_v2_storage_proto_msgTypes[68] + mi := &file_google_storage_v2_storage_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6733,7 +7184,7 @@ func (x *Bucket_HierarchicalNamespace) String() string { func (*Bucket_HierarchicalNamespace) ProtoMessage() {} func (x *Bucket_HierarchicalNamespace) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[68] + mi := &file_google_storage_v2_storage_proto_msgTypes[72] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6746,7 +7197,7 @@ func (x *Bucket_HierarchicalNamespace) ProtoReflect() protoreflect.Message { // Deprecated: Use Bucket_HierarchicalNamespace.ProtoReflect.Descriptor instead. func (*Bucket_HierarchicalNamespace) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 12} + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 14} } func (x *Bucket_HierarchicalNamespace) GetEnabled() bool { @@ -6756,37 +7207,38 @@ func (x *Bucket_HierarchicalNamespace) GetEnabled() bool { return false } -// Settings for Uniform Bucket level access. -// See https://cloud.google.com/storage/docs/uniform-bucket-level-access. -type Bucket_IamConfig_UniformBucketLevelAccess struct { +// Google Managed Encryption (GMEK) enforcement config of a bucket. +type Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // If set, access checks only use bucket-level IAM policies or above. - Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` - // The deadline time for changing - // `iam_config.uniform_bucket_level_access.enabled` from `true` to - // `false`. Mutable until the specified deadline is reached, but not - // afterward. - LockTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lock_time,json=lockTime,proto3" json:"lock_time,omitempty"` + // Restriction mode for google-managed encryption for new objects within + // the bucket. Valid values are: "NotRestricted", "FullyRestricted". + // If `NotRestricted` or unset, creation of new objects with + // google-managed encryption is allowed. + // If `FullyRestricted`, new objects can't be created using google-managed + // encryption. + RestrictionMode *string `protobuf:"bytes,3,opt,name=restriction_mode,json=restrictionMode,proto3,oneof" json:"restriction_mode,omitempty"` + // Time from which the config was effective. This is service-provided. + EffectiveTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=effective_time,json=effectiveTime,proto3,oneof" json:"effective_time,omitempty"` } -func (x *Bucket_IamConfig_UniformBucketLevelAccess) Reset() { - *x = Bucket_IamConfig_UniformBucketLevelAccess{} - mi := &file_google_storage_v2_storage_proto_msgTypes[70] +func (x *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) Reset() { + *x = Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig{} + mi := &file_google_storage_v2_storage_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Bucket_IamConfig_UniformBucketLevelAccess) String() string { +func (x *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Bucket_IamConfig_UniformBucketLevelAccess) ProtoMessage() {} +func (*Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) ProtoMessage() {} -func (x *Bucket_IamConfig_UniformBucketLevelAccess) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[70] +func (x *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[74] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6797,53 +7249,57 @@ func (x *Bucket_IamConfig_UniformBucketLevelAccess) ProtoReflect() protoreflect. return mi.MessageOf(x) } -// Deprecated: Use Bucket_IamConfig_UniformBucketLevelAccess.ProtoReflect.Descriptor instead. -func (*Bucket_IamConfig_UniformBucketLevelAccess) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 3, 0} +// Deprecated: Use Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig.ProtoReflect.Descriptor instead. +func (*Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 2, 0} } -func (x *Bucket_IamConfig_UniformBucketLevelAccess) GetEnabled() bool { - if x != nil { - return x.Enabled +func (x *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) GetRestrictionMode() string { + if x != nil && x.RestrictionMode != nil { + return *x.RestrictionMode } - return false + return "" } -func (x *Bucket_IamConfig_UniformBucketLevelAccess) GetLockTime() *timestamppb.Timestamp { +func (x *Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig) GetEffectiveTime() *timestamppb.Timestamp { if x != nil { - return x.LockTime + return x.EffectiveTime } return nil } -// A lifecycle Rule, combining an action to take on an object and a -// condition which will trigger that action. -type Bucket_Lifecycle_Rule struct { +// Customer Managed Encryption (CMEK) enforcement config of a bucket. +type Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // The action to take. - Action *Bucket_Lifecycle_Rule_Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` - // The condition(s) under which the action will be taken. - Condition *Bucket_Lifecycle_Rule_Condition `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"` + // Restriction mode for customer-managed encryption for new objects within + // the bucket. Valid values are: "NotRestricted", "FullyRestricted". + // If `NotRestricted` or unset, creation of new objects with + // customer-managed encryption is allowed. + // If `FullyRestricted`, new objects can't be created using + // customer-managed encryption. + RestrictionMode *string `protobuf:"bytes,3,opt,name=restriction_mode,json=restrictionMode,proto3,oneof" json:"restriction_mode,omitempty"` + // Time from which the config was effective. This is service-provided. + EffectiveTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=effective_time,json=effectiveTime,proto3,oneof" json:"effective_time,omitempty"` } -func (x *Bucket_Lifecycle_Rule) Reset() { - *x = Bucket_Lifecycle_Rule{} - mi := &file_google_storage_v2_storage_proto_msgTypes[71] +func (x *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) Reset() { + *x = Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig{} + mi := &file_google_storage_v2_storage_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Bucket_Lifecycle_Rule) String() string { +func (x *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Bucket_Lifecycle_Rule) ProtoMessage() {} +func (*Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) ProtoMessage() {} -func (x *Bucket_Lifecycle_Rule) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[71] +func (x *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[75] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6854,54 +7310,58 @@ func (x *Bucket_Lifecycle_Rule) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Bucket_Lifecycle_Rule.ProtoReflect.Descriptor instead. -func (*Bucket_Lifecycle_Rule) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 4, 0} +// Deprecated: Use Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig.ProtoReflect.Descriptor instead. +func (*Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 2, 1} } -func (x *Bucket_Lifecycle_Rule) GetAction() *Bucket_Lifecycle_Rule_Action { - if x != nil { - return x.Action +func (x *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) GetRestrictionMode() string { + if x != nil && x.RestrictionMode != nil { + return *x.RestrictionMode } - return nil + return "" } -func (x *Bucket_Lifecycle_Rule) GetCondition() *Bucket_Lifecycle_Rule_Condition { +func (x *Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig) GetEffectiveTime() *timestamppb.Timestamp { if x != nil { - return x.Condition + return x.EffectiveTime } return nil } -// An action to take on an object. -type Bucket_Lifecycle_Rule_Action struct { +// Customer Supplied Encryption (CSEK) enforcement config of a bucket. +type Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Type of the action. Currently, only `Delete`, `SetStorageClass`, and - // `AbortIncompleteMultipartUpload` are supported. - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Target storage class. Required iff the type of the action is - // SetStorageClass. - StorageClass string `protobuf:"bytes,2,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` + // Restriction mode for customer-supplied encryption for new objects + // within the bucket. Valid values are: "NotRestricted", + // "FullyRestricted". + // If `NotRestricted` or unset, creation of new objects with + // customer-supplied encryption is allowed. + // If `FullyRestricted`, new objects can't be created using + // customer-supplied encryption. + RestrictionMode *string `protobuf:"bytes,3,opt,name=restriction_mode,json=restrictionMode,proto3,oneof" json:"restriction_mode,omitempty"` + // Time from which the config was effective. This is service-provided. + EffectiveTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=effective_time,json=effectiveTime,proto3,oneof" json:"effective_time,omitempty"` } -func (x *Bucket_Lifecycle_Rule_Action) Reset() { - *x = Bucket_Lifecycle_Rule_Action{} - mi := &file_google_storage_v2_storage_proto_msgTypes[72] +func (x *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) Reset() { + *x = Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig{} + mi := &file_google_storage_v2_storage_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Bucket_Lifecycle_Rule_Action) String() string { +func (x *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Bucket_Lifecycle_Rule_Action) ProtoMessage() {} +func (*Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) ProtoMessage() {} -func (x *Bucket_Lifecycle_Rule_Action) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[72] +func (x *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[76] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -6912,58 +7372,235 @@ func (x *Bucket_Lifecycle_Rule_Action) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Bucket_Lifecycle_Rule_Action.ProtoReflect.Descriptor instead. -func (*Bucket_Lifecycle_Rule_Action) Descriptor() ([]byte, []int) { - return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 4, 0, 0} +// Deprecated: Use Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig.ProtoReflect.Descriptor instead. +func (*Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 2, 2} } -func (x *Bucket_Lifecycle_Rule_Action) GetType() string { - if x != nil { - return x.Type +func (x *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) GetRestrictionMode() string { + if x != nil && x.RestrictionMode != nil { + return *x.RestrictionMode } return "" } -func (x *Bucket_Lifecycle_Rule_Action) GetStorageClass() string { +func (x *Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig) GetEffectiveTime() *timestamppb.Timestamp { if x != nil { - return x.StorageClass + return x.EffectiveTime } - return "" + return nil } -// A condition of an object which triggers some action. -type Bucket_Lifecycle_Rule_Condition struct { +// Settings for Uniform Bucket level access. +// See https://cloud.google.com/storage/docs/uniform-bucket-level-access. +type Bucket_IamConfig_UniformBucketLevelAccess struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Age of an object (in days). This condition is satisfied when an - // object reaches the specified age. - // A value of 0 indicates that all objects immediately match this - // condition. - AgeDays *int32 `protobuf:"varint,1,opt,name=age_days,json=ageDays,proto3,oneof" json:"age_days,omitempty"` - // This condition is satisfied when an object is created before midnight - // of the specified date in UTC. - CreatedBefore *date.Date `protobuf:"bytes,2,opt,name=created_before,json=createdBefore,proto3" json:"created_before,omitempty"` - // Relevant only for versioned objects. If the value is - // `true`, this condition matches live objects; if the value - // is `false`, it matches archived objects. - IsLive *bool `protobuf:"varint,3,opt,name=is_live,json=isLive,proto3,oneof" json:"is_live,omitempty"` - // Relevant only for versioned objects. If the value is N, this - // condition is satisfied when there are at least N versions (including - // the live version) newer than this version of the object. - NumNewerVersions *int32 `protobuf:"varint,4,opt,name=num_newer_versions,json=numNewerVersions,proto3,oneof" json:"num_newer_versions,omitempty"` - // Objects having any of the storage classes specified by this condition - // will be matched. Values include `MULTI_REGIONAL`, `REGIONAL`, - // `NEARLINE`, `COLDLINE`, `STANDARD`, and - // `DURABLE_REDUCED_AVAILABILITY`. - MatchesStorageClass []string `protobuf:"bytes,5,rep,name=matches_storage_class,json=matchesStorageClass,proto3" json:"matches_storage_class,omitempty"` - // Number of days that have elapsed since the custom timestamp set on an - // object. - // The value of the field must be a nonnegative integer. + // Optional. If set, access checks only use bucket-level IAM policies or + // above. + Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` + // Optional. The deadline time for changing + // `iam_config.uniform_bucket_level_access.enabled` from `true` to + // `false`. Mutable until the specified deadline is reached, but not + // afterward. + LockTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=lock_time,json=lockTime,proto3" json:"lock_time,omitempty"` +} + +func (x *Bucket_IamConfig_UniformBucketLevelAccess) Reset() { + *x = Bucket_IamConfig_UniformBucketLevelAccess{} + mi := &file_google_storage_v2_storage_proto_msgTypes[77] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_IamConfig_UniformBucketLevelAccess) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_IamConfig_UniformBucketLevelAccess) ProtoMessage() {} + +func (x *Bucket_IamConfig_UniformBucketLevelAccess) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[77] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_IamConfig_UniformBucketLevelAccess.ProtoReflect.Descriptor instead. +func (*Bucket_IamConfig_UniformBucketLevelAccess) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 3, 0} +} + +func (x *Bucket_IamConfig_UniformBucketLevelAccess) GetEnabled() bool { + if x != nil { + return x.Enabled + } + return false +} + +func (x *Bucket_IamConfig_UniformBucketLevelAccess) GetLockTime() *timestamppb.Timestamp { + if x != nil { + return x.LockTime + } + return nil +} + +// A lifecycle Rule, combining an action to take on an object and a +// condition which will trigger that action. +type Bucket_Lifecycle_Rule struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. The action to take. + Action *Bucket_Lifecycle_Rule_Action `protobuf:"bytes,1,opt,name=action,proto3" json:"action,omitempty"` + // Optional. The condition(s) under which the action will be taken. + Condition *Bucket_Lifecycle_Rule_Condition `protobuf:"bytes,2,opt,name=condition,proto3" json:"condition,omitempty"` +} + +func (x *Bucket_Lifecycle_Rule) Reset() { + *x = Bucket_Lifecycle_Rule{} + mi := &file_google_storage_v2_storage_proto_msgTypes[78] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_Lifecycle_Rule) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_Lifecycle_Rule) ProtoMessage() {} + +func (x *Bucket_Lifecycle_Rule) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[78] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_Lifecycle_Rule.ProtoReflect.Descriptor instead. +func (*Bucket_Lifecycle_Rule) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 4, 0} +} + +func (x *Bucket_Lifecycle_Rule) GetAction() *Bucket_Lifecycle_Rule_Action { + if x != nil { + return x.Action + } + return nil +} + +func (x *Bucket_Lifecycle_Rule) GetCondition() *Bucket_Lifecycle_Rule_Condition { + if x != nil { + return x.Condition + } + return nil +} + +// An action to take on an object. +type Bucket_Lifecycle_Rule_Action struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. Type of the action. Currently, only `Delete`, + // `SetStorageClass`, and `AbortIncompleteMultipartUpload` are + // supported. + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + // Optional. Target storage class. Required iff the type of the action + // is SetStorageClass. + StorageClass string `protobuf:"bytes,2,opt,name=storage_class,json=storageClass,proto3" json:"storage_class,omitempty"` +} + +func (x *Bucket_Lifecycle_Rule_Action) Reset() { + *x = Bucket_Lifecycle_Rule_Action{} + mi := &file_google_storage_v2_storage_proto_msgTypes[79] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_Lifecycle_Rule_Action) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_Lifecycle_Rule_Action) ProtoMessage() {} + +func (x *Bucket_Lifecycle_Rule_Action) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[79] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_Lifecycle_Rule_Action.ProtoReflect.Descriptor instead. +func (*Bucket_Lifecycle_Rule_Action) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 4, 0, 0} +} + +func (x *Bucket_Lifecycle_Rule_Action) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *Bucket_Lifecycle_Rule_Action) GetStorageClass() string { + if x != nil { + return x.StorageClass + } + return "" +} + +// A condition of an object which triggers some action. +type Bucket_Lifecycle_Rule_Condition struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Age of an object (in days). This condition is satisfied when an + // object reaches the specified age. + // A value of 0 indicates that all objects immediately match this + // condition. + AgeDays *int32 `protobuf:"varint,1,opt,name=age_days,json=ageDays,proto3,oneof" json:"age_days,omitempty"` + // Optional. This condition is satisfied when an object is created + // before midnight of the specified date in UTC. + CreatedBefore *date.Date `protobuf:"bytes,2,opt,name=created_before,json=createdBefore,proto3" json:"created_before,omitempty"` + // Relevant only for versioned objects. If the value is + // `true`, this condition matches live objects; if the value + // is `false`, it matches archived objects. + IsLive *bool `protobuf:"varint,3,opt,name=is_live,json=isLive,proto3,oneof" json:"is_live,omitempty"` + // Relevant only for versioned objects. If the value is N, this + // condition is satisfied when there are at least N versions (including + // the live version) newer than this version of the object. + NumNewerVersions *int32 `protobuf:"varint,4,opt,name=num_newer_versions,json=numNewerVersions,proto3,oneof" json:"num_newer_versions,omitempty"` + // Optional. Objects having any of the storage classes specified by this + // condition will be matched. Values include `MULTI_REGIONAL`, + // `REGIONAL`, `NEARLINE`, `COLDLINE`, `STANDARD`, and + // `DURABLE_REDUCED_AVAILABILITY`. + MatchesStorageClass []string `protobuf:"bytes,5,rep,name=matches_storage_class,json=matchesStorageClass,proto3" json:"matches_storage_class,omitempty"` + // Number of days that have elapsed since the custom timestamp set on an + // object. + // The value of the field must be a nonnegative integer. DaysSinceCustomTime *int32 `protobuf:"varint,7,opt,name=days_since_custom_time,json=daysSinceCustomTime,proto3,oneof" json:"days_since_custom_time,omitempty"` - // An object matches this condition if the custom timestamp set on the - // object is before the specified date in UTC. + // Optional. An object matches this condition if the custom timestamp + // set on the object is before the specified date in UTC. CustomTimeBefore *date.Date `protobuf:"bytes,8,opt,name=custom_time_before,json=customTimeBefore,proto3" json:"custom_time_before,omitempty"` // This condition is relevant only for versioned objects. An object // version satisfies this condition only if these many days have been @@ -6971,21 +7608,21 @@ type Bucket_Lifecycle_Rule_Condition struct { // nonnegative integer. If it's zero, the object version will become // eligible for Lifecycle action as soon as it becomes noncurrent. DaysSinceNoncurrentTime *int32 `protobuf:"varint,9,opt,name=days_since_noncurrent_time,json=daysSinceNoncurrentTime,proto3,oneof" json:"days_since_noncurrent_time,omitempty"` - // This condition is relevant only for versioned objects. An object - // version satisfies this condition only if it became noncurrent before - // the specified date in UTC. + // Optional. This condition is relevant only for versioned objects. An + // object version satisfies this condition only if it became noncurrent + // before the specified date in UTC. NoncurrentTimeBefore *date.Date `protobuf:"bytes,10,opt,name=noncurrent_time_before,json=noncurrentTimeBefore,proto3" json:"noncurrent_time_before,omitempty"` - // List of object name prefixes. If any prefix exactly matches the - // beginning of the object name, the condition evaluates to true. + // Optional. List of object name prefixes. If any prefix exactly matches + // the beginning of the object name, the condition evaluates to true. MatchesPrefix []string `protobuf:"bytes,11,rep,name=matches_prefix,json=matchesPrefix,proto3" json:"matches_prefix,omitempty"` - // List of object name suffixes. If any suffix exactly matches the - // end of the object name, the condition evaluates to true. + // Optional. List of object name suffixes. If any suffix exactly matches + // the end of the object name, the condition evaluates to true. MatchesSuffix []string `protobuf:"bytes,12,rep,name=matches_suffix,json=matchesSuffix,proto3" json:"matches_suffix,omitempty"` } func (x *Bucket_Lifecycle_Rule_Condition) Reset() { *x = Bucket_Lifecycle_Rule_Condition{} - mi := &file_google_storage_v2_storage_proto_msgTypes[73] + mi := &file_google_storage_v2_storage_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6997,7 +7634,7 @@ func (x *Bucket_Lifecycle_Rule_Condition) String() string { func (*Bucket_Lifecycle_Rule_Condition) ProtoMessage() {} func (x *Bucket_Lifecycle_Rule_Condition) ProtoReflect() protoreflect.Message { - mi := &file_google_storage_v2_storage_proto_msgTypes[73] + mi := &file_google_storage_v2_storage_proto_msgTypes[80] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -7090,6 +7727,176 @@ func (x *Bucket_Lifecycle_Rule_Condition) GetMatchesSuffix() []string { return nil } +// The public network IP address ranges that can access the bucket and its +// data. +type Bucket_IpFilter_PublicNetworkSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. The list of IPv4 and IPv6 cidr blocks that are allowed to + // operate or access the bucket and its underlying objects. + AllowedIpCidrRanges []string `protobuf:"bytes,1,rep,name=allowed_ip_cidr_ranges,json=allowedIpCidrRanges,proto3" json:"allowed_ip_cidr_ranges,omitempty"` +} + +func (x *Bucket_IpFilter_PublicNetworkSource) Reset() { + *x = Bucket_IpFilter_PublicNetworkSource{} + mi := &file_google_storage_v2_storage_proto_msgTypes[81] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_IpFilter_PublicNetworkSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_IpFilter_PublicNetworkSource) ProtoMessage() {} + +func (x *Bucket_IpFilter_PublicNetworkSource) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[81] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_IpFilter_PublicNetworkSource.ProtoReflect.Descriptor instead. +func (*Bucket_IpFilter_PublicNetworkSource) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 13, 0} +} + +func (x *Bucket_IpFilter_PublicNetworkSource) GetAllowedIpCidrRanges() []string { + if x != nil { + return x.AllowedIpCidrRanges + } + return nil +} + +// The list of VPC networks that can access the bucket. +type Bucket_IpFilter_VpcNetworkSource struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the network. + // + // Format: `projects/PROJECT_ID/global/networks/NETWORK_NAME` + Network *string `protobuf:"bytes,1,opt,name=network,proto3,oneof" json:"network,omitempty"` + // Optional. The list of public or private IPv4 and IPv6 CIDR ranges that + // can access the bucket. In the CIDR IP address block, the specified IP + // address must be properly truncated, meaning all the host bits must be + // zero or else the input is considered malformed. For example, + // `192.0.2.0/24` is accepted but `192.0.2.1/24` is not. Similarly, for + // IPv6, `2001:db8::/32` is accepted whereas `2001:db8::1/32` is not. + AllowedIpCidrRanges []string `protobuf:"bytes,2,rep,name=allowed_ip_cidr_ranges,json=allowedIpCidrRanges,proto3" json:"allowed_ip_cidr_ranges,omitempty"` +} + +func (x *Bucket_IpFilter_VpcNetworkSource) Reset() { + *x = Bucket_IpFilter_VpcNetworkSource{} + mi := &file_google_storage_v2_storage_proto_msgTypes[82] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Bucket_IpFilter_VpcNetworkSource) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Bucket_IpFilter_VpcNetworkSource) ProtoMessage() {} + +func (x *Bucket_IpFilter_VpcNetworkSource) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[82] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Bucket_IpFilter_VpcNetworkSource.ProtoReflect.Descriptor instead. +func (*Bucket_IpFilter_VpcNetworkSource) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{43, 13, 1} +} + +func (x *Bucket_IpFilter_VpcNetworkSource) GetNetwork() string { + if x != nil && x.Network != nil { + return *x.Network + } + return "" +} + +func (x *Bucket_IpFilter_VpcNetworkSource) GetAllowedIpCidrRanges() []string { + if x != nil { + return x.AllowedIpCidrRanges + } + return nil +} + +// Specifies retention parameters of the object. Objects under retention +// cannot be deleted or overwritten until their retention expires. +type Object_Retention struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Optional. The mode of the Retention. + Mode Object_Retention_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=google.storage.v2.Object_Retention_Mode" json:"mode,omitempty"` + // Optional. The timestamp that the object needs to be retained until. + // Value cannot be set in the past or more than 100 years in the future. + RetainUntilTime *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=retain_until_time,json=retainUntilTime,proto3" json:"retain_until_time,omitempty"` +} + +func (x *Object_Retention) Reset() { + *x = Object_Retention{} + mi := &file_google_storage_v2_storage_proto_msgTypes[84] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Object_Retention) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Object_Retention) ProtoMessage() {} + +func (x *Object_Retention) ProtoReflect() protoreflect.Message { + mi := &file_google_storage_v2_storage_proto_msgTypes[84] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Object_Retention.ProtoReflect.Descriptor instead. +func (*Object_Retention) Descriptor() ([]byte, []int) { + return file_google_storage_v2_storage_proto_rawDescGZIP(), []int{50, 0} +} + +func (x *Object_Retention) GetMode() Object_Retention_Mode { + if x != nil { + return x.Mode + } + return Object_Retention_MODE_UNSPECIFIED +} + +func (x *Object_Retention) GetRetainUntilTime() *timestamppb.Timestamp { + if x != nil { + return x.RetainUntilTime + } + return nil +} + var File_google_storage_v2_storage_proto protoreflect.FileDescriptor var file_google_storage_v2_storage_proto_rawDesc = []byte{ @@ -7156,392 +7963,284 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x93, 0x02, 0x0a, 0x13, 0x43, 0x72, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xdf, 0x02, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x12, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x12, 0x31, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x12, 0x36, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, - 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, - 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x41, 0x0a, 0x1d, - 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, - 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x44, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x22, - 0xf3, 0x01, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x12, 0x1d, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, - 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, - 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, - 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, - 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x72, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, + 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x46, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x44, 0x65, + 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x3b, + 0x0a, 0x17, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x82, 0x02, 0x0a, 0x12, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x12, 0x1d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, + 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, + 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, + 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, + 0x01, 0x01, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, + 0x22, 0x72, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x26, 0x0a, 0x0f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x20, 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, + 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x15, + 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xc0, 0x03, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, + 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, - 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x9e, 0x01, 0x0a, 0x20, 0x4c, 0x6f, - 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, - 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, - 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, - 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, + 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, + 0x63, 0x6c, 0x12, 0x46, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1a, + 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, + 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x1a, 0x0a, 0x18, + 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xe5, 0x07, 0x0a, 0x14, 0x43, 0x6f, 0x6d, + 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x60, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x1a, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, + 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xb6, 0x03, 0x0a, 0x13, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, + 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, + 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, + 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, + 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x72, + 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x1a, 0xb3, 0x02, 0x0a, 0x0c, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x80, 0x01, 0x0a, 0x14, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x70, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x13, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, + 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x62, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, + 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, + 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, + 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x22, 0xec, 0x04, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, + 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, + 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x15, 0x69, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x18, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0e, 0x70, - 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, - 0x63, 0x6c, 0x12, 0x41, 0x0a, 0x1d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, - 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x1a, 0x70, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, + 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x22, 0xc3, 0x07, 0x0a, 0x14, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x40, 0x0a, 0x0b, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, - 0x02, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x5b, - 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, - 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x0d, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x3c, 0x0a, 0x1a, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, - 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x64, - 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, - 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x01, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x07, 0x6b, - 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, - 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, - 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x6d, 0x0a, 0x1c, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x1a, 0xa8, 0x02, 0x0a, 0x0c, 0x53, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x7b, 0x0a, 0x14, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, - 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x48, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, - 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x13, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x1a, 0x62, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, - 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, - 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xe2, 0x04, 0x0a, 0x13, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, - 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, - 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, - 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x16, - 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, - 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xd3, - 0x05, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, - 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, - 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, + 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, + 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, + 0xd8, 0x05, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, + 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, + 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, + 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, 0x52, - 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x6c, 0x88, 0x01, - 0x01, 0x12, 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, + 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x5f, 0x61, 0x63, 0x6c, 0x22, 0x3f, 0x0a, 0x1b, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, - 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x75, 0x70, 0x6c, - 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, - 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xec, 0x05, 0x0a, 0x11, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, - 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, - 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, - 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, - 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x72, 0x65, - 0x61, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, - 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, - 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, - 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, - 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, - 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, - 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x04, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, - 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0f, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x04, + 0x52, 0x0d, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x41, 0x63, 0x6c, 0x88, + 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x8e, 0x06, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0b, 0x73, - 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, - 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x11, 0x69, 0x66, - 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, - 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x03, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x04, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x3c, - 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x05, 0x52, - 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, - 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0c, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, - 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x73, 0x6f, 0x66, 0x74, 0x5f, - 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, - 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, - 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, - 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x02, 0x0a, 0x12, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, - 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xc6, 0x06, 0x0a, 0x12, 0x42, 0x69, 0x64, 0x69, - 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, - 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, - 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, - 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, - 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, - 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, - 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, - 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, - 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x6d, 0x0a, 0x1c, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x02, 0x18, 0x01, 0x48, 0x04, - 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, - 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x48, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, - 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x12, 0x0a, 0x10, 0x5f, 0x63, 0x6f, 0x70, 0x79, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x61, 0x63, 0x6c, 0x22, 0x3f, 0x0a, 0x1b, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, + 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x22, 0x1e, 0x0a, 0x1c, 0x43, + 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x80, 0x06, 0x0a, 0x11, + 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, + 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, + 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, + 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x22, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x33, 0x0a, 0x13, + 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, + 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, + 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, + 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, + 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, + 0x6b, 0x48, 0x04, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, @@ -7549,1371 +8248,1727 @@ var file_google_storage_v2_storage_proto_rawDesc = []byte{ 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x42, 0x0e, - 0x0a, 0x0c, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x10, - 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0xa7, 0x01, 0x0a, 0x15, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, - 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x52, 0x0e, 0x72, 0x65, 0x61, - 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x0b, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0a, - 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x16, 0x42, - 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, - 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, - 0x61, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, - 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, - 0x6c, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, - 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, 0x72, 0x65, - 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, - 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, - 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xed, 0x01, 0x0a, 0x1e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, - 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, - 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, - 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x77, - 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, - 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, - 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, - 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x13, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x4d, 0x0a, 0x11, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x22, 0x55, 0x0a, 0x0e, 0x52, 0x65, - 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, - 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, - 0x65, 0x61, 0x64, 0x49, 0x64, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, - 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x22, 0x75, 0x0a, 0x09, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x24, - 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x66, - 0x66, 0x73, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, - 0x72, 0x65, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x07, 0x72, 0x65, - 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, - 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, 0x22, 0xba, 0x01, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0a, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x72, - 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x6e, 0x67, - 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x61, 0x6e, - 0x67, 0x65, 0x45, 0x6e, 0x64, 0x22, 0x2d, 0x0a, 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, - 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2e, 0x0a, 0x0f, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xc0, 0x04, 0x0a, 0x0f, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, - 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, - 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, - 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, + 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x98, + 0x06, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x0b, 0x73, 0x6f, + 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x13, + 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x11, 0x69, 0x66, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, + 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x03, 0x48, 0x02, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, + 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, + 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x04, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, + 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, + 0x6b, 0x48, 0x05, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, + 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x73, + 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x42, 0x16, 0x0a, 0x14, 0x5f, + 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, + 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, - 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, - 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, - 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x04, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, - 0x64, 0x61, 0x62, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, - 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, - 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x70, 0x70, - 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x22, 0xf8, 0x03, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, - 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, 0x0a, - 0x11, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, - 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x0f, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, - 0x26, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, - 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, - 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x69, 0x73, - 0x68, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x66, - 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x6d, 0x0a, 0x1c, 0x63, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x19, + 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x02, 0x0a, 0x12, 0x52, 0x65, + 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x52, 0x0f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, + 0x4d, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x44, + 0x0a, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, + 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, + 0x61, 0x6e, 0x67, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xd0, 0x06, 0x0a, 0x12, + 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, + 0x65, 0x63, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, + 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, + 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, + 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, - 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x22, 0x87, 0x01, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, - 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xe9, 0x03, 0x0a, - 0x10, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, - 0x63, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, - 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0c, 0x72, 0x6f, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, - 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x48, 0x03, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, + 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x09, 0x72, 0x65, 0x61, + 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x02, 0x18, 0x01, 0x48, 0x04, 0x52, 0x08, + 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x0b, 0x72, + 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x48, 0x05, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x0c, 0x72, + 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x16, + 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, + 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0c, + 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x42, 0x0e, 0x0a, 0x0c, + 0x5f, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x10, 0x0a, 0x0e, + 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xb1, + 0x01, 0x0a, 0x15, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x54, 0x0a, 0x10, 0x72, 0x65, 0x61, 0x64, + 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, + 0x72, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x42, + 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x16, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, + 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, 0x10, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x44, 0x61, 0x74, 0x61, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x12, + 0x35, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x6d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, + 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x9f, 0x01, 0x0a, 0x1d, 0x42, + 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x64, + 0x69, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x42, 0x0a, 0x0b, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, + 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, + 0x6e, 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, + 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xed, 0x01, 0x0a, + 0x1e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x65, 0x64, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, + 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x88, 0x01, 0x01, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, + 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, + 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x42, 0x0d, 0x0a, + 0x0b, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x13, + 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x4d, 0x0a, 0x11, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x0f, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x22, 0x55, 0x0a, 0x0e, 0x52, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x45, + 0x72, 0x72, 0x6f, 0x72, 0x12, 0x17, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, 0x12, 0x2a, 0x0a, + 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x75, 0x0a, 0x09, 0x52, 0x65, 0x61, + 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x0b, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x24, 0x0a, 0x0b, + 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x4c, 0x65, 0x6e, 0x67, + 0x74, 0x68, 0x12, 0x1c, 0x0a, 0x07, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x49, 0x64, + 0x22, 0xba, 0x01, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x44, 0x61, 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x3b, 0x0a, 0x0a, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x09, 0x72, 0x65, 0x61, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x45, 0x6e, 0x64, 0x22, 0x2d, 0x0a, + 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, + 0x1b, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x2e, 0x0a, 0x0f, + 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, + 0x1b, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xc5, 0x04, 0x0a, + 0x0f, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x12, 0x3a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2a, 0x0a, 0x0e, + 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, + 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, + 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, + 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, + 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, + 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x04, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, + 0x12, 0x23, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x08, 0x48, 0x05, 0x52, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, + 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, + 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, - 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, - 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x8a, 0x05, 0x0a, 0x16, 0x42, 0x69, 0x64, - 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x49, 0x64, 0x12, 0x50, 0x0a, 0x11, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, - 0x63, 0x48, 0x00, 0x52, 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x53, 0x70, 0x65, 0x63, 0x12, 0x53, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x10, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, - 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, - 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, - 0x01, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, - 0x74, 0x61, 0x12, 0x4d, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, - 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, + 0x61, 0x62, 0x6c, 0x65, 0x22, 0x87, 0x04, 0x0a, 0x12, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x09, 0x75, + 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, 0x0a, 0x11, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, 0x0f, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x12, 0x4f, 0x0a, 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, + 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, + 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, + 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x69, 0x6e, + 0x69, 0x73, 0x68, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x87, + 0x01, 0x0a, 0x13, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, + 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xe9, 0x03, 0x0a, 0x10, 0x41, 0x70, 0x70, + 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x3d, 0x0a, + 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, + 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x06, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, + 0x41, 0x02, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, + 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, + 0x00, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, + 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, + 0x48, 0x01, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, + 0x28, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0c, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, + 0x67, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, + 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, + 0x64, 0x6c, 0x65, 0x48, 0x03, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, + 0x6e, 0x64, 0x6c, 0x65, 0x22, 0xa3, 0x05, 0x0a, 0x16, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, 0x12, 0x50, + 0x0a, 0x11, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, + 0x70, 0x65, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x48, 0x00, 0x52, + 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x12, 0x53, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, - 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, - 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, - 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x65, 0x4c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x21, 0x0a, 0x0c, 0x66, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x6d, 0x0a, + 0x2e, 0x41, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, + 0x63, 0x48, 0x00, 0x52, 0x10, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x26, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, + 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x02, + 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x4f, 0x0a, + 0x10, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x5f, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x48, 0x01, 0x52, 0x0f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x52, + 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x6f, 0x6f, 0x6b, + 0x75, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, + 0x74, 0x61, 0x74, 0x65, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x12, 0x19, 0x0a, 0x05, 0x66, 0x6c, + 0x75, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, + 0x66, 0x6c, 0x75, 0x73, 0x68, 0x12, 0x26, 0x0a, 0x0c, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x5f, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x0b, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x0f, 0x0a, 0x0d, - 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x06, 0x0a, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe8, 0x01, 0x0a, 0x17, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x65, 0x72, - 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, - 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x48, 0x01, 0x52, - 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x88, 0x01, 0x01, 0x42, - 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x42, - 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x22, 0xe3, 0x04, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, - 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, - 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, - 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, - 0x12, 0x3c, 0x0a, 0x1a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x74, 0x72, 0x61, 0x69, - 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x18, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, - 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x16, - 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, - 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x88, 0x01, 0x01, - 0x12, 0x34, 0x0a, 0x13, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, - 0x63, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x52, 0x12, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, - 0x63, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x11, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, - 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x69, 0x63, 0x45, 0x6e, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x73, 0x6f, 0x66, 0x74, - 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, - 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, 0x6f, 0x6c, 0x64, - 0x65, 0x72, 0x73, 0x5f, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x73, 0x18, - 0x0d, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, 0x6e, 0x63, 0x6c, - 0x75, 0x64, 0x65, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x41, 0x73, 0x50, 0x72, 0x65, 0x66, - 0x69, 0x78, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x5f, 0x67, 0x6c, - 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x47, 0x6c, 0x6f, 0x62, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, - 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaa, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe8, 0x01, 0x0a, 0x17, 0x42, + 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, + 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, + 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, + 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x48, 0x01, 0x52, 0x0b, 0x77, 0x72, 0x69, 0x74, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x68, + 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x9e, 0x05, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, + 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x22, 0x0a, + 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x21, 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, + 0x69, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x1a, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, + 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, + 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x44, 0x65, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x72, 0x65, 0x66, 0x69, + 0x78, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x70, 0x72, + 0x65, 0x66, 0x69, 0x78, 0x12, 0x1f, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x76, 0x65, 0x72, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x61, 0x64, 0x4d, 0x61, 0x73, 0x6b, + 0x88, 0x01, 0x01, 0x12, 0x34, 0x0a, 0x13, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x6c, 0x65, 0x78, 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, + 0x70, 0x68, 0x69, 0x63, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, 0x30, 0x0a, 0x11, 0x6c, 0x65, 0x78, + 0x69, 0x63, 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x5f, 0x65, 0x6e, 0x64, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x6c, 0x65, 0x78, 0x69, 0x63, + 0x6f, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x45, 0x6e, 0x64, 0x12, 0x26, 0x0a, 0x0c, 0x73, + 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x64, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, + 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x69, + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x41, 0x73, 0x50, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0a, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x47, 0x6c, 0x6f, 0x62, 0x12, 0x1b, 0x0a, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x72, 0x65, 0x61, + 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0xaf, 0x01, 0x0a, 0x17, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, - 0x61, 0x64, 0x49, 0x64, 0x12, 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, + 0x61, 0x64, 0x49, 0x64, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, - 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x65, 0x72, 0x73, - 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x22, 0xb5, 0x0e, 0x0a, 0x14, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x10, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x18, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0x52, 0x0f, 0x64, - 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x57, - 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x42, 0x28, 0xe0, 0x41, 0x02, 0xe0, - 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x56, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x1b, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, - 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x11, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, - 0x3b, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x0d, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x3c, 0x0a, 0x1a, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, - 0x63, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, - 0x63, 0x6c, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, - 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, - 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, - 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x0a, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, - 0x68, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, 0x17, 0x69, 0x66, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x48, 0x05, - 0x52, 0x1a, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x8c, 0x01, 0x0a, 0x18, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0e, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, + 0x65, 0x64, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, + 0x0d, 0x70, 0x65, 0x72, 0x73, 0x69, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x37, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x48, 0x00, 0x52, 0x08, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xea, 0x0e, 0x0a, 0x14, 0x52, 0x65, 0x77, 0x72, + 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x31, 0x0a, 0x10, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x18, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, + 0x41, 0x05, 0x52, 0x0f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x57, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x19, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x28, 0xe0, 0x41, 0x02, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x59, 0x0a, 0x13, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, + 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x0d, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x02, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, + 0x30, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x72, + 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x41, 0x0a, 0x1a, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x72, 0x65, 0x64, 0x65, + 0x66, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x33, + 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, + 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, + 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, - 0x48, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, - 0x68, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x48, 0x06, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x22, 0x69, 0x66, 0x5f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x03, 0x48, 0x07, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, - 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3e, 0x0a, 0x1c, 0x6d, 0x61, - 0x78, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, - 0x6e, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x18, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, - 0x74, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x47, 0x0a, 0x20, 0x63, 0x6f, - 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x10, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x1d, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, - 0x74, 0x68, 0x6d, 0x12, 0x46, 0x0a, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, - 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x1c, 0x63, - 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x53, 0x0a, 0x27, 0x63, + 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, + 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, + 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, + 0x12, 0x40, 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, 0x17, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x47, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x48, 0x05, 0x52, 0x1a, 0x69, 0x66, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x48, 0x0a, 0x1e, 0x69, + 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x03, 0x48, 0x06, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4f, 0x0a, 0x22, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x07, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x43, 0x0a, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x5f, 0x70, 0x65, + 0x72, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x18, 0x6d, 0x61, 0x78, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, + 0x74, 0x74, 0x65, 0x6e, 0x50, 0x65, 0x72, 0x43, 0x61, 0x6c, 0x6c, 0x12, 0x4c, 0x0a, 0x20, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, - 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x22, 0x63, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, + 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1d, 0x63, 0x6f, 0x70, 0x79, + 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x4b, 0x0a, 0x20, 0x63, 0x6f, 0x70, + 0x79, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x1c, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, + 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x27, 0x63, 0x6f, 0x70, 0x79, 0x5f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, + 0x73, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x22, 0x63, 0x6f, 0x70, 0x79, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, - 0x12, 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, - 0x4d, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x16, - 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, - 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1d, - 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, - 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, 0x23, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0f, 0x52, - 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, - 0x0a, 0x15, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, - 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, - 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, - 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, - 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x35, 0x0a, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x22, 0xec, 0x07, 0x0a, 0x11, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, - 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x32, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, - 0xe0, 0x41, 0x02, 0x52, 0x11, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x45, 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, - 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, - 0x00, 0x52, 0x17, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, - 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x1a, 0x69, 0x66, - 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x1e, 0x69, + 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, + 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, + 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, + 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x54, 0x0a, 0x22, 0x69, 0x66, - 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x03, 0x52, 0x1e, 0x69, - 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, - 0x12, 0x38, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, - 0x41, 0x01, 0x48, 0x04, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x17, 0x69, 0x66, - 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, - 0x48, 0x05, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x17, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x48, 0x06, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, - 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x07, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, - 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, + 0x23, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x22, 0xd6, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x15, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x5f, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x13, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x79, + 0x74, 0x65, 0x73, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x74, 0x65, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x6f, 0x6e, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x64, 0x6f, 0x6e, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x35, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0xec, 0x07, + 0x0a, 0x11, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x02, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0c, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x32, 0x0a, 0x12, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x11, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x12, 0x45, 0x0a, 0x1a, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x17, 0x69, 0x66, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, - 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, 0x23, 0x5f, - 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, - 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, - 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, - 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, + 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x1a, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x4d, 0x0a, 0x1e, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x48, 0x02, 0x52, 0x1b, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x4d, 0x65, + 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x54, 0x0a, 0x22, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x03, 0x52, 0x1e, 0x69, 0x66, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x13, 0x69, 0x66, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x04, 0x52, 0x11, + 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, + 0x09, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x05, 0x52, 0x14, 0x69, 0x66, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x40, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x06, 0x52, 0x15, 0x69, + 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x47, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, + 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, + 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x48, 0x07, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, + 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, + 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, + 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x22, 0xaf, 0x02, 0x0a, 0x1a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, - 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x53, 0x0a, 0x11, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, - 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x12, 0x6d, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, - 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x4d, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, - 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, - 0x75, 0x6d, 0x73, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x73, 0x75, 0x6d, 0x73, 0x22, 0x3a, 0x0a, 0x1b, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, - 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x49, 0x64, - 0x22, 0x87, 0x05, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, - 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, + 0x63, 0x68, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x25, 0x0a, 0x23, 0x5f, 0x69, 0x66, 0x5f, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x16, 0x0a, 0x14, + 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, - 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x42, - 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, - 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, - 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, - 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x6d, 0x0a, 0x1c, 0x63, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, - 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x16, 0x0a, 0x14, 0x5f, 0x69, - 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, - 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, - 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x69, - 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xbf, 0x01, 0x0a, 0x19, 0x43, + 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, 0x1c, + 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xb9, 0x02, 0x0a, + 0x1a, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x53, 0x0a, 0x11, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x0f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x70, 0x65, 0x63, + 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, + 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x52, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x22, 0x3a, 0x0a, 0x1b, 0x53, 0x74, 0x61, 0x72, + 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, + 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x70, 0x6c, 0x6f, + 0x61, 0x64, 0x49, 0x64, 0x22, 0xd6, 0x05, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x06, + 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x33, 0x0a, 0x13, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x48, 0x00, 0x52, 0x11, 0x69, 0x66, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3a, 0x0a, 0x17, 0x69, 0x66, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, + 0x61, 0x74, 0x63, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01, 0x52, 0x14, 0x69, 0x66, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, 0x74, + 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x17, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02, 0x52, 0x15, 0x69, 0x66, 0x4d, 0x65, 0x74, 0x61, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x88, + 0x01, 0x01, 0x12, 0x42, 0x0a, 0x1b, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x03, 0x52, 0x18, 0x69, 0x66, 0x4d, 0x65, 0x74, + 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x4d, 0x61, + 0x74, 0x63, 0x68, 0x88, 0x01, 0x01, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, + 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x41, + 0x63, 0x6c, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x72, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x6f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x30, 0x0a, 0x14, 0x65, - 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, - 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x3d, 0x0a, - 0x1b, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, - 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x18, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4b, 0x65, - 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xca, 0x05, 0x0a, - 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, - 0x73, 0x22, 0xb5, 0x05, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x12, - 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x14, 0x4d, 0x41, 0x58, 0x5f, 0x52, 0x45, 0x41, 0x44, + 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x19, 0x63, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x43, 0x0a, 0x1b, 0x6f, 0x76, 0x65, 0x72, + 0x72, 0x69, 0x64, 0x65, 0x5f, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x19, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x55, 0x6e, 0x6c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x16, 0x0a, + 0x14, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, + 0x68, 0x42, 0x1a, 0x0a, 0x18, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x42, 0x1e, 0x0a, + 0x1c, 0x5f, 0x69, 0x66, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x6e, 0x6f, 0x74, 0x5f, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x22, 0xce, 0x01, + 0x0a, 0x19, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x14, 0x65, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, + 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, + 0x74, 0x68, 0x6d, 0x12, 0x35, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x4b, 0x65, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x42, 0x0a, 0x1b, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, + 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x4b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xca, + 0x05, 0x0a, 0x10, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x61, + 0x6e, 0x74, 0x73, 0x22, 0xb5, 0x05, 0x0a, 0x06, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x16, + 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x14, 0x4d, 0x41, 0x58, 0x5f, 0x52, 0x45, + 0x41, 0x44, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, + 0x80, 0x80, 0x01, 0x12, 0x1c, 0x0a, 0x15, 0x4d, 0x41, 0x58, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x43, 0x48, 0x55, 0x4e, 0x4b, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x80, 0x80, - 0x01, 0x12, 0x1c, 0x0a, 0x15, 0x4d, 0x41, 0x58, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x5f, 0x43, - 0x48, 0x55, 0x4e, 0x4b, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x80, 0x80, 0x01, 0x12, - 0x19, 0x0a, 0x12, 0x4d, 0x41, 0x58, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x53, 0x49, - 0x5a, 0x45, 0x5f, 0x4d, 0x42, 0x10, 0x80, 0x80, 0xc0, 0x02, 0x12, 0x29, 0x0a, 0x24, 0x4d, 0x41, - 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, - 0x41, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x42, 0x59, 0x54, - 0x45, 0x53, 0x10, 0x80, 0x08, 0x12, 0x2a, 0x0a, 0x25, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, - 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x46, 0x49, 0x45, - 0x4c, 0x44, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, - 0x20, 0x12, 0x29, 0x0a, 0x24, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, - 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, 0x5f, 0x53, - 0x49, 0x5a, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x40, 0x12, 0x2a, 0x0a, 0x24, - 0x4d, 0x41, 0x58, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, - 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x42, - 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0xa0, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x41, 0x58, 0x5f, - 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x4f, 0x4e, - 0x46, 0x49, 0x47, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, - 0x64, 0x12, 0x22, 0x0a, 0x1e, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x49, 0x46, 0x45, 0x43, 0x59, 0x43, - 0x4c, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x43, - 0x4b, 0x45, 0x54, 0x10, 0x64, 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, - 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, - 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x53, 0x10, 0x05, 0x12, 0x31, 0x0a, - 0x2c, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, - 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, - 0x54, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x10, 0x80, 0x02, - 0x12, 0x33, 0x0a, 0x2e, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, - 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, 0x4e, 0x47, - 0x54, 0x48, 0x10, 0x80, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, - 0x45, 0x4c, 0x53, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x43, 0x4f, 0x55, 0x4e, - 0x54, 0x10, 0x40, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, 0x45, 0x4c, - 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, 0x4e, 0x47, - 0x54, 0x48, 0x10, 0x3f, 0x12, 0x1f, 0x0a, 0x1a, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, 0x45, - 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, 0x59, 0x54, - 0x45, 0x53, 0x10, 0x80, 0x01, 0x12, 0x2e, 0x0a, 0x29, 0x4d, 0x41, 0x58, 0x5f, 0x4f, 0x42, 0x4a, - 0x45, 0x43, 0x54, 0x5f, 0x49, 0x44, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x44, 0x45, 0x4c, 0x45, - 0x54, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x45, - 0x53, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x50, 0x4c, 0x49, 0x54, 0x5f, 0x54, - 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x5f, 0x44, - 0x41, 0x59, 0x53, 0x10, 0x0e, 0x1a, 0x02, 0x10, 0x01, 0x22, 0x86, 0x24, 0x0a, 0x06, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, - 0x09, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, - 0x74, 0x61, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x2d, 0x0a, 0x2b, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x6e, 0x61, 0x67, - 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x1f, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, - 0x10, 0x0a, 0x03, 0x72, 0x70, 0x6f, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x70, - 0x6f, 0x12, 0x38, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, 0x54, 0x0a, 0x12, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, 0x63, - 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, - 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, - 0x6c, 0x12, 0x41, 0x0a, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x18, 0x0a, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, - 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x52, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, - 0x79, 0x63, 0x6c, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x18, 0x0c, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, - 0x43, 0x6f, 0x72, 0x73, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, + 0x01, 0x12, 0x19, 0x0a, 0x12, 0x4d, 0x41, 0x58, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, + 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x4d, 0x42, 0x10, 0x80, 0x80, 0xc0, 0x02, 0x12, 0x29, 0x0a, 0x24, + 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, + 0x41, 0x54, 0x41, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x5f, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x08, 0x12, 0x2a, 0x0a, 0x25, 0x4d, 0x41, 0x58, 0x5f, 0x43, + 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x46, + 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, + 0x10, 0x80, 0x20, 0x12, 0x29, 0x0a, 0x24, 0x4d, 0x41, 0x58, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, + 0x4d, 0x5f, 0x4d, 0x45, 0x54, 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, + 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x40, 0x12, 0x2a, + 0x0a, 0x24, 0x4d, 0x41, 0x58, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x4d, 0x45, 0x54, + 0x41, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x54, 0x4f, 0x54, 0x41, 0x4c, 0x5f, 0x53, 0x49, 0x5a, 0x45, + 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0xa0, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x4d, 0x41, + 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, + 0x4f, 0x4e, 0x46, 0x49, 0x47, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, 0x55, 0x43, 0x4b, 0x45, + 0x54, 0x10, 0x64, 0x12, 0x22, 0x0a, 0x1e, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x49, 0x46, 0x45, 0x43, + 0x59, 0x43, 0x4c, 0x45, 0x5f, 0x52, 0x55, 0x4c, 0x45, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x42, + 0x55, 0x43, 0x4b, 0x45, 0x54, 0x10, 0x64, 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x41, 0x58, 0x5f, 0x4e, + 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, + 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x53, 0x10, 0x05, 0x12, + 0x31, 0x0a, 0x2c, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, 0x54, 0x52, 0x49, + 0x42, 0x55, 0x54, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x10, + 0x80, 0x02, 0x12, 0x33, 0x0a, 0x2e, 0x4d, 0x41, 0x58, 0x5f, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x41, 0x54, + 0x54, 0x52, 0x49, 0x42, 0x55, 0x54, 0x45, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, + 0x4e, 0x47, 0x54, 0x48, 0x10, 0x80, 0x08, 0x12, 0x1c, 0x0a, 0x18, 0x4d, 0x41, 0x58, 0x5f, 0x4c, + 0x41, 0x42, 0x45, 0x4c, 0x53, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x49, 0x45, 0x53, 0x5f, 0x43, 0x4f, + 0x55, 0x4e, 0x54, 0x10, 0x40, 0x12, 0x1f, 0x0a, 0x1b, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, 0x42, + 0x45, 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x4c, 0x45, + 0x4e, 0x47, 0x54, 0x48, 0x10, 0x3f, 0x12, 0x1f, 0x0a, 0x1a, 0x4d, 0x41, 0x58, 0x5f, 0x4c, 0x41, + 0x42, 0x45, 0x4c, 0x53, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x10, 0x80, 0x01, 0x12, 0x2e, 0x0a, 0x29, 0x4d, 0x41, 0x58, 0x5f, 0x4f, + 0x42, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x49, 0x44, 0x53, 0x5f, 0x50, 0x45, 0x52, 0x5f, 0x44, 0x45, + 0x4c, 0x45, 0x54, 0x45, 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x51, + 0x55, 0x45, 0x53, 0x54, 0x10, 0xe8, 0x07, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x50, 0x4c, 0x49, 0x54, + 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x5f, 0x4d, 0x41, 0x58, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, + 0x5f, 0x44, 0x41, 0x59, 0x53, 0x10, 0x0e, 0x1a, 0x02, 0x10, 0x01, 0x22, 0xb5, 0x37, 0x0a, 0x06, + 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x08, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x20, 0x0a, 0x09, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x08, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x4d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x33, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x2d, 0x0a, 0x2b, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x6e, + 0x61, 0x67, 0x65, 0x72, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x1f, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, + 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0d, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x15, 0x0a, 0x03, 0x72, 0x70, 0x6f, 0x18, 0x1b, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x72, 0x70, 0x6f, 0x12, 0x3d, 0x0a, + 0x03, 0x61, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x6f, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, 0x59, 0x0a, 0x12, + 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x61, + 0x63, 0x6c, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x6c, 0x12, 0x46, 0x0a, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x6c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, + 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x37, 0x0a, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x6f, 0x72, 0x73, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x72, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, - 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x18, + 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3c, 0x0a, 0x18, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, - 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x15, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x65, - 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x3d, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, - 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, - 0x62, 0x65, 0x6c, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, - 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x2e, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, - 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, - 0x6e, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x6c, 0x6f, 0x67, - 0x67, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x13, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, - 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0a, 0x65, 0x6e, 0x63, - 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x3b, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x42, 0x69, 0x6c, 0x6c, - 0x69, 0x6e, 0x67, 0x52, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x54, 0x0a, 0x10, - 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, - 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, - 0x79, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x42, 0x0a, 0x0a, 0x69, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, - 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x09, 0x69, 0x61, 0x6d, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, - 0x69, 0x65, 0x73, 0x5f, 0x70, 0x7a, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x73, - 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x50, 0x7a, 0x73, 0x12, 0x67, 0x0a, 0x17, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, + 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x15, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x42, 0x0a, 0x06, 0x6c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x12, 0x40, + 0x0a, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x57, 0x65, 0x62, 0x73, 0x69, + 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x77, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, + 0x12, 0x49, 0x0a, 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x18, 0x11, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, + 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0a, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x40, 0x0a, 0x07, 0x6c, + 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x18, 0x12, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x33, 0x0a, + 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, - 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x15, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x67, 0x12, 0x41, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x52, 0x09, 0x61, 0x75, - 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x16, 0x68, 0x69, 0x65, 0x72, 0x61, - 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, - 0x65, 0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x2e, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x68, + 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, + 0x65, 0x72, 0x12, 0x49, 0x0a, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x14, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x0a, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, + 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, + 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, + 0x59, 0x0a, 0x10, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x6f, 0x6c, + 0x69, 0x63, 0x79, 0x18, 0x16, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x72, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x47, 0x0a, 0x0a, 0x69, 0x61, + 0x6d, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x17, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x69, 0x61, 0x6d, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, + 0x5f, 0x70, 0x7a, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0c, 0x73, 0x61, 0x74, 0x69, 0x73, 0x66, 0x69, 0x65, 0x73, 0x50, 0x7a, 0x73, 0x12, 0x6c, 0x0a, + 0x17, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x63, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x46, 0x0a, 0x09, 0x61, + 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, + 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x61, 0x75, 0x74, 0x6f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x12, 0x6b, 0x0a, 0x16, 0x68, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, + 0x63, 0x61, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x20, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x12, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x66, 0x74, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, - 0x01, 0x52, 0x10, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, - 0x69, 0x63, 0x79, 0x1a, 0x30, 0x0a, 0x07, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, 0x12, 0x25, - 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x73, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, - 0x72, 0x50, 0x61, 0x79, 0x73, 0x1a, 0x87, 0x01, 0x0a, 0x04, 0x43, 0x6f, 0x72, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, - 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, - 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x27, - 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x61, - 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0d, 0x6d, 0x61, 0x78, 0x41, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, - 0x5c, 0x0a, 0x0a, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4e, 0x0a, - 0x0f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, - 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x0d, - 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x1a, 0xb1, 0x02, - 0x0a, 0x09, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x7b, 0x0a, 0x1b, 0x75, - 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x18, - 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, - 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x18, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x1a, 0x6d, 0x0a, 0x18, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x6b, + 0x70, 0x61, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x15, 0x68, 0x69, 0x65, 0x72, 0x61, + 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x5d, 0x0a, 0x12, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, + 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x73, + 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, + 0x59, 0x0a, 0x10, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x21, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x49, 0x0a, 0x09, 0x69, 0x70, + 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x08, 0x69, 0x70, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x88, 0x01, 0x01, 0x1a, 0x35, 0x0a, 0x07, 0x42, 0x69, 0x6c, 0x6c, 0x69, 0x6e, 0x67, + 0x12, 0x2a, 0x0a, 0x0e, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x70, 0x61, + 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x72, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x72, 0x50, 0x61, 0x79, 0x73, 0x1a, 0x9b, 0x01, 0x0a, + 0x04, 0x43, 0x6f, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, + 0x69, 0x6e, 0x12, 0x1b, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, + 0x2c, 0x0a, 0x0f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x72, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, + 0x0f, 0x6d, 0x61, 0x78, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x78, + 0x41, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x1a, 0xa0, 0x0b, 0x0a, 0x0a, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x0f, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, + 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x0d, 0x64, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x4b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0xb7, 0x01, 0x0a, + 0x2c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, + 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x4d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x00, 0x52, 0x28, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0xbd, 0x01, 0x0a, 0x2e, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x4f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x4d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x01, 0x52, 0x2a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, + 0x72, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x12, 0xc0, 0x01, 0x0a, 0x2f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, + 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x50, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x53, + 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x48, 0x02, 0x52, 0x2b, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x88, 0x01, 0x01, 0x1a, 0xca, 0x01, 0x0a, 0x28, 0x47, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x48, 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, + 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, + 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, + 0x0a, 0x11, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, + 0x6f, 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0xcc, 0x01, 0x0a, 0x2a, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x4d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, + 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, + 0x11, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0xcd, 0x01, 0x0a, 0x2b, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x65, 0x72, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2e, 0x0a, 0x10, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x0f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x6f, + 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x13, 0x0a, + 0x11, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x6f, + 0x64, 0x65, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x2f, 0x0a, 0x2d, 0x5f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x31, 0x0a, 0x2f, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x65, 0x72, 0x5f, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x72, + 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x32, 0x0a, 0x30, 0x5f, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x5f, + 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x66, 0x6f, 0x72, + 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xc6, 0x02, + 0x0a, 0x09, 0x49, 0x61, 0x6d, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x80, 0x01, 0x0a, 0x1b, + 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x61, 0x6d, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x18, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3d, + 0x0a, 0x18, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, + 0x70, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x16, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x50, 0x72, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x77, 0x0a, + 0x18, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x4c, 0x65, + 0x76, 0x65, 0x6c, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x3c, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, - 0x65, 0x1a, 0xdb, 0x07, 0x0a, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x12, - 0x3c, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, - 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, - 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x1a, 0x8f, 0x07, - 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, - 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x50, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6c, 0x6f, + 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x92, 0x08, 0x0a, 0x09, 0x4c, 0x69, 0x66, 0x65, 0x63, + 0x79, 0x63, 0x6c, 0x65, 0x12, 0x41, 0x0a, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, - 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6e, - 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x1a, 0x41, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, - 0x6c, 0x61, 0x73, 0x73, 0x1a, 0xa8, 0x05, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x07, 0x61, 0x67, 0x65, 0x44, 0x61, 0x79, 0x73, 0x88, - 0x01, 0x01, 0x12, 0x38, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x65, - 0x66, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x0d, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x07, - 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, - 0x06, 0x69, 0x73, 0x4c, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, 0x12, 0x6e, 0x75, - 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x10, 0x6e, 0x75, 0x6d, 0x4e, 0x65, 0x77, - 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, 0x12, 0x32, 0x0a, - 0x15, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x13, 0x6d, 0x61, - 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, - 0x73, 0x12, 0x38, 0x0a, 0x16, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x05, 0x48, 0x03, 0x52, 0x13, 0x64, 0x61, 0x79, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x3f, 0x0a, 0x12, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, - 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x1a, - 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, - 0x48, 0x04, 0x52, 0x17, 0x64, 0x61, 0x79, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x6e, - 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x47, - 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, - 0x65, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, - 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, - 0x65, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x25, - 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, - 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, - 0x75, 0x66, 0x66, 0x69, 0x78, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, - 0x79, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x15, - 0x0a, 0x13, 0x5f, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, - 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x42, 0x1d, 0x0a, 0x1b, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, - 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, - 0x54, 0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, - 0x67, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x6c, 0x6f, 0x67, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x6f, 0x67, - 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x6f, 0x67, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, - 0x72, 0x65, 0x66, 0x69, 0x78, 0x1a, 0xbb, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x41, 0x0a, 0x0e, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, - 0x69, 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x69, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x48, 0x0a, 0x12, 0x72, 0x65, 0x74, - 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x11, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0xd3, 0x01, 0x0a, 0x10, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x4d, 0x0a, 0x12, 0x72, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, - 0x00, 0x52, 0x11, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, - 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x26, 0x0a, 0x0a, 0x56, 0x65, 0x72, - 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x64, 0x1a, 0x59, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x28, 0x0a, 0x10, - 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x6d, 0x61, 0x69, 0x6e, 0x50, 0x61, 0x67, 0x65, - 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x24, 0x0a, 0x0e, 0x6e, 0x6f, 0x74, 0x5f, 0x66, 0x6f, - 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, - 0x6e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x50, 0x61, 0x67, 0x65, 0x1a, 0x3e, 0x0a, 0x15, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x25, 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x6f, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x64, - 0x61, 0x74, 0x61, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xd6, 0x02, 0x0a, - 0x09, 0x41, 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x74, 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x5f, 0x74, + 0x66, 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x04, 0x72, 0x75, 0x6c, 0x65, 0x1a, 0xc1, 0x07, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, + 0x12, 0x4c, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, 0x65, + 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x55, + 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x4c, 0x69, 0x66, + 0x65, 0x63, 0x79, 0x63, 0x6c, 0x65, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x43, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x4b, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x17, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x1a, 0xc6, 0x05, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x1e, 0x0a, 0x08, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x48, 0x00, 0x52, 0x07, 0x61, 0x67, 0x65, 0x44, 0x61, 0x79, 0x73, 0x88, 0x01, 0x01, + 0x12, 0x3d, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x65, 0x66, 0x6f, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, + 0x1c, 0x0a, 0x07, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x48, 0x01, 0x52, 0x06, 0x69, 0x73, 0x4c, 0x69, 0x76, 0x65, 0x88, 0x01, 0x01, 0x12, 0x31, 0x0a, + 0x12, 0x6e, 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x02, 0x52, 0x10, 0x6e, 0x75, 0x6d, + 0x4e, 0x65, 0x77, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x88, 0x01, 0x01, + 0x12, 0x37, 0x0a, 0x15, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x38, 0x0a, 0x16, 0x64, 0x61, 0x79, + 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x48, 0x03, 0x52, 0x13, 0x64, 0x61, 0x79, + 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x44, 0x0a, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, + 0x74, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x10, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, + 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x40, 0x0a, 0x1a, 0x64, 0x61, 0x79, + 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x48, 0x04, 0x52, + 0x17, 0x64, 0x61, 0x79, 0x73, 0x53, 0x69, 0x6e, 0x63, 0x65, 0x4e, 0x6f, 0x6e, 0x63, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4c, 0x0a, 0x16, 0x6e, + 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x62, + 0x65, 0x66, 0x6f, 0x72, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x65, 0x42, 0x03, + 0xe0, 0x41, 0x01, 0x52, 0x14, 0x6e, 0x6f, 0x6e, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x54, + 0x69, 0x6d, 0x65, 0x42, 0x65, 0x66, 0x6f, 0x72, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x6d, 0x61, 0x74, + 0x63, 0x68, 0x65, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x0b, 0x20, 0x03, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x50, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x2a, 0x0a, 0x0e, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, + 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x0d, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x65, 0x73, 0x53, 0x75, 0x66, 0x66, 0x69, + 0x78, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x42, 0x0a, + 0x0a, 0x08, 0x5f, 0x69, 0x73, 0x5f, 0x6c, 0x69, 0x76, 0x65, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x6e, + 0x75, 0x6d, 0x5f, 0x6e, 0x65, 0x77, 0x65, 0x72, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, + 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x1d, 0x0a, 0x1b, + 0x5f, 0x64, 0x61, 0x79, 0x73, 0x5f, 0x73, 0x69, 0x6e, 0x63, 0x65, 0x5f, 0x6e, 0x6f, 0x6e, 0x63, + 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x5e, 0x0a, 0x07, 0x4c, + 0x6f, 0x67, 0x67, 0x69, 0x6e, 0x67, 0x12, 0x22, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x5f, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x09, 0x6c, 0x6f, 0x67, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2f, 0x0a, 0x11, 0x6c, 0x6f, + 0x67, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, 0x6c, 0x6f, 0x67, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x1a, 0x33, 0x0a, 0x0f, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x20, + 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x06, 0xe0, 0x41, 0x01, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x1a, 0xca, 0x01, 0x0a, 0x0f, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x09, + 0x69, 0x73, 0x5f, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x4d, + 0x0a, 0x12, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x72, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xd3, 0x01, + 0x0a, 0x10, 0x53, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6f, 0x6c, 0x69, + 0x63, 0x79, 0x12, 0x4d, 0x0a, 0x12, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x11, 0x72, 0x65, 0x74, + 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, + 0x01, 0x12, 0x46, 0x0a, 0x0e, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x67, 0x67, - 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x16, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, - 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x88, 0x01, - 0x01, 0x12, 0x70, 0x0a, 0x22, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x01, - 0x52, 0x1e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, - 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x42, 0x25, - 0x0a, 0x23, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x36, 0x0a, 0x15, 0x48, 0x69, 0x65, 0x72, 0x61, 0x72, 0x63, - 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x1d, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, - 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x1a, 0x39, 0x0a, - 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x58, 0xea, 0x41, 0x55, 0x0a, 0x1d, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x23, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, - 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x7d, 0x2a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x32, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x22, 0x97, 0x02, 0x0a, 0x13, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, - 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, - 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x01, 0x52, 0x0d, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x15, 0x0a, 0x13, 0x5f, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x1a, 0x2b, 0x0a, 0x0a, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, + 0x67, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x1a, 0x63, 0x0a, 0x07, 0x57, 0x65, 0x62, 0x73, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x0a, 0x10, 0x6d, + 0x61, 0x69, 0x6e, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x75, 0x66, 0x66, 0x69, 0x78, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0e, 0x6d, 0x61, 0x69, 0x6e, + 0x50, 0x61, 0x67, 0x65, 0x53, 0x75, 0x66, 0x66, 0x69, 0x78, 0x12, 0x29, 0x0a, 0x0e, 0x6e, 0x6f, + 0x74, 0x5f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x6e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, + 0x64, 0x50, 0x61, 0x67, 0x65, 0x1a, 0x43, 0x0a, 0x15, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x50, + 0x6c, 0x61, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x2a, + 0x0a, 0x0e, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x64, 0x61, 0x74, + 0x61, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0xdb, 0x02, 0x0a, 0x09, 0x41, + 0x75, 0x74, 0x6f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x40, 0x0a, 0x0b, 0x74, 0x6f, 0x67, 0x67, 0x6c, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x74, + 0x6f, 0x67, 0x67, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x16, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, + 0x61, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x14, 0x74, 0x65, 0x72, + 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x88, 0x01, 0x01, 0x12, 0x70, 0x0a, 0x22, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, + 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, + 0x03, 0x48, 0x01, 0x52, 0x1e, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, + 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x42, 0x19, 0x0a, 0x17, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, + 0x6e, 0x61, 0x6c, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, + 0x73, 0x42, 0x25, 0x0a, 0x23, 0x5f, 0x74, 0x65, 0x72, 0x6d, 0x69, 0x6e, 0x61, 0x6c, 0x5f, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x8d, 0x05, 0x0a, 0x08, 0x49, 0x70, 0x46, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x6f, + 0x0a, 0x15, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x36, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x48, 0x01, 0x52, 0x13, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, + 0x68, 0x0a, 0x13, 0x76, 0x70, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x49, 0x70, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x2e, 0x56, 0x70, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x76, 0x70, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x34, 0x0a, 0x14, 0x61, 0x6c, 0x6c, + 0x6f, 0x77, 0x5f, 0x63, 0x72, 0x6f, 0x73, 0x73, 0x5f, 0x6f, 0x72, 0x67, 0x5f, 0x76, 0x70, 0x63, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x11, 0x61, 0x6c, + 0x6c, 0x6f, 0x77, 0x43, 0x72, 0x6f, 0x73, 0x73, 0x4f, 0x72, 0x67, 0x56, 0x70, 0x63, 0x73, 0x12, + 0x47, 0x0a, 0x1e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x1a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, + 0x41, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x1a, 0x4f, 0x0a, 0x13, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x38, 0x0a, 0x16, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x63, 0x69, + 0x64, 0x72, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x43, + 0x69, 0x64, 0x72, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x1a, 0x77, 0x0a, 0x10, 0x56, 0x70, 0x63, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1d, 0x0a, + 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x16, + 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x5f, 0x69, 0x70, 0x5f, 0x63, 0x69, 0x64, 0x72, 0x5f, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x13, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x49, 0x70, 0x43, 0x69, 0x64, 0x72, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x42, 0x18, 0x0a, 0x16, 0x5f, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x21, 0x0a, 0x1f, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, + 0x61, 0x6c, 0x6c, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x61, 0x67, 0x65, 0x6e, + 0x74, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x1a, 0x36, 0x0a, 0x15, 0x48, 0x69, 0x65, 0x72, + 0x61, 0x72, 0x63, 0x68, 0x69, 0x63, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, + 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x1a, 0x39, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, + 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, + 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x58, 0xea, 0x41, 0x55, + 0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x23, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x7d, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x7b, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x7d, 0x2a, 0x07, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x32, 0x06, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x69, 0x70, 0x5f, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0xbf, 0x02, 0x0a, 0x13, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x41, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x17, 0x0a, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, + 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x61, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x5a, 0x0a, 0x0f, - 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, - 0x1f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x05, 0xe0, 0x41, 0x01, 0x08, 0x01, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, - 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, - 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x54, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x63, - 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, - 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x08, 0x6d, 0x64, 0x35, 0x5f, - 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x6d, 0x64, 0x35, 0x48, - 0x61, 0x73, 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0x71, - 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x14, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, - 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x28, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x73, - 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x22, 0xbd, 0x0e, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, - 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1b, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x23, 0x0a, 0x0a, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x05, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x0a, - 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x23, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x0c, 0x72, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x2b, 0x0a, 0x0e, - 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x17, - 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, - 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, - 0x6e, 0x67, 0x12, 0x2f, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, - 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x73, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x61, 0x63, 0x68, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x38, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, - 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x03, 0x61, - 0x63, 0x6c, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, - 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, 0x40, 0x0a, - 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, - 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, - 0x44, 0x0a, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x04, + 0x65, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, + 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x46, 0x0a, + 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, + 0x65, 0x61, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x5a, 0x0a, 0x0f, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, + 0x6d, 0x6d, 0x65, 0x64, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x05, 0xe0, 0x41, 0x01, 0x08, 0x01, + 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, + 0x33, 0x32, 0x63, 0x88, 0x01, 0x01, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, + 0x63, 0x22, 0x59, 0x0a, 0x0f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, + 0x73, 0x75, 0x6d, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x06, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x88, 0x01, + 0x01, 0x12, 0x1e, 0x0a, 0x08, 0x6d, 0x64, 0x35, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x07, 0x6d, 0x64, 0x35, 0x48, 0x61, 0x73, + 0x68, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x63, 0x72, 0x63, 0x33, 0x32, 0x63, 0x22, 0xbb, 0x01, 0x0a, + 0x1a, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x78, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x63, 0x6f, - 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, - 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x45, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, - 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, - 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xc6, 0x01, 0x0a, 0x0e, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x4a, 0x0a, + 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, + 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0x68, 0x0a, 0x0b, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x43, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, + 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x7b, 0x0a, 0x12, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, + 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x14, 0x65, 0x6e, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x65, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, + 0x6d, 0x12, 0x2d, 0x0a, 0x10, 0x6b, 0x65, 0x79, 0x5f, 0x73, 0x68, 0x61, 0x32, 0x35, 0x36, 0x5f, + 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x01, + 0x52, 0x0e, 0x6b, 0x65, 0x79, 0x53, 0x68, 0x61, 0x32, 0x35, 0x36, 0x42, 0x79, 0x74, 0x65, 0x73, + 0x22, 0xe3, 0x11, 0x0a, 0x06, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x25, 0xe0, 0x41, 0x05, 0xfa, 0x41, 0x1f, 0x0a, 0x1d, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x06, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x1b, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x23, 0x0a, 0x0a, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x42, 0x03, 0xe0, 0x41, 0x05, 0x52, 0x0a, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x2d, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x18, 0x23, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, + 0x0c, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x88, 0x01, 0x01, + 0x12, 0x2b, 0x0a, 0x0e, 0x6d, 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0e, 0x6d, + 0x65, 0x74, 0x61, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, + 0x0d, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0c, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x17, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x65, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, + 0x12, 0x34, 0x0a, 0x13, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x44, 0x69, 0x73, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x28, 0x0a, 0x0d, 0x63, 0x61, 0x63, 0x68, 0x65, 0x5f, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x0c, 0x63, 0x61, 0x63, 0x68, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, + 0x12, 0x3d, 0x0a, 0x03, 0x61, 0x63, 0x6c, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x03, 0x61, 0x63, 0x6c, 0x12, + 0x2e, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x61, 0x6e, 0x67, 0x75, + 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0f, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x12, + 0x40, 0x0a, 0x0b, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, - 0x65, 0x12, 0x3f, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x12, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x26, 0xfa, 0x41, 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, - 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, - 0x65, 0x79, 0x12, 0x5a, 0x0a, 0x19, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, - 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x25, - 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x64, - 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, - 0x79, 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x4e, 0x0a, 0x15, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x15, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x66, 0x69, 0x6e, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x5f, 0x74, 0x69, + 0x6d, 0x65, 0x18, 0x24, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x66, 0x69, 0x6e, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, + 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x40, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x52, 0x13, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x43, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x17, - 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, - 0x65, 0x64, 0x48, 0x6f, 0x6c, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, - 0x65, 0x72, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, - 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x56, - 0x0a, 0x13, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, - 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, + 0x65, 0x12, 0x2c, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x5f, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, + 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x45, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x43, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x63, 0x68, 0x65, + 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x73, 0x12, 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x10, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x02, - 0x52, 0x0e, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x10, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x6b, 0x6d, 0x73, 0x5f, + 0x6b, 0x65, 0x79, 0x18, 0x12, 0x20, 0x01, 0x28, 0x09, 0x42, 0x29, 0xe0, 0x41, 0x01, 0xfa, 0x41, + 0x23, 0x0a, 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x4b, 0x65, 0x79, 0x52, 0x06, 0x6b, 0x6d, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x5a, 0x0a, 0x19, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x5f, 0x63, + 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, + 0x52, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0e, 0x74, 0x65, 0x6d, 0x70, + 0x6f, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x6f, 0x72, 0x61, 0x72, 0x79, + 0x48, 0x6f, 0x6c, 0x64, 0x12, 0x53, 0x0a, 0x15, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x15, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x13, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x45, + 0x78, 0x70, 0x69, 0x72, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x48, 0x0a, 0x08, 0x6d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x16, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x12, 0x42, 0x0a, 0x08, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x18, + 0x26, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x63, + 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x73, 0x12, 0x2d, 0x0a, 0x10, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x17, 0x20, 0x01, 0x28, + 0x08, 0x48, 0x01, 0x52, 0x0e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x42, 0x61, 0x73, 0x65, 0x64, 0x48, + 0x6f, 0x6c, 0x64, 0x88, 0x01, 0x01, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, + 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x42, + 0x03, 0xe0, 0x41, 0x03, 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x5b, 0x0a, 0x13, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x03, 0xe0, 0x41, 0x01, 0x52, 0x12, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x45, 0x6e, + 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x40, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x03, - 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, - 0x88, 0x01, 0x01, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, - 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x5f, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x61, 0x73, - 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x73, 0x6f, 0x66, 0x74, - 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x13, 0x0a, 0x11, - 0x5f, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x22, 0x97, 0x02, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, - 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, - 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, - 0x61, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, - 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, - 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x41, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0a, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x10, 0x73, 0x6f, + 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1c, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x02, 0x52, 0x0e, 0x73, 0x6f, 0x66, 0x74, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x4e, 0x0a, 0x10, 0x68, 0x61, + 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x1d, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, + 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x03, 0x52, 0x0e, 0x68, 0x61, 0x72, 0x64, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x46, 0x0a, 0x09, 0x72, 0x65, + 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, + 0x6f, 0x6e, 0x1a, 0xd3, 0x01, 0x0a, 0x09, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x41, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x52, 0x0b, - 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x13, - 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x66, - 0x69, 0x78, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x65, 0x66, - 0x69, 0x78, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, - 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, - 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x48, 0x0a, 0x0b, - 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x25, 0x0a, 0x0e, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x3c, 0x0a, 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, - 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x1b, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, - 0x79, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, - 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x27, 0x0a, 0x0f, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x4c, - 0x65, 0x6e, 0x67, 0x74, 0x68, 0x32, 0xc1, 0x1e, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x15, - 0x12, 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, + 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x6d, + 0x6f, 0x64, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x75, 0x6e, + 0x74, 0x69, 0x6c, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, + 0x0f, 0x72, 0x65, 0x74, 0x61, 0x69, 0x6e, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x54, 0x69, 0x6d, 0x65, + 0x22, 0x36, 0x0a, 0x04, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x4f, 0x44, 0x45, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, + 0x0a, 0x08, 0x55, 0x4e, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, + 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x02, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x64, 0x5f, 0x68, 0x6f, 0x6c, 0x64, 0x42, 0x13, 0x0a, 0x11, + 0x5f, 0x73, 0x6f, 0x66, 0x74, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, + 0x65, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x68, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xbf, 0x02, 0x0a, 0x13, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x17, + 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x06, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, + 0x01, 0x52, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x22, 0x0a, 0x0a, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x5f, 0x61, 0x6c, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, 0x6c, 0x74, 0x12, 0x20, 0x0a, + 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x49, 0x64, 0x12, + 0x17, 0x0a, 0x04, 0x65, 0x74, 0x61, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, + 0x41, 0x01, 0x52, 0x04, 0x65, 0x74, 0x61, 0x67, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x05, 0x65, 0x6d, + 0x61, 0x69, 0x6c, 0x12, 0x1b, 0x0a, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, + 0x12, 0x46, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x74, 0x65, 0x61, 0x6d, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, + 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x33, 0x0a, 0x07, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x65, + 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, + 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, + 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x52, 0x0a, 0x0b, 0x50, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x54, 0x65, 0x61, 0x6d, 0x12, 0x2a, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x04, 0x74, 0x65, 0x61, 0x6d, 0x22, 0x46, 0x0a, + 0x05, 0x4f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x06, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x12, 0x20, 0x0a, 0x09, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x01, 0x52, 0x08, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x49, 0x64, 0x22, 0x5f, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, + 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x27, 0x0a, + 0x0f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x5f, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, + 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x32, 0x9f, 0x1f, 0x0a, 0x07, 0x53, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x12, 0x72, 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x58, 0xda, 0x41, 0x17, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x1e, 0x0a, 0x0e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x70, - 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, + 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6f, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xd3, 0xe4, 0x93, + 0x02, 0x15, 0x12, 0x13, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xab, 0x01, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x58, 0xda, 0x41, 0x17, + 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x69, 0x64, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x12, 0x16, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x1e, 0x0a, 0x0e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, + 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x85, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, + 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, + 0x0c, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x93, 0x01, + 0x0a, 0x19, 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, + 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x33, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x26, 0xda, 0x41, 0x06, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, + 0x2a, 0x2a, 0x7d, 0x12, 0xa3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, + 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, + 0x58, 0xda, 0x41, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x8a, 0xd3, 0xe4, 0x93, + 0x02, 0x47, 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, + 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x2c, 0x0a, 0x08, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0xaa, 0x01, 0x0a, 0x0c, 0x53, 0x65, + 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x61, + 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x5f, 0xda, 0x41, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x2c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x47, 0x12, + 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x2c, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x02, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, 0x49, + 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, + 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, + 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0xaa, 0x01, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2c, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x8a, 0xd3, 0xe4, 0x93, + 0x02, 0x8c, 0x01, 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, + 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x34, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x28, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, + 0x2a, 0x2a, 0x12, 0x3b, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, + 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, + 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, 0x61, + 0x6e, 0x61, 0x67, 0x65, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2a, 0x12, + 0x8a, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x22, 0x37, 0xda, 0x41, 0x12, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x1c, + 0x12, 0x1a, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x7e, 0x0a, 0x0d, + 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x22, 0x29, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, 0x73, + 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, + 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x26, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x48, 0xda, + 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, + 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, + 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, + 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x38, 0xda, + 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, + 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xba, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, + 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, + 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x8a, + 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, + 0x69, 0x64, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, + 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, + 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x95, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, + 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xa5, 0x01, 0x0a, + 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xd3, - 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0c, - 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x93, 0x01, 0x0a, - 0x19, 0x4c, 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, - 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x33, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, - 0x6f, 0x63, 0x6b, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x22, 0x26, 0xda, 0x41, 0x06, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, + 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, + 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, - 0x2a, 0x7d, 0x12, 0x75, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, - 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x2a, 0xda, - 0x41, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x19, - 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x7c, 0x0a, 0x0c, 0x53, 0x65, 0x74, - 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, - 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, - 0x6c, 0x69, 0x63, 0x79, 0x22, 0x31, 0xda, 0x41, 0x0f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2c, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x19, 0x12, 0x17, - 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x96, 0x02, 0x0a, 0x12, 0x54, 0x65, 0x73, 0x74, - 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, - 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, - 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0xaa, 0x01, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2c, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x8a, 0xd3, 0xe4, - 0x93, 0x02, 0x8c, 0x01, 0x12, 0x17, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x34, 0x0a, - 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x28, 0x7b, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, - 0x2f, 0x2a, 0x2a, 0x12, 0x3b, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, - 0x2f, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, - 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6d, - 0x61, 0x6e, 0x61, 0x67, 0x65, 0x64, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2a, - 0x12, 0x8a, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, 0x65, + 0x2a, 0x7d, 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, + 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, + 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x8a, 0xd3, + 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x0a, 0x17, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, + 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x28, 0x01, 0x30, 0x01, + 0x12, 0x8c, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x22, 0x37, 0xda, 0x41, 0x12, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x22, 0x39, 0xda, 0x41, 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, 0x02, - 0x1c, 0x12, 0x1a, 0x0a, 0x0b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x7e, 0x0a, - 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6f, 0x73, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x22, 0x29, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, - 0x0a, 0x0c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x26, + 0x1e, 0x12, 0x1c, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x62, 0x75, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, + 0x60, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, - 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x48, - 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, - 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, + 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, + 0x01, 0x12, 0x6e, 0x0a, 0x0f, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, + 0x01, 0x12, 0x84, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, + 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x26, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, + 0x17, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, + 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0d, 0x52, 0x65, 0x77, + 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, - 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x38, - 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, - 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xba, 0x01, 0x0a, 0x14, 0x43, 0x61, 0x6e, - 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, - 0x65, 0x12, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, - 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x75, - 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, + 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x34, 0x12, + 0x0f, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, + 0x2a, 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, + 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, + 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x53, + 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x8a, 0xd3, 0xe4, 0x93, + 0x02, 0x32, 0x12, 0x30, 0x0a, 0x21, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, + 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, 0x64, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x2f, - 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x95, 0x01, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x12, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, - 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xa5, 0x01, - 0x0a, 0x0a, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x48, 0xda, 0x41, 0x0d, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0xda, 0x41, 0x18, 0x62, 0x75, - 0x63, 0x6b, 0x65, 0x74, 0x2c, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, - 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, - 0x2a, 0x2a, 0x7d, 0x30, 0x01, 0x12, 0x99, 0x01, 0x0a, 0x0e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, - 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, - 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x52, 0x65, 0x61, 0x64, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x8a, - 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x0a, 0x17, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x28, 0x01, 0x30, - 0x01, 0x12, 0x8c, 0x01, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x12, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4f, 0x62, 0x6a, + 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x01, 0x0a, 0x0a, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, + 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x39, 0xda, 0x41, 0x12, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xd3, 0xe4, 0x93, - 0x02, 0x1e, 0x12, 0x1c, 0x0a, 0x0d, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x62, 0x75, 0x63, - 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, - 0x12, 0x60, 0x0a, 0x0b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, - 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, - 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x57, 0x72, 0x69, 0x74, 0x65, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x28, 0x01, 0x12, 0x6e, 0x0a, 0x0f, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x42, 0x69, 0x64, 0x69, 0x57, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, - 0x30, 0x01, 0x12, 0x84, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x12, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, - 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x26, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x8a, 0xd3, 0xe4, 0x93, - 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x0b, 0x7b, 0x62, - 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x98, 0x01, 0x0a, 0x0d, 0x52, 0x65, - 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x77, 0x72, 0x69, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3a, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x34, - 0x12, 0x0f, 0x0a, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x12, 0x21, 0x0a, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, - 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x13, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, - 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x12, 0x2d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, - 0x2e, 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, - 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x53, 0x74, 0x61, 0x72, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6d, 0x61, 0x62, 0x6c, 0x65, 0x57, 0x72, - 0x69, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x8a, 0xd3, 0xe4, - 0x93, 0x02, 0x32, 0x12, 0x30, 0x0a, 0x21, 0x77, 0x72, 0x69, 0x74, 0x65, 0x5f, 0x6f, 0x62, 0x6a, - 0x65, 0x63, 0x74, 0x5f, 0x73, 0x70, 0x65, 0x63, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x2e, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0xae, 0x01, 0x0a, 0x10, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, - 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x57, 0x72, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x41, 0xda, 0x41, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x5f, 0x69, - 0x64, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x0a, 0x09, 0x75, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x5f, 0x69, 0x64, 0x12, 0x20, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x73, - 0x2f, 0x2a, 0x7d, 0x2f, 0x2a, 0x2a, 0x12, 0x96, 0x01, 0x0a, 0x0a, 0x4d, 0x6f, 0x76, 0x65, 0x4f, - 0x62, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, - 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x6f, 0x76, 0x65, 0x4f, 0x62, - 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x2e, - 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x47, 0xda, 0x41, 0x27, 0x62, 0x75, 0x63, 0x6b, 0x65, - 0x74, 0x2c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, - 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, - 0x63, 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, - 0x65, 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x1a, - 0xa7, 0x02, 0xca, 0x41, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x8a, 0x02, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, - 0x6c, 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x47, 0xda, 0x41, 0x27, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x2c, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x64, + 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x8a, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x0a, 0x06, 0x62, 0x75, 0x63, 0x6b, 0x65, + 0x74, 0x12, 0x0b, 0x7b, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x3d, 0x2a, 0x2a, 0x7d, 0x1a, 0xa7, + 0x02, 0xca, 0x41, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0xd2, 0x41, 0x8a, 0x02, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, - 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x72, 0x65, 0x61, - 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, - 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, - 0x65, 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x68, - 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, - 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, - 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, - 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, - 0x65, 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xe2, 0x01, 0xea, 0x41, 0x78, 0x0a, - 0x21, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, - 0x65, 0x79, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2f, 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, - 0x69, 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, - 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, - 0x74, 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0c, - 0x53, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, - 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, - 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, - 0x67, 0x65, 0x70, 0x62, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6f, 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2c, 0x68, 0x74, 0x74, + 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, + 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x63, 0x6c, 0x6f, + 0x75, 0x64, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2e, 0x72, 0x65, 0x61, 0x64, + 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, + 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, + 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c, 0x68, 0x74, + 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x64, 0x65, + 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x6f, 0x6e, + 0x6c, 0x79, 0x2c, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x61, 0x75, + 0x74, 0x68, 0x2f, 0x64, 0x65, 0x76, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x72, 0x65, + 0x61, 0x64, 0x5f, 0x77, 0x72, 0x69, 0x74, 0x65, 0x42, 0xe2, 0x01, 0xea, 0x41, 0x78, 0x0a, 0x21, + 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x6b, 0x6d, 0x73, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, + 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, + 0x79, 0x12, 0x53, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x6a, 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, + 0x7b, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x7d, 0x2f, 0x6b, 0x65, 0x79, 0x52, 0x69, + 0x6e, 0x67, 0x73, 0x2f, 0x7b, 0x6b, 0x65, 0x79, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x7d, 0x2f, 0x63, + 0x72, 0x79, 0x70, 0x74, 0x6f, 0x4b, 0x65, 0x79, 0x73, 0x2f, 0x7b, 0x63, 0x72, 0x79, 0x70, 0x74, + 0x6f, 0x5f, 0x6b, 0x65, 0x79, 0x7d, 0x0a, 0x15, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x53, + 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3e, 0x63, + 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, + 0x65, 0x70, 0x62, 0x3b, 0x73, 0x74, 0x6f, 0x72, 0x61, 0x67, 0x65, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8928,263 +9983,293 @@ func file_google_storage_v2_storage_proto_rawDescGZIP() []byte { return file_google_storage_v2_storage_proto_rawDescData } -var file_google_storage_v2_storage_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_google_storage_v2_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 75) +var file_google_storage_v2_storage_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_google_storage_v2_storage_proto_msgTypes = make([]protoimpl.MessageInfo, 86) var file_google_storage_v2_storage_proto_goTypes = []any{ (ServiceConstants_Values)(0), // 0: google.storage.v2.ServiceConstants.Values - (*DeleteBucketRequest)(nil), // 1: google.storage.v2.DeleteBucketRequest - (*GetBucketRequest)(nil), // 2: google.storage.v2.GetBucketRequest - (*CreateBucketRequest)(nil), // 3: google.storage.v2.CreateBucketRequest - (*ListBucketsRequest)(nil), // 4: google.storage.v2.ListBucketsRequest - (*ListBucketsResponse)(nil), // 5: google.storage.v2.ListBucketsResponse - (*LockBucketRetentionPolicyRequest)(nil), // 6: google.storage.v2.LockBucketRetentionPolicyRequest - (*UpdateBucketRequest)(nil), // 7: google.storage.v2.UpdateBucketRequest - (*ComposeObjectRequest)(nil), // 8: google.storage.v2.ComposeObjectRequest - (*DeleteObjectRequest)(nil), // 9: google.storage.v2.DeleteObjectRequest - (*RestoreObjectRequest)(nil), // 10: google.storage.v2.RestoreObjectRequest - (*CancelResumableWriteRequest)(nil), // 11: google.storage.v2.CancelResumableWriteRequest - (*CancelResumableWriteResponse)(nil), // 12: google.storage.v2.CancelResumableWriteResponse - (*ReadObjectRequest)(nil), // 13: google.storage.v2.ReadObjectRequest - (*GetObjectRequest)(nil), // 14: google.storage.v2.GetObjectRequest - (*ReadObjectResponse)(nil), // 15: google.storage.v2.ReadObjectResponse - (*BidiReadObjectSpec)(nil), // 16: google.storage.v2.BidiReadObjectSpec - (*BidiReadObjectRequest)(nil), // 17: google.storage.v2.BidiReadObjectRequest - (*BidiReadObjectResponse)(nil), // 18: google.storage.v2.BidiReadObjectResponse - (*BidiReadObjectRedirectedError)(nil), // 19: google.storage.v2.BidiReadObjectRedirectedError - (*BidiWriteObjectRedirectedError)(nil), // 20: google.storage.v2.BidiWriteObjectRedirectedError - (*BidiReadObjectError)(nil), // 21: google.storage.v2.BidiReadObjectError - (*ReadRangeError)(nil), // 22: google.storage.v2.ReadRangeError - (*ReadRange)(nil), // 23: google.storage.v2.ReadRange - (*ObjectRangeData)(nil), // 24: google.storage.v2.ObjectRangeData - (*BidiReadHandle)(nil), // 25: google.storage.v2.BidiReadHandle - (*BidiWriteHandle)(nil), // 26: google.storage.v2.BidiWriteHandle - (*WriteObjectSpec)(nil), // 27: google.storage.v2.WriteObjectSpec - (*WriteObjectRequest)(nil), // 28: google.storage.v2.WriteObjectRequest - (*WriteObjectResponse)(nil), // 29: google.storage.v2.WriteObjectResponse - (*AppendObjectSpec)(nil), // 30: google.storage.v2.AppendObjectSpec - (*BidiWriteObjectRequest)(nil), // 31: google.storage.v2.BidiWriteObjectRequest - (*BidiWriteObjectResponse)(nil), // 32: google.storage.v2.BidiWriteObjectResponse - (*ListObjectsRequest)(nil), // 33: google.storage.v2.ListObjectsRequest - (*QueryWriteStatusRequest)(nil), // 34: google.storage.v2.QueryWriteStatusRequest - (*QueryWriteStatusResponse)(nil), // 35: google.storage.v2.QueryWriteStatusResponse - (*RewriteObjectRequest)(nil), // 36: google.storage.v2.RewriteObjectRequest - (*RewriteResponse)(nil), // 37: google.storage.v2.RewriteResponse - (*MoveObjectRequest)(nil), // 38: google.storage.v2.MoveObjectRequest - (*StartResumableWriteRequest)(nil), // 39: google.storage.v2.StartResumableWriteRequest - (*StartResumableWriteResponse)(nil), // 40: google.storage.v2.StartResumableWriteResponse - (*UpdateObjectRequest)(nil), // 41: google.storage.v2.UpdateObjectRequest - (*CommonObjectRequestParams)(nil), // 42: google.storage.v2.CommonObjectRequestParams - (*ServiceConstants)(nil), // 43: google.storage.v2.ServiceConstants - (*Bucket)(nil), // 44: google.storage.v2.Bucket - (*BucketAccessControl)(nil), // 45: google.storage.v2.BucketAccessControl - (*ChecksummedData)(nil), // 46: google.storage.v2.ChecksummedData - (*ObjectChecksums)(nil), // 47: google.storage.v2.ObjectChecksums - (*CustomerEncryption)(nil), // 48: google.storage.v2.CustomerEncryption - (*Object)(nil), // 49: google.storage.v2.Object - (*ObjectAccessControl)(nil), // 50: google.storage.v2.ObjectAccessControl - (*ListObjectsResponse)(nil), // 51: google.storage.v2.ListObjectsResponse - (*ProjectTeam)(nil), // 52: google.storage.v2.ProjectTeam - (*Owner)(nil), // 53: google.storage.v2.Owner - (*ContentRange)(nil), // 54: google.storage.v2.ContentRange - (*ComposeObjectRequest_SourceObject)(nil), // 55: google.storage.v2.ComposeObjectRequest.SourceObject - (*ComposeObjectRequest_SourceObject_ObjectPreconditions)(nil), // 56: google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - (*Bucket_Billing)(nil), // 57: google.storage.v2.Bucket.Billing - (*Bucket_Cors)(nil), // 58: google.storage.v2.Bucket.Cors - (*Bucket_Encryption)(nil), // 59: google.storage.v2.Bucket.Encryption - (*Bucket_IamConfig)(nil), // 60: google.storage.v2.Bucket.IamConfig - (*Bucket_Lifecycle)(nil), // 61: google.storage.v2.Bucket.Lifecycle - (*Bucket_Logging)(nil), // 62: google.storage.v2.Bucket.Logging - (*Bucket_RetentionPolicy)(nil), // 63: google.storage.v2.Bucket.RetentionPolicy - (*Bucket_SoftDeletePolicy)(nil), // 64: google.storage.v2.Bucket.SoftDeletePolicy - (*Bucket_Versioning)(nil), // 65: google.storage.v2.Bucket.Versioning - (*Bucket_Website)(nil), // 66: google.storage.v2.Bucket.Website - (*Bucket_CustomPlacementConfig)(nil), // 67: google.storage.v2.Bucket.CustomPlacementConfig - (*Bucket_Autoclass)(nil), // 68: google.storage.v2.Bucket.Autoclass - (*Bucket_HierarchicalNamespace)(nil), // 69: google.storage.v2.Bucket.HierarchicalNamespace - nil, // 70: google.storage.v2.Bucket.LabelsEntry - (*Bucket_IamConfig_UniformBucketLevelAccess)(nil), // 71: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - (*Bucket_Lifecycle_Rule)(nil), // 72: google.storage.v2.Bucket.Lifecycle.Rule - (*Bucket_Lifecycle_Rule_Action)(nil), // 73: google.storage.v2.Bucket.Lifecycle.Rule.Action - (*Bucket_Lifecycle_Rule_Condition)(nil), // 74: google.storage.v2.Bucket.Lifecycle.Rule.Condition - nil, // 75: google.storage.v2.Object.MetadataEntry - (*fieldmaskpb.FieldMask)(nil), // 76: google.protobuf.FieldMask - (*status.Status)(nil), // 77: google.rpc.Status - (*timestamppb.Timestamp)(nil), // 78: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 79: google.protobuf.Duration - (*date.Date)(nil), // 80: google.type.Date - (*iampb.GetIamPolicyRequest)(nil), // 81: google.iam.v1.GetIamPolicyRequest - (*iampb.SetIamPolicyRequest)(nil), // 82: google.iam.v1.SetIamPolicyRequest - (*iampb.TestIamPermissionsRequest)(nil), // 83: google.iam.v1.TestIamPermissionsRequest - (*emptypb.Empty)(nil), // 84: google.protobuf.Empty - (*iampb.Policy)(nil), // 85: google.iam.v1.Policy - (*iampb.TestIamPermissionsResponse)(nil), // 86: google.iam.v1.TestIamPermissionsResponse + (Object_Retention_Mode)(0), // 1: google.storage.v2.Object.Retention.Mode + (*DeleteBucketRequest)(nil), // 2: google.storage.v2.DeleteBucketRequest + (*GetBucketRequest)(nil), // 3: google.storage.v2.GetBucketRequest + (*CreateBucketRequest)(nil), // 4: google.storage.v2.CreateBucketRequest + (*ListBucketsRequest)(nil), // 5: google.storage.v2.ListBucketsRequest + (*ListBucketsResponse)(nil), // 6: google.storage.v2.ListBucketsResponse + (*LockBucketRetentionPolicyRequest)(nil), // 7: google.storage.v2.LockBucketRetentionPolicyRequest + (*UpdateBucketRequest)(nil), // 8: google.storage.v2.UpdateBucketRequest + (*ComposeObjectRequest)(nil), // 9: google.storage.v2.ComposeObjectRequest + (*DeleteObjectRequest)(nil), // 10: google.storage.v2.DeleteObjectRequest + (*RestoreObjectRequest)(nil), // 11: google.storage.v2.RestoreObjectRequest + (*CancelResumableWriteRequest)(nil), // 12: google.storage.v2.CancelResumableWriteRequest + (*CancelResumableWriteResponse)(nil), // 13: google.storage.v2.CancelResumableWriteResponse + (*ReadObjectRequest)(nil), // 14: google.storage.v2.ReadObjectRequest + (*GetObjectRequest)(nil), // 15: google.storage.v2.GetObjectRequest + (*ReadObjectResponse)(nil), // 16: google.storage.v2.ReadObjectResponse + (*BidiReadObjectSpec)(nil), // 17: google.storage.v2.BidiReadObjectSpec + (*BidiReadObjectRequest)(nil), // 18: google.storage.v2.BidiReadObjectRequest + (*BidiReadObjectResponse)(nil), // 19: google.storage.v2.BidiReadObjectResponse + (*BidiReadObjectRedirectedError)(nil), // 20: google.storage.v2.BidiReadObjectRedirectedError + (*BidiWriteObjectRedirectedError)(nil), // 21: google.storage.v2.BidiWriteObjectRedirectedError + (*BidiReadObjectError)(nil), // 22: google.storage.v2.BidiReadObjectError + (*ReadRangeError)(nil), // 23: google.storage.v2.ReadRangeError + (*ReadRange)(nil), // 24: google.storage.v2.ReadRange + (*ObjectRangeData)(nil), // 25: google.storage.v2.ObjectRangeData + (*BidiReadHandle)(nil), // 26: google.storage.v2.BidiReadHandle + (*BidiWriteHandle)(nil), // 27: google.storage.v2.BidiWriteHandle + (*WriteObjectSpec)(nil), // 28: google.storage.v2.WriteObjectSpec + (*WriteObjectRequest)(nil), // 29: google.storage.v2.WriteObjectRequest + (*WriteObjectResponse)(nil), // 30: google.storage.v2.WriteObjectResponse + (*AppendObjectSpec)(nil), // 31: google.storage.v2.AppendObjectSpec + (*BidiWriteObjectRequest)(nil), // 32: google.storage.v2.BidiWriteObjectRequest + (*BidiWriteObjectResponse)(nil), // 33: google.storage.v2.BidiWriteObjectResponse + (*ListObjectsRequest)(nil), // 34: google.storage.v2.ListObjectsRequest + (*QueryWriteStatusRequest)(nil), // 35: google.storage.v2.QueryWriteStatusRequest + (*QueryWriteStatusResponse)(nil), // 36: google.storage.v2.QueryWriteStatusResponse + (*RewriteObjectRequest)(nil), // 37: google.storage.v2.RewriteObjectRequest + (*RewriteResponse)(nil), // 38: google.storage.v2.RewriteResponse + (*MoveObjectRequest)(nil), // 39: google.storage.v2.MoveObjectRequest + (*StartResumableWriteRequest)(nil), // 40: google.storage.v2.StartResumableWriteRequest + (*StartResumableWriteResponse)(nil), // 41: google.storage.v2.StartResumableWriteResponse + (*UpdateObjectRequest)(nil), // 42: google.storage.v2.UpdateObjectRequest + (*CommonObjectRequestParams)(nil), // 43: google.storage.v2.CommonObjectRequestParams + (*ServiceConstants)(nil), // 44: google.storage.v2.ServiceConstants + (*Bucket)(nil), // 45: google.storage.v2.Bucket + (*BucketAccessControl)(nil), // 46: google.storage.v2.BucketAccessControl + (*ChecksummedData)(nil), // 47: google.storage.v2.ChecksummedData + (*ObjectChecksums)(nil), // 48: google.storage.v2.ObjectChecksums + (*ObjectCustomContextPayload)(nil), // 49: google.storage.v2.ObjectCustomContextPayload + (*ObjectContexts)(nil), // 50: google.storage.v2.ObjectContexts + (*CustomerEncryption)(nil), // 51: google.storage.v2.CustomerEncryption + (*Object)(nil), // 52: google.storage.v2.Object + (*ObjectAccessControl)(nil), // 53: google.storage.v2.ObjectAccessControl + (*ListObjectsResponse)(nil), // 54: google.storage.v2.ListObjectsResponse + (*ProjectTeam)(nil), // 55: google.storage.v2.ProjectTeam + (*Owner)(nil), // 56: google.storage.v2.Owner + (*ContentRange)(nil), // 57: google.storage.v2.ContentRange + (*ComposeObjectRequest_SourceObject)(nil), // 58: google.storage.v2.ComposeObjectRequest.SourceObject + (*ComposeObjectRequest_SourceObject_ObjectPreconditions)(nil), // 59: google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + (*Bucket_Billing)(nil), // 60: google.storage.v2.Bucket.Billing + (*Bucket_Cors)(nil), // 61: google.storage.v2.Bucket.Cors + (*Bucket_Encryption)(nil), // 62: google.storage.v2.Bucket.Encryption + (*Bucket_IamConfig)(nil), // 63: google.storage.v2.Bucket.IamConfig + (*Bucket_Lifecycle)(nil), // 64: google.storage.v2.Bucket.Lifecycle + (*Bucket_Logging)(nil), // 65: google.storage.v2.Bucket.Logging + (*Bucket_ObjectRetention)(nil), // 66: google.storage.v2.Bucket.ObjectRetention + (*Bucket_RetentionPolicy)(nil), // 67: google.storage.v2.Bucket.RetentionPolicy + (*Bucket_SoftDeletePolicy)(nil), // 68: google.storage.v2.Bucket.SoftDeletePolicy + (*Bucket_Versioning)(nil), // 69: google.storage.v2.Bucket.Versioning + (*Bucket_Website)(nil), // 70: google.storage.v2.Bucket.Website + (*Bucket_CustomPlacementConfig)(nil), // 71: google.storage.v2.Bucket.CustomPlacementConfig + (*Bucket_Autoclass)(nil), // 72: google.storage.v2.Bucket.Autoclass + (*Bucket_IpFilter)(nil), // 73: google.storage.v2.Bucket.IpFilter + (*Bucket_HierarchicalNamespace)(nil), // 74: google.storage.v2.Bucket.HierarchicalNamespace + nil, // 75: google.storage.v2.Bucket.LabelsEntry + (*Bucket_Encryption_GoogleManagedEncryptionEnforcementConfig)(nil), // 76: google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + (*Bucket_Encryption_CustomerManagedEncryptionEnforcementConfig)(nil), // 77: google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + (*Bucket_Encryption_CustomerSuppliedEncryptionEnforcementConfig)(nil), // 78: google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + (*Bucket_IamConfig_UniformBucketLevelAccess)(nil), // 79: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + (*Bucket_Lifecycle_Rule)(nil), // 80: google.storage.v2.Bucket.Lifecycle.Rule + (*Bucket_Lifecycle_Rule_Action)(nil), // 81: google.storage.v2.Bucket.Lifecycle.Rule.Action + (*Bucket_Lifecycle_Rule_Condition)(nil), // 82: google.storage.v2.Bucket.Lifecycle.Rule.Condition + (*Bucket_IpFilter_PublicNetworkSource)(nil), // 83: google.storage.v2.Bucket.IpFilter.PublicNetworkSource + (*Bucket_IpFilter_VpcNetworkSource)(nil), // 84: google.storage.v2.Bucket.IpFilter.VpcNetworkSource + nil, // 85: google.storage.v2.ObjectContexts.CustomEntry + (*Object_Retention)(nil), // 86: google.storage.v2.Object.Retention + nil, // 87: google.storage.v2.Object.MetadataEntry + (*fieldmaskpb.FieldMask)(nil), // 88: google.protobuf.FieldMask + (*status.Status)(nil), // 89: google.rpc.Status + (*timestamppb.Timestamp)(nil), // 90: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 91: google.protobuf.Duration + (*date.Date)(nil), // 92: google.type.Date + (*iampb.GetIamPolicyRequest)(nil), // 93: google.iam.v1.GetIamPolicyRequest + (*iampb.SetIamPolicyRequest)(nil), // 94: google.iam.v1.SetIamPolicyRequest + (*iampb.TestIamPermissionsRequest)(nil), // 95: google.iam.v1.TestIamPermissionsRequest + (*emptypb.Empty)(nil), // 96: google.protobuf.Empty + (*iampb.Policy)(nil), // 97: google.iam.v1.Policy + (*iampb.TestIamPermissionsResponse)(nil), // 98: google.iam.v1.TestIamPermissionsResponse } var file_google_storage_v2_storage_proto_depIdxs = []int32{ - 76, // 0: google.storage.v2.GetBucketRequest.read_mask:type_name -> google.protobuf.FieldMask - 44, // 1: google.storage.v2.CreateBucketRequest.bucket:type_name -> google.storage.v2.Bucket - 76, // 2: google.storage.v2.ListBucketsRequest.read_mask:type_name -> google.protobuf.FieldMask - 44, // 3: google.storage.v2.ListBucketsResponse.buckets:type_name -> google.storage.v2.Bucket - 44, // 4: google.storage.v2.UpdateBucketRequest.bucket:type_name -> google.storage.v2.Bucket - 76, // 5: google.storage.v2.UpdateBucketRequest.update_mask:type_name -> google.protobuf.FieldMask - 49, // 6: google.storage.v2.ComposeObjectRequest.destination:type_name -> google.storage.v2.Object - 55, // 7: google.storage.v2.ComposeObjectRequest.source_objects:type_name -> google.storage.v2.ComposeObjectRequest.SourceObject - 42, // 8: google.storage.v2.ComposeObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 47, // 9: google.storage.v2.ComposeObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 42, // 10: google.storage.v2.DeleteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 42, // 11: google.storage.v2.RestoreObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 42, // 12: google.storage.v2.ReadObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 76, // 13: google.storage.v2.ReadObjectRequest.read_mask:type_name -> google.protobuf.FieldMask - 42, // 14: google.storage.v2.GetObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 76, // 15: google.storage.v2.GetObjectRequest.read_mask:type_name -> google.protobuf.FieldMask - 46, // 16: google.storage.v2.ReadObjectResponse.checksummed_data:type_name -> google.storage.v2.ChecksummedData - 47, // 17: google.storage.v2.ReadObjectResponse.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 54, // 18: google.storage.v2.ReadObjectResponse.content_range:type_name -> google.storage.v2.ContentRange - 49, // 19: google.storage.v2.ReadObjectResponse.metadata:type_name -> google.storage.v2.Object - 42, // 20: google.storage.v2.BidiReadObjectSpec.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 76, // 21: google.storage.v2.BidiReadObjectSpec.read_mask:type_name -> google.protobuf.FieldMask - 25, // 22: google.storage.v2.BidiReadObjectSpec.read_handle:type_name -> google.storage.v2.BidiReadHandle - 16, // 23: google.storage.v2.BidiReadObjectRequest.read_object_spec:type_name -> google.storage.v2.BidiReadObjectSpec - 23, // 24: google.storage.v2.BidiReadObjectRequest.read_ranges:type_name -> google.storage.v2.ReadRange - 24, // 25: google.storage.v2.BidiReadObjectResponse.object_data_ranges:type_name -> google.storage.v2.ObjectRangeData - 49, // 26: google.storage.v2.BidiReadObjectResponse.metadata:type_name -> google.storage.v2.Object - 25, // 27: google.storage.v2.BidiReadObjectResponse.read_handle:type_name -> google.storage.v2.BidiReadHandle - 25, // 28: google.storage.v2.BidiReadObjectRedirectedError.read_handle:type_name -> google.storage.v2.BidiReadHandle - 26, // 29: google.storage.v2.BidiWriteObjectRedirectedError.write_handle:type_name -> google.storage.v2.BidiWriteHandle - 22, // 30: google.storage.v2.BidiReadObjectError.read_range_errors:type_name -> google.storage.v2.ReadRangeError - 77, // 31: google.storage.v2.ReadRangeError.status:type_name -> google.rpc.Status - 46, // 32: google.storage.v2.ObjectRangeData.checksummed_data:type_name -> google.storage.v2.ChecksummedData - 23, // 33: google.storage.v2.ObjectRangeData.read_range:type_name -> google.storage.v2.ReadRange - 49, // 34: google.storage.v2.WriteObjectSpec.resource:type_name -> google.storage.v2.Object - 27, // 35: google.storage.v2.WriteObjectRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec - 46, // 36: google.storage.v2.WriteObjectRequest.checksummed_data:type_name -> google.storage.v2.ChecksummedData - 47, // 37: google.storage.v2.WriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 42, // 38: google.storage.v2.WriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 49, // 39: google.storage.v2.WriteObjectResponse.resource:type_name -> google.storage.v2.Object - 26, // 40: google.storage.v2.AppendObjectSpec.write_handle:type_name -> google.storage.v2.BidiWriteHandle - 27, // 41: google.storage.v2.BidiWriteObjectRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec - 30, // 42: google.storage.v2.BidiWriteObjectRequest.append_object_spec:type_name -> google.storage.v2.AppendObjectSpec - 46, // 43: google.storage.v2.BidiWriteObjectRequest.checksummed_data:type_name -> google.storage.v2.ChecksummedData - 47, // 44: google.storage.v2.BidiWriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 42, // 45: google.storage.v2.BidiWriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 49, // 46: google.storage.v2.BidiWriteObjectResponse.resource:type_name -> google.storage.v2.Object - 26, // 47: google.storage.v2.BidiWriteObjectResponse.write_handle:type_name -> google.storage.v2.BidiWriteHandle - 76, // 48: google.storage.v2.ListObjectsRequest.read_mask:type_name -> google.protobuf.FieldMask - 42, // 49: google.storage.v2.QueryWriteStatusRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 49, // 50: google.storage.v2.QueryWriteStatusResponse.resource:type_name -> google.storage.v2.Object - 49, // 51: google.storage.v2.RewriteObjectRequest.destination:type_name -> google.storage.v2.Object - 42, // 52: google.storage.v2.RewriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 47, // 53: google.storage.v2.RewriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 49, // 54: google.storage.v2.RewriteResponse.resource:type_name -> google.storage.v2.Object - 27, // 55: google.storage.v2.StartResumableWriteRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec - 42, // 56: google.storage.v2.StartResumableWriteRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 47, // 57: google.storage.v2.StartResumableWriteRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums - 49, // 58: google.storage.v2.UpdateObjectRequest.object:type_name -> google.storage.v2.Object - 76, // 59: google.storage.v2.UpdateObjectRequest.update_mask:type_name -> google.protobuf.FieldMask - 42, // 60: google.storage.v2.UpdateObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams - 45, // 61: google.storage.v2.Bucket.acl:type_name -> google.storage.v2.BucketAccessControl - 50, // 62: google.storage.v2.Bucket.default_object_acl:type_name -> google.storage.v2.ObjectAccessControl - 61, // 63: google.storage.v2.Bucket.lifecycle:type_name -> google.storage.v2.Bucket.Lifecycle - 78, // 64: google.storage.v2.Bucket.create_time:type_name -> google.protobuf.Timestamp - 58, // 65: google.storage.v2.Bucket.cors:type_name -> google.storage.v2.Bucket.Cors - 78, // 66: google.storage.v2.Bucket.update_time:type_name -> google.protobuf.Timestamp - 70, // 67: google.storage.v2.Bucket.labels:type_name -> google.storage.v2.Bucket.LabelsEntry - 66, // 68: google.storage.v2.Bucket.website:type_name -> google.storage.v2.Bucket.Website - 65, // 69: google.storage.v2.Bucket.versioning:type_name -> google.storage.v2.Bucket.Versioning - 62, // 70: google.storage.v2.Bucket.logging:type_name -> google.storage.v2.Bucket.Logging - 53, // 71: google.storage.v2.Bucket.owner:type_name -> google.storage.v2.Owner - 59, // 72: google.storage.v2.Bucket.encryption:type_name -> google.storage.v2.Bucket.Encryption - 57, // 73: google.storage.v2.Bucket.billing:type_name -> google.storage.v2.Bucket.Billing - 63, // 74: google.storage.v2.Bucket.retention_policy:type_name -> google.storage.v2.Bucket.RetentionPolicy - 60, // 75: google.storage.v2.Bucket.iam_config:type_name -> google.storage.v2.Bucket.IamConfig - 67, // 76: google.storage.v2.Bucket.custom_placement_config:type_name -> google.storage.v2.Bucket.CustomPlacementConfig - 68, // 77: google.storage.v2.Bucket.autoclass:type_name -> google.storage.v2.Bucket.Autoclass - 69, // 78: google.storage.v2.Bucket.hierarchical_namespace:type_name -> google.storage.v2.Bucket.HierarchicalNamespace - 64, // 79: google.storage.v2.Bucket.soft_delete_policy:type_name -> google.storage.v2.Bucket.SoftDeletePolicy - 52, // 80: google.storage.v2.BucketAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam - 50, // 81: google.storage.v2.Object.acl:type_name -> google.storage.v2.ObjectAccessControl - 78, // 82: google.storage.v2.Object.delete_time:type_name -> google.protobuf.Timestamp - 78, // 83: google.storage.v2.Object.finalize_time:type_name -> google.protobuf.Timestamp - 78, // 84: google.storage.v2.Object.create_time:type_name -> google.protobuf.Timestamp - 47, // 85: google.storage.v2.Object.checksums:type_name -> google.storage.v2.ObjectChecksums - 78, // 86: google.storage.v2.Object.update_time:type_name -> google.protobuf.Timestamp - 78, // 87: google.storage.v2.Object.update_storage_class_time:type_name -> google.protobuf.Timestamp - 78, // 88: google.storage.v2.Object.retention_expire_time:type_name -> google.protobuf.Timestamp - 75, // 89: google.storage.v2.Object.metadata:type_name -> google.storage.v2.Object.MetadataEntry - 53, // 90: google.storage.v2.Object.owner:type_name -> google.storage.v2.Owner - 48, // 91: google.storage.v2.Object.customer_encryption:type_name -> google.storage.v2.CustomerEncryption - 78, // 92: google.storage.v2.Object.custom_time:type_name -> google.protobuf.Timestamp - 78, // 93: google.storage.v2.Object.soft_delete_time:type_name -> google.protobuf.Timestamp - 78, // 94: google.storage.v2.Object.hard_delete_time:type_name -> google.protobuf.Timestamp - 52, // 95: google.storage.v2.ObjectAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam - 49, // 96: google.storage.v2.ListObjectsResponse.objects:type_name -> google.storage.v2.Object - 56, // 97: google.storage.v2.ComposeObjectRequest.SourceObject.object_preconditions:type_name -> google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions - 71, // 98: google.storage.v2.Bucket.IamConfig.uniform_bucket_level_access:type_name -> google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess - 72, // 99: google.storage.v2.Bucket.Lifecycle.rule:type_name -> google.storage.v2.Bucket.Lifecycle.Rule - 78, // 100: google.storage.v2.Bucket.RetentionPolicy.effective_time:type_name -> google.protobuf.Timestamp - 79, // 101: google.storage.v2.Bucket.RetentionPolicy.retention_duration:type_name -> google.protobuf.Duration - 79, // 102: google.storage.v2.Bucket.SoftDeletePolicy.retention_duration:type_name -> google.protobuf.Duration - 78, // 103: google.storage.v2.Bucket.SoftDeletePolicy.effective_time:type_name -> google.protobuf.Timestamp - 78, // 104: google.storage.v2.Bucket.Autoclass.toggle_time:type_name -> google.protobuf.Timestamp - 78, // 105: google.storage.v2.Bucket.Autoclass.terminal_storage_class_update_time:type_name -> google.protobuf.Timestamp - 78, // 106: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.lock_time:type_name -> google.protobuf.Timestamp - 73, // 107: google.storage.v2.Bucket.Lifecycle.Rule.action:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Action - 74, // 108: google.storage.v2.Bucket.Lifecycle.Rule.condition:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Condition - 80, // 109: google.storage.v2.Bucket.Lifecycle.Rule.Condition.created_before:type_name -> google.type.Date - 80, // 110: google.storage.v2.Bucket.Lifecycle.Rule.Condition.custom_time_before:type_name -> google.type.Date - 80, // 111: google.storage.v2.Bucket.Lifecycle.Rule.Condition.noncurrent_time_before:type_name -> google.type.Date - 1, // 112: google.storage.v2.Storage.DeleteBucket:input_type -> google.storage.v2.DeleteBucketRequest - 2, // 113: google.storage.v2.Storage.GetBucket:input_type -> google.storage.v2.GetBucketRequest - 3, // 114: google.storage.v2.Storage.CreateBucket:input_type -> google.storage.v2.CreateBucketRequest - 4, // 115: google.storage.v2.Storage.ListBuckets:input_type -> google.storage.v2.ListBucketsRequest - 6, // 116: google.storage.v2.Storage.LockBucketRetentionPolicy:input_type -> google.storage.v2.LockBucketRetentionPolicyRequest - 81, // 117: google.storage.v2.Storage.GetIamPolicy:input_type -> google.iam.v1.GetIamPolicyRequest - 82, // 118: google.storage.v2.Storage.SetIamPolicy:input_type -> google.iam.v1.SetIamPolicyRequest - 83, // 119: google.storage.v2.Storage.TestIamPermissions:input_type -> google.iam.v1.TestIamPermissionsRequest - 7, // 120: google.storage.v2.Storage.UpdateBucket:input_type -> google.storage.v2.UpdateBucketRequest - 8, // 121: google.storage.v2.Storage.ComposeObject:input_type -> google.storage.v2.ComposeObjectRequest - 9, // 122: google.storage.v2.Storage.DeleteObject:input_type -> google.storage.v2.DeleteObjectRequest - 10, // 123: google.storage.v2.Storage.RestoreObject:input_type -> google.storage.v2.RestoreObjectRequest - 11, // 124: google.storage.v2.Storage.CancelResumableWrite:input_type -> google.storage.v2.CancelResumableWriteRequest - 14, // 125: google.storage.v2.Storage.GetObject:input_type -> google.storage.v2.GetObjectRequest - 13, // 126: google.storage.v2.Storage.ReadObject:input_type -> google.storage.v2.ReadObjectRequest - 17, // 127: google.storage.v2.Storage.BidiReadObject:input_type -> google.storage.v2.BidiReadObjectRequest - 41, // 128: google.storage.v2.Storage.UpdateObject:input_type -> google.storage.v2.UpdateObjectRequest - 28, // 129: google.storage.v2.Storage.WriteObject:input_type -> google.storage.v2.WriteObjectRequest - 31, // 130: google.storage.v2.Storage.BidiWriteObject:input_type -> google.storage.v2.BidiWriteObjectRequest - 33, // 131: google.storage.v2.Storage.ListObjects:input_type -> google.storage.v2.ListObjectsRequest - 36, // 132: google.storage.v2.Storage.RewriteObject:input_type -> google.storage.v2.RewriteObjectRequest - 39, // 133: google.storage.v2.Storage.StartResumableWrite:input_type -> google.storage.v2.StartResumableWriteRequest - 34, // 134: google.storage.v2.Storage.QueryWriteStatus:input_type -> google.storage.v2.QueryWriteStatusRequest - 38, // 135: google.storage.v2.Storage.MoveObject:input_type -> google.storage.v2.MoveObjectRequest - 84, // 136: google.storage.v2.Storage.DeleteBucket:output_type -> google.protobuf.Empty - 44, // 137: google.storage.v2.Storage.GetBucket:output_type -> google.storage.v2.Bucket - 44, // 138: google.storage.v2.Storage.CreateBucket:output_type -> google.storage.v2.Bucket - 5, // 139: google.storage.v2.Storage.ListBuckets:output_type -> google.storage.v2.ListBucketsResponse - 44, // 140: google.storage.v2.Storage.LockBucketRetentionPolicy:output_type -> google.storage.v2.Bucket - 85, // 141: google.storage.v2.Storage.GetIamPolicy:output_type -> google.iam.v1.Policy - 85, // 142: google.storage.v2.Storage.SetIamPolicy:output_type -> google.iam.v1.Policy - 86, // 143: google.storage.v2.Storage.TestIamPermissions:output_type -> google.iam.v1.TestIamPermissionsResponse - 44, // 144: google.storage.v2.Storage.UpdateBucket:output_type -> google.storage.v2.Bucket - 49, // 145: google.storage.v2.Storage.ComposeObject:output_type -> google.storage.v2.Object - 84, // 146: google.storage.v2.Storage.DeleteObject:output_type -> google.protobuf.Empty - 49, // 147: google.storage.v2.Storage.RestoreObject:output_type -> google.storage.v2.Object - 12, // 148: google.storage.v2.Storage.CancelResumableWrite:output_type -> google.storage.v2.CancelResumableWriteResponse - 49, // 149: google.storage.v2.Storage.GetObject:output_type -> google.storage.v2.Object - 15, // 150: google.storage.v2.Storage.ReadObject:output_type -> google.storage.v2.ReadObjectResponse - 18, // 151: google.storage.v2.Storage.BidiReadObject:output_type -> google.storage.v2.BidiReadObjectResponse - 49, // 152: google.storage.v2.Storage.UpdateObject:output_type -> google.storage.v2.Object - 29, // 153: google.storage.v2.Storage.WriteObject:output_type -> google.storage.v2.WriteObjectResponse - 32, // 154: google.storage.v2.Storage.BidiWriteObject:output_type -> google.storage.v2.BidiWriteObjectResponse - 51, // 155: google.storage.v2.Storage.ListObjects:output_type -> google.storage.v2.ListObjectsResponse - 37, // 156: google.storage.v2.Storage.RewriteObject:output_type -> google.storage.v2.RewriteResponse - 40, // 157: google.storage.v2.Storage.StartResumableWrite:output_type -> google.storage.v2.StartResumableWriteResponse - 35, // 158: google.storage.v2.Storage.QueryWriteStatus:output_type -> google.storage.v2.QueryWriteStatusResponse - 49, // 159: google.storage.v2.Storage.MoveObject:output_type -> google.storage.v2.Object - 136, // [136:160] is the sub-list for method output_type - 112, // [112:136] is the sub-list for method input_type - 112, // [112:112] is the sub-list for extension type_name - 112, // [112:112] is the sub-list for extension extendee - 0, // [0:112] is the sub-list for field type_name + 88, // 0: google.storage.v2.GetBucketRequest.read_mask:type_name -> google.protobuf.FieldMask + 45, // 1: google.storage.v2.CreateBucketRequest.bucket:type_name -> google.storage.v2.Bucket + 88, // 2: google.storage.v2.ListBucketsRequest.read_mask:type_name -> google.protobuf.FieldMask + 45, // 3: google.storage.v2.ListBucketsResponse.buckets:type_name -> google.storage.v2.Bucket + 45, // 4: google.storage.v2.UpdateBucketRequest.bucket:type_name -> google.storage.v2.Bucket + 88, // 5: google.storage.v2.UpdateBucketRequest.update_mask:type_name -> google.protobuf.FieldMask + 52, // 6: google.storage.v2.ComposeObjectRequest.destination:type_name -> google.storage.v2.Object + 58, // 7: google.storage.v2.ComposeObjectRequest.source_objects:type_name -> google.storage.v2.ComposeObjectRequest.SourceObject + 43, // 8: google.storage.v2.ComposeObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 48, // 9: google.storage.v2.ComposeObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 43, // 10: google.storage.v2.DeleteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 43, // 11: google.storage.v2.RestoreObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 43, // 12: google.storage.v2.ReadObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 88, // 13: google.storage.v2.ReadObjectRequest.read_mask:type_name -> google.protobuf.FieldMask + 43, // 14: google.storage.v2.GetObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 88, // 15: google.storage.v2.GetObjectRequest.read_mask:type_name -> google.protobuf.FieldMask + 47, // 16: google.storage.v2.ReadObjectResponse.checksummed_data:type_name -> google.storage.v2.ChecksummedData + 48, // 17: google.storage.v2.ReadObjectResponse.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 57, // 18: google.storage.v2.ReadObjectResponse.content_range:type_name -> google.storage.v2.ContentRange + 52, // 19: google.storage.v2.ReadObjectResponse.metadata:type_name -> google.storage.v2.Object + 43, // 20: google.storage.v2.BidiReadObjectSpec.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 88, // 21: google.storage.v2.BidiReadObjectSpec.read_mask:type_name -> google.protobuf.FieldMask + 26, // 22: google.storage.v2.BidiReadObjectSpec.read_handle:type_name -> google.storage.v2.BidiReadHandle + 17, // 23: google.storage.v2.BidiReadObjectRequest.read_object_spec:type_name -> google.storage.v2.BidiReadObjectSpec + 24, // 24: google.storage.v2.BidiReadObjectRequest.read_ranges:type_name -> google.storage.v2.ReadRange + 25, // 25: google.storage.v2.BidiReadObjectResponse.object_data_ranges:type_name -> google.storage.v2.ObjectRangeData + 52, // 26: google.storage.v2.BidiReadObjectResponse.metadata:type_name -> google.storage.v2.Object + 26, // 27: google.storage.v2.BidiReadObjectResponse.read_handle:type_name -> google.storage.v2.BidiReadHandle + 26, // 28: google.storage.v2.BidiReadObjectRedirectedError.read_handle:type_name -> google.storage.v2.BidiReadHandle + 27, // 29: google.storage.v2.BidiWriteObjectRedirectedError.write_handle:type_name -> google.storage.v2.BidiWriteHandle + 23, // 30: google.storage.v2.BidiReadObjectError.read_range_errors:type_name -> google.storage.v2.ReadRangeError + 89, // 31: google.storage.v2.ReadRangeError.status:type_name -> google.rpc.Status + 47, // 32: google.storage.v2.ObjectRangeData.checksummed_data:type_name -> google.storage.v2.ChecksummedData + 24, // 33: google.storage.v2.ObjectRangeData.read_range:type_name -> google.storage.v2.ReadRange + 52, // 34: google.storage.v2.WriteObjectSpec.resource:type_name -> google.storage.v2.Object + 28, // 35: google.storage.v2.WriteObjectRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec + 47, // 36: google.storage.v2.WriteObjectRequest.checksummed_data:type_name -> google.storage.v2.ChecksummedData + 48, // 37: google.storage.v2.WriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 43, // 38: google.storage.v2.WriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 52, // 39: google.storage.v2.WriteObjectResponse.resource:type_name -> google.storage.v2.Object + 27, // 40: google.storage.v2.AppendObjectSpec.write_handle:type_name -> google.storage.v2.BidiWriteHandle + 28, // 41: google.storage.v2.BidiWriteObjectRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec + 31, // 42: google.storage.v2.BidiWriteObjectRequest.append_object_spec:type_name -> google.storage.v2.AppendObjectSpec + 47, // 43: google.storage.v2.BidiWriteObjectRequest.checksummed_data:type_name -> google.storage.v2.ChecksummedData + 48, // 44: google.storage.v2.BidiWriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 43, // 45: google.storage.v2.BidiWriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 52, // 46: google.storage.v2.BidiWriteObjectResponse.resource:type_name -> google.storage.v2.Object + 27, // 47: google.storage.v2.BidiWriteObjectResponse.write_handle:type_name -> google.storage.v2.BidiWriteHandle + 88, // 48: google.storage.v2.ListObjectsRequest.read_mask:type_name -> google.protobuf.FieldMask + 43, // 49: google.storage.v2.QueryWriteStatusRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 52, // 50: google.storage.v2.QueryWriteStatusResponse.resource:type_name -> google.storage.v2.Object + 52, // 51: google.storage.v2.RewriteObjectRequest.destination:type_name -> google.storage.v2.Object + 43, // 52: google.storage.v2.RewriteObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 48, // 53: google.storage.v2.RewriteObjectRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 52, // 54: google.storage.v2.RewriteResponse.resource:type_name -> google.storage.v2.Object + 28, // 55: google.storage.v2.StartResumableWriteRequest.write_object_spec:type_name -> google.storage.v2.WriteObjectSpec + 43, // 56: google.storage.v2.StartResumableWriteRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 48, // 57: google.storage.v2.StartResumableWriteRequest.object_checksums:type_name -> google.storage.v2.ObjectChecksums + 52, // 58: google.storage.v2.UpdateObjectRequest.object:type_name -> google.storage.v2.Object + 88, // 59: google.storage.v2.UpdateObjectRequest.update_mask:type_name -> google.protobuf.FieldMask + 43, // 60: google.storage.v2.UpdateObjectRequest.common_object_request_params:type_name -> google.storage.v2.CommonObjectRequestParams + 46, // 61: google.storage.v2.Bucket.acl:type_name -> google.storage.v2.BucketAccessControl + 53, // 62: google.storage.v2.Bucket.default_object_acl:type_name -> google.storage.v2.ObjectAccessControl + 64, // 63: google.storage.v2.Bucket.lifecycle:type_name -> google.storage.v2.Bucket.Lifecycle + 90, // 64: google.storage.v2.Bucket.create_time:type_name -> google.protobuf.Timestamp + 61, // 65: google.storage.v2.Bucket.cors:type_name -> google.storage.v2.Bucket.Cors + 90, // 66: google.storage.v2.Bucket.update_time:type_name -> google.protobuf.Timestamp + 75, // 67: google.storage.v2.Bucket.labels:type_name -> google.storage.v2.Bucket.LabelsEntry + 70, // 68: google.storage.v2.Bucket.website:type_name -> google.storage.v2.Bucket.Website + 69, // 69: google.storage.v2.Bucket.versioning:type_name -> google.storage.v2.Bucket.Versioning + 65, // 70: google.storage.v2.Bucket.logging:type_name -> google.storage.v2.Bucket.Logging + 56, // 71: google.storage.v2.Bucket.owner:type_name -> google.storage.v2.Owner + 62, // 72: google.storage.v2.Bucket.encryption:type_name -> google.storage.v2.Bucket.Encryption + 60, // 73: google.storage.v2.Bucket.billing:type_name -> google.storage.v2.Bucket.Billing + 67, // 74: google.storage.v2.Bucket.retention_policy:type_name -> google.storage.v2.Bucket.RetentionPolicy + 63, // 75: google.storage.v2.Bucket.iam_config:type_name -> google.storage.v2.Bucket.IamConfig + 71, // 76: google.storage.v2.Bucket.custom_placement_config:type_name -> google.storage.v2.Bucket.CustomPlacementConfig + 72, // 77: google.storage.v2.Bucket.autoclass:type_name -> google.storage.v2.Bucket.Autoclass + 74, // 78: google.storage.v2.Bucket.hierarchical_namespace:type_name -> google.storage.v2.Bucket.HierarchicalNamespace + 68, // 79: google.storage.v2.Bucket.soft_delete_policy:type_name -> google.storage.v2.Bucket.SoftDeletePolicy + 66, // 80: google.storage.v2.Bucket.object_retention:type_name -> google.storage.v2.Bucket.ObjectRetention + 73, // 81: google.storage.v2.Bucket.ip_filter:type_name -> google.storage.v2.Bucket.IpFilter + 55, // 82: google.storage.v2.BucketAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam + 90, // 83: google.storage.v2.ObjectCustomContextPayload.create_time:type_name -> google.protobuf.Timestamp + 90, // 84: google.storage.v2.ObjectCustomContextPayload.update_time:type_name -> google.protobuf.Timestamp + 85, // 85: google.storage.v2.ObjectContexts.custom:type_name -> google.storage.v2.ObjectContexts.CustomEntry + 53, // 86: google.storage.v2.Object.acl:type_name -> google.storage.v2.ObjectAccessControl + 90, // 87: google.storage.v2.Object.delete_time:type_name -> google.protobuf.Timestamp + 90, // 88: google.storage.v2.Object.finalize_time:type_name -> google.protobuf.Timestamp + 90, // 89: google.storage.v2.Object.create_time:type_name -> google.protobuf.Timestamp + 48, // 90: google.storage.v2.Object.checksums:type_name -> google.storage.v2.ObjectChecksums + 90, // 91: google.storage.v2.Object.update_time:type_name -> google.protobuf.Timestamp + 90, // 92: google.storage.v2.Object.update_storage_class_time:type_name -> google.protobuf.Timestamp + 90, // 93: google.storage.v2.Object.retention_expire_time:type_name -> google.protobuf.Timestamp + 87, // 94: google.storage.v2.Object.metadata:type_name -> google.storage.v2.Object.MetadataEntry + 50, // 95: google.storage.v2.Object.contexts:type_name -> google.storage.v2.ObjectContexts + 56, // 96: google.storage.v2.Object.owner:type_name -> google.storage.v2.Owner + 51, // 97: google.storage.v2.Object.customer_encryption:type_name -> google.storage.v2.CustomerEncryption + 90, // 98: google.storage.v2.Object.custom_time:type_name -> google.protobuf.Timestamp + 90, // 99: google.storage.v2.Object.soft_delete_time:type_name -> google.protobuf.Timestamp + 90, // 100: google.storage.v2.Object.hard_delete_time:type_name -> google.protobuf.Timestamp + 86, // 101: google.storage.v2.Object.retention:type_name -> google.storage.v2.Object.Retention + 55, // 102: google.storage.v2.ObjectAccessControl.project_team:type_name -> google.storage.v2.ProjectTeam + 52, // 103: google.storage.v2.ListObjectsResponse.objects:type_name -> google.storage.v2.Object + 59, // 104: google.storage.v2.ComposeObjectRequest.SourceObject.object_preconditions:type_name -> google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions + 76, // 105: google.storage.v2.Bucket.Encryption.google_managed_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig + 77, // 106: google.storage.v2.Bucket.Encryption.customer_managed_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig + 78, // 107: google.storage.v2.Bucket.Encryption.customer_supplied_encryption_enforcement_config:type_name -> google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig + 79, // 108: google.storage.v2.Bucket.IamConfig.uniform_bucket_level_access:type_name -> google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess + 80, // 109: google.storage.v2.Bucket.Lifecycle.rule:type_name -> google.storage.v2.Bucket.Lifecycle.Rule + 90, // 110: google.storage.v2.Bucket.RetentionPolicy.effective_time:type_name -> google.protobuf.Timestamp + 91, // 111: google.storage.v2.Bucket.RetentionPolicy.retention_duration:type_name -> google.protobuf.Duration + 91, // 112: google.storage.v2.Bucket.SoftDeletePolicy.retention_duration:type_name -> google.protobuf.Duration + 90, // 113: google.storage.v2.Bucket.SoftDeletePolicy.effective_time:type_name -> google.protobuf.Timestamp + 90, // 114: google.storage.v2.Bucket.Autoclass.toggle_time:type_name -> google.protobuf.Timestamp + 90, // 115: google.storage.v2.Bucket.Autoclass.terminal_storage_class_update_time:type_name -> google.protobuf.Timestamp + 83, // 116: google.storage.v2.Bucket.IpFilter.public_network_source:type_name -> google.storage.v2.Bucket.IpFilter.PublicNetworkSource + 84, // 117: google.storage.v2.Bucket.IpFilter.vpc_network_sources:type_name -> google.storage.v2.Bucket.IpFilter.VpcNetworkSource + 90, // 118: google.storage.v2.Bucket.Encryption.GoogleManagedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp + 90, // 119: google.storage.v2.Bucket.Encryption.CustomerManagedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp + 90, // 120: google.storage.v2.Bucket.Encryption.CustomerSuppliedEncryptionEnforcementConfig.effective_time:type_name -> google.protobuf.Timestamp + 90, // 121: google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess.lock_time:type_name -> google.protobuf.Timestamp + 81, // 122: google.storage.v2.Bucket.Lifecycle.Rule.action:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Action + 82, // 123: google.storage.v2.Bucket.Lifecycle.Rule.condition:type_name -> google.storage.v2.Bucket.Lifecycle.Rule.Condition + 92, // 124: google.storage.v2.Bucket.Lifecycle.Rule.Condition.created_before:type_name -> google.type.Date + 92, // 125: google.storage.v2.Bucket.Lifecycle.Rule.Condition.custom_time_before:type_name -> google.type.Date + 92, // 126: google.storage.v2.Bucket.Lifecycle.Rule.Condition.noncurrent_time_before:type_name -> google.type.Date + 49, // 127: google.storage.v2.ObjectContexts.CustomEntry.value:type_name -> google.storage.v2.ObjectCustomContextPayload + 1, // 128: google.storage.v2.Object.Retention.mode:type_name -> google.storage.v2.Object.Retention.Mode + 90, // 129: google.storage.v2.Object.Retention.retain_until_time:type_name -> google.protobuf.Timestamp + 2, // 130: google.storage.v2.Storage.DeleteBucket:input_type -> google.storage.v2.DeleteBucketRequest + 3, // 131: google.storage.v2.Storage.GetBucket:input_type -> google.storage.v2.GetBucketRequest + 4, // 132: google.storage.v2.Storage.CreateBucket:input_type -> google.storage.v2.CreateBucketRequest + 5, // 133: google.storage.v2.Storage.ListBuckets:input_type -> google.storage.v2.ListBucketsRequest + 7, // 134: google.storage.v2.Storage.LockBucketRetentionPolicy:input_type -> google.storage.v2.LockBucketRetentionPolicyRequest + 93, // 135: google.storage.v2.Storage.GetIamPolicy:input_type -> google.iam.v1.GetIamPolicyRequest + 94, // 136: google.storage.v2.Storage.SetIamPolicy:input_type -> google.iam.v1.SetIamPolicyRequest + 95, // 137: google.storage.v2.Storage.TestIamPermissions:input_type -> google.iam.v1.TestIamPermissionsRequest + 8, // 138: google.storage.v2.Storage.UpdateBucket:input_type -> google.storage.v2.UpdateBucketRequest + 9, // 139: google.storage.v2.Storage.ComposeObject:input_type -> google.storage.v2.ComposeObjectRequest + 10, // 140: google.storage.v2.Storage.DeleteObject:input_type -> google.storage.v2.DeleteObjectRequest + 11, // 141: google.storage.v2.Storage.RestoreObject:input_type -> google.storage.v2.RestoreObjectRequest + 12, // 142: google.storage.v2.Storage.CancelResumableWrite:input_type -> google.storage.v2.CancelResumableWriteRequest + 15, // 143: google.storage.v2.Storage.GetObject:input_type -> google.storage.v2.GetObjectRequest + 14, // 144: google.storage.v2.Storage.ReadObject:input_type -> google.storage.v2.ReadObjectRequest + 18, // 145: google.storage.v2.Storage.BidiReadObject:input_type -> google.storage.v2.BidiReadObjectRequest + 42, // 146: google.storage.v2.Storage.UpdateObject:input_type -> google.storage.v2.UpdateObjectRequest + 29, // 147: google.storage.v2.Storage.WriteObject:input_type -> google.storage.v2.WriteObjectRequest + 32, // 148: google.storage.v2.Storage.BidiWriteObject:input_type -> google.storage.v2.BidiWriteObjectRequest + 34, // 149: google.storage.v2.Storage.ListObjects:input_type -> google.storage.v2.ListObjectsRequest + 37, // 150: google.storage.v2.Storage.RewriteObject:input_type -> google.storage.v2.RewriteObjectRequest + 40, // 151: google.storage.v2.Storage.StartResumableWrite:input_type -> google.storage.v2.StartResumableWriteRequest + 35, // 152: google.storage.v2.Storage.QueryWriteStatus:input_type -> google.storage.v2.QueryWriteStatusRequest + 39, // 153: google.storage.v2.Storage.MoveObject:input_type -> google.storage.v2.MoveObjectRequest + 96, // 154: google.storage.v2.Storage.DeleteBucket:output_type -> google.protobuf.Empty + 45, // 155: google.storage.v2.Storage.GetBucket:output_type -> google.storage.v2.Bucket + 45, // 156: google.storage.v2.Storage.CreateBucket:output_type -> google.storage.v2.Bucket + 6, // 157: google.storage.v2.Storage.ListBuckets:output_type -> google.storage.v2.ListBucketsResponse + 45, // 158: google.storage.v2.Storage.LockBucketRetentionPolicy:output_type -> google.storage.v2.Bucket + 97, // 159: google.storage.v2.Storage.GetIamPolicy:output_type -> google.iam.v1.Policy + 97, // 160: google.storage.v2.Storage.SetIamPolicy:output_type -> google.iam.v1.Policy + 98, // 161: google.storage.v2.Storage.TestIamPermissions:output_type -> google.iam.v1.TestIamPermissionsResponse + 45, // 162: google.storage.v2.Storage.UpdateBucket:output_type -> google.storage.v2.Bucket + 52, // 163: google.storage.v2.Storage.ComposeObject:output_type -> google.storage.v2.Object + 96, // 164: google.storage.v2.Storage.DeleteObject:output_type -> google.protobuf.Empty + 52, // 165: google.storage.v2.Storage.RestoreObject:output_type -> google.storage.v2.Object + 13, // 166: google.storage.v2.Storage.CancelResumableWrite:output_type -> google.storage.v2.CancelResumableWriteResponse + 52, // 167: google.storage.v2.Storage.GetObject:output_type -> google.storage.v2.Object + 16, // 168: google.storage.v2.Storage.ReadObject:output_type -> google.storage.v2.ReadObjectResponse + 19, // 169: google.storage.v2.Storage.BidiReadObject:output_type -> google.storage.v2.BidiReadObjectResponse + 52, // 170: google.storage.v2.Storage.UpdateObject:output_type -> google.storage.v2.Object + 30, // 171: google.storage.v2.Storage.WriteObject:output_type -> google.storage.v2.WriteObjectResponse + 33, // 172: google.storage.v2.Storage.BidiWriteObject:output_type -> google.storage.v2.BidiWriteObjectResponse + 54, // 173: google.storage.v2.Storage.ListObjects:output_type -> google.storage.v2.ListObjectsResponse + 38, // 174: google.storage.v2.Storage.RewriteObject:output_type -> google.storage.v2.RewriteResponse + 41, // 175: google.storage.v2.Storage.StartResumableWrite:output_type -> google.storage.v2.StartResumableWriteResponse + 36, // 176: google.storage.v2.Storage.QueryWriteStatus:output_type -> google.storage.v2.QueryWriteStatusResponse + 52, // 177: google.storage.v2.Storage.MoveObject:output_type -> google.storage.v2.Object + 154, // [154:178] is the sub-list for method output_type + 130, // [130:154] is the sub-list for method input_type + 130, // [130:130] is the sub-list for extension type_name + 130, // [130:130] is the sub-list for extension extendee + 0, // [0:130] is the sub-list for field type_name } func init() { file_google_storage_v2_storage_proto_init() } @@ -9233,20 +10318,27 @@ func file_google_storage_v2_storage_proto_init() { file_google_storage_v2_storage_proto_msgTypes[35].OneofWrappers = []any{} file_google_storage_v2_storage_proto_msgTypes[37].OneofWrappers = []any{} file_google_storage_v2_storage_proto_msgTypes[40].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[43].OneofWrappers = []any{} file_google_storage_v2_storage_proto_msgTypes[45].OneofWrappers = []any{} file_google_storage_v2_storage_proto_msgTypes[46].OneofWrappers = []any{} - file_google_storage_v2_storage_proto_msgTypes[48].OneofWrappers = []any{} - file_google_storage_v2_storage_proto_msgTypes[55].OneofWrappers = []any{} - file_google_storage_v2_storage_proto_msgTypes[63].OneofWrappers = []any{} - file_google_storage_v2_storage_proto_msgTypes[67].OneofWrappers = []any{} - file_google_storage_v2_storage_proto_msgTypes[73].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[50].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[57].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[60].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[66].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[70].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[71].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[74].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[75].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[76].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[80].OneofWrappers = []any{} + file_google_storage_v2_storage_proto_msgTypes[82].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_storage_v2_storage_proto_rawDesc, - NumEnums: 1, - NumMessages: 75, + NumEnums: 2, + NumMessages: 86, NumExtensions: 0, NumServices: 1, }, @@ -9285,11 +10377,15 @@ type StorageClient interface { LockBucketRetentionPolicy(ctx context.Context, in *LockBucketRetentionPolicyRequest, opts ...grpc.CallOption) (*Bucket, error) // Gets the IAM policy for a specified bucket. // The `resource` field in the request should be - // `projects/_/buckets/{bucket}`. + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. GetIamPolicy(ctx context.Context, in *iampb.GetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) // Updates an IAM policy for the specified bucket. // The `resource` field in the request should be - // `projects/_/buckets/{bucket}`. + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. SetIamPolicy(ctx context.Context, in *iampb.SetIamPolicyRequest, opts ...grpc.CallOption) (*iampb.Policy, error) // Tests a set of permissions on the given bucket, object, or managed folder // to see which, if any, are held by the caller. @@ -9836,11 +10932,15 @@ type StorageServer interface { LockBucketRetentionPolicy(context.Context, *LockBucketRetentionPolicyRequest) (*Bucket, error) // Gets the IAM policy for a specified bucket. // The `resource` field in the request should be - // `projects/_/buckets/{bucket}`. + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. GetIamPolicy(context.Context, *iampb.GetIamPolicyRequest) (*iampb.Policy, error) // Updates an IAM policy for the specified bucket. // The `resource` field in the request should be - // `projects/_/buckets/{bucket}`. + // `projects/_/buckets/{bucket}` for a bucket, or + // `projects/_/buckets/{bucket}/managedFolders/{managedFolder}` + // for a managed folder. SetIamPolicy(context.Context, *iampb.SetIamPolicyRequest) (*iampb.Policy, error) // Tests a set of permissions on the given bucket, object, or managed folder // to see which, if any, are held by the caller. diff --git a/vendor/cloud.google.com/go/storage/internal/experimental.go b/vendor/cloud.google.com/go/storage/internal/experimental.go index 2fd5111fb30..4482eab8a34 100644 --- a/vendor/cloud.google.com/go/storage/internal/experimental.go +++ b/vendor/cloud.google.com/go/storage/internal/experimental.go @@ -33,4 +33,9 @@ var ( // WithGRPCBidiReads is a function which is implemented by the storage package. // It sets the gRPC client to use the BidiReadObject API for downloads. WithGRPCBidiReads any // func() option.ClientOption + + // WithZonalBucketAPIs is a function which is implemented by the storage package. + // It sets the gRPC client to use the BidiReadObject API for downloads and + // appendable object semantics by default for uploads. + WithZonalBucketAPIs any // func() option.ClientOption ) diff --git a/vendor/cloud.google.com/go/storage/internal/version.go b/vendor/cloud.google.com/go/storage/internal/version.go index ba56cacd8ed..f801fb63b98 100644 --- a/vendor/cloud.google.com/go/storage/internal/version.go +++ b/vendor/cloud.google.com/go/storage/internal/version.go @@ -15,4 +15,4 @@ package internal // Version is the current tagged release of the library. -const Version = "1.50.0" +const Version = "1.56.0" diff --git a/vendor/cloud.google.com/go/storage/invoke.go b/vendor/cloud.google.com/go/storage/invoke.go index 99783f3df47..7d0a45c7d79 100644 --- a/vendor/cloud.google.com/go/storage/invoke.go +++ b/vendor/cloud.google.com/go/storage/invoke.go @@ -21,7 +21,10 @@ import ( "io" "net" "net/url" + "os" "strings" + "sync" + "time" "cloud.google.com/go/internal" "cloud.google.com/go/internal/version" @@ -38,10 +41,25 @@ var defaultRetry *retryConfig = &retryConfig{} var xGoogDefaultHeader = fmt.Sprintf("gl-go/%s gccl/%s", version.Go(), sinternal.Version) const ( - xGoogHeaderKey = "x-goog-api-client" - idempotencyHeaderKey = "x-goog-gcs-idempotency-token" + xGoogHeaderKey = "x-goog-api-client" + idempotencyHeaderKey = "x-goog-gcs-idempotency-token" + cookieHeaderKey = "cookie" + directpathCookieHeaderKey = "x-directpath-tracing-cookie" ) +var ( + cookieHeader = sync.OnceValue(func() string { + return os.Getenv("GOOGLE_SDK_GO_TRACING_COOKIE") + }) +) + +func (r *retryConfig) runShouldRetry(err error) bool { + if r == nil || r.shouldRetry == nil { + return ShouldRetry(err) + } + return r.shouldRetry(err) +} + // run determines whether a retry is necessary based on the config and // idempotency information. It then calls the function with or without retries // as appropriate, using the configured settings. @@ -62,19 +80,33 @@ func run(ctx context.Context, call func(ctx context.Context) error, retry *retry bo.Initial = retry.backoff.Initial bo.Max = retry.backoff.Max } - var errorFunc func(err error) bool = ShouldRetry - if retry.shouldRetry != nil { - errorFunc = retry.shouldRetry + + var quitAfterTimer *time.Timer + if retry.maxRetryDuration != 0 { + quitAfterTimer = time.NewTimer(retry.maxRetryDuration) + defer quitAfterTimer.Stop() } + var lastErr error return internal.Retry(ctx, bo, func() (stop bool, err error) { + if retry.maxRetryDuration != 0 { + select { + case <-quitAfterTimer.C: + if lastErr == nil { + return true, fmt.Errorf("storage: request not sent, choose a larger value for the retry deadline (currently set to %s)", retry.maxRetryDuration) + } + return true, fmt.Errorf("storage: retry deadline of %s reached after %v attempts; last error: %w", retry.maxRetryDuration, attempts, lastErr) + default: + } + } + ctxWithHeaders := setInvocationHeaders(ctx, invocationID, attempts) - err = call(ctxWithHeaders) - if err != nil && retry.maxAttempts != nil && attempts >= *retry.maxAttempts { - return true, fmt.Errorf("storage: retry failed after %v attempts; last error: %w", *retry.maxAttempts, err) + lastErr = call(ctxWithHeaders) + if lastErr != nil && retry.maxAttempts != nil && attempts >= *retry.maxAttempts { + return true, fmt.Errorf("storage: retry failed after %v attempts; last error: %w", *retry.maxAttempts, lastErr) } attempts++ - retryable := errorFunc(err) + retryable := retry.runShouldRetry(lastErr) // Explicitly check context cancellation so that we can distinguish between a // DEADLINE_EXCEEDED error from the server and a user-set context deadline. // Unfortunately gRPC will codes.DeadlineExceeded (which may be retryable if it's @@ -82,7 +114,7 @@ func run(ctx context.Context, call func(ctx context.Context) error, retry *retry if ctxErr := ctx.Err(); errors.Is(ctxErr, context.Canceled) || errors.Is(ctxErr, context.DeadlineExceeded) { retryable = false } - return !retryable, err + return !retryable, lastErr }) } @@ -94,6 +126,12 @@ func setInvocationHeaders(ctx context.Context, invocationID string, attempts int ctx = callctx.SetHeaders(ctx, xGoogHeaderKey, xGoogHeader) ctx = callctx.SetHeaders(ctx, idempotencyHeaderKey, invocationID) + + if c := cookieHeader(); c != "" { + ctx = callctx.SetHeaders(ctx, cookieHeaderKey, c) + ctx = callctx.SetHeaders(ctx, directpathCookieHeaderKey, c) + } + return ctx } @@ -132,6 +170,15 @@ func ShouldRetry(err error) bool { return true } } + // TODO: remove when https://github.com/golang/go/issues/53472 is resolved. + // We don't want to retry io.EOF errors, since these can indicate normal + // functioning terminations such as internally in the case of Reader and + // externally in the case of iterator methods. However, the linked bug + // requires us to retry the EOFs that it causes, which should be wrapped + // in net or url errors. + if errors.Is(err, io.EOF) { + return true + } case *net.DNSError: if e.IsTemporary { return true diff --git a/vendor/cloud.google.com/go/storage/notifications.go b/vendor/cloud.google.com/go/storage/notifications.go index bc15900f01e..3b1df8afb54 100644 --- a/vendor/cloud.google.com/go/storage/notifications.go +++ b/vendor/cloud.google.com/go/storage/notifications.go @@ -20,7 +20,6 @@ import ( "fmt" "regexp" - "cloud.google.com/go/internal/trace" raw "google.golang.org/api/storage/v1" ) @@ -121,8 +120,8 @@ func toRawNotification(n *Notification) *raw.Notification { // returned Notification's ID can be used to refer to it. // Note: gRPC is not supported. func (b *BucketHandle) AddNotification(ctx context.Context, n *Notification) (ret *Notification, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.AddNotification") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.AddNotification") + defer func() { endSpan(ctx, err) }() if n.ID != "" { return nil, errors.New("storage: AddNotification: ID must not be set") @@ -143,8 +142,8 @@ func (b *BucketHandle) AddNotification(ctx context.Context, n *Notification) (re // indexed by notification ID. // Note: gRPC is not supported. func (b *BucketHandle) Notifications(ctx context.Context) (n map[string]*Notification, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.Notifications") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.Notifications") + defer func() { endSpan(ctx, err) }() opts := makeStorageOpts(true, b.retry, b.userProject) n, err = b.c.tc.ListNotifications(ctx, b.name, opts...) @@ -162,8 +161,8 @@ func notificationsToMap(rns []*raw.Notification) map[string]*Notification { // DeleteNotification deletes the notification with the given ID. // Note: gRPC is not supported. func (b *BucketHandle) DeleteNotification(ctx context.Context, id string) (err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Bucket.DeleteNotification") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Bucket.DeleteNotification") + defer func() { endSpan(ctx, err) }() opts := makeStorageOpts(true, b.retry, b.userProject) return b.c.tc.DeleteNotification(ctx, b.name, id, opts...) diff --git a/vendor/cloud.google.com/go/storage/option.go b/vendor/cloud.google.com/go/storage/option.go index 16d57644aae..6548cc18e82 100644 --- a/vendor/cloud.google.com/go/storage/option.go +++ b/vendor/cloud.google.com/go/storage/option.go @@ -41,6 +41,7 @@ func init() { storageinternal.WithMetricInterval = withMetricInterval storageinternal.WithReadStallTimeout = withReadStallTimeout storageinternal.WithGRPCBidiReads = withGRPCBidiReads + storageinternal.WithZonalBucketAPIs = withZonalBucketAPIs } // getDynamicReadReqIncreaseRateFromEnv returns the value set in the env variable. @@ -83,6 +84,7 @@ type storageConfig struct { manualReader *metric.ManualReader readStallTimeoutConfig *experimental.ReadStallTimeoutConfig grpcBidiReads bool + grpcAppendableUploads bool } // newStorageConfig generates a new storageConfig with all the given @@ -254,3 +256,17 @@ type withGRPCBidiReadsConfig struct { func (w *withGRPCBidiReadsConfig) ApplyStorageOpt(config *storageConfig) { config.grpcBidiReads = true } + +func withZonalBucketAPIs() option.ClientOption { + return &withZonalBucketAPIsConfig{} +} + +type withZonalBucketAPIsConfig struct { + internaloption.EmbeddableAdapter +} + +func (w *withZonalBucketAPIsConfig) ApplyStorageOpt(config *storageConfig) { + // Use both appendable upload semantics and bidi reads. + config.grpcAppendableUploads = true + config.grpcBidiReads = true +} diff --git a/vendor/cloud.google.com/go/storage/reader.go b/vendor/cloud.google.com/go/storage/reader.go index 6b14fd1dce1..793c1b2e0e8 100644 --- a/vendor/cloud.google.com/go/storage/reader.go +++ b/vendor/cloud.google.com/go/storage/reader.go @@ -19,7 +19,6 @@ import ( "fmt" "hash/crc32" "io" - "io/ioutil" "net/http" "strings" "sync" @@ -37,6 +36,7 @@ var crc32cTable = crc32.MakeTable(crc32.Castagnoli) // Each field is read-only. type ReaderObjectAttrs struct { // Size is the length of the object's content. + // Size may be out of date for unfinalized objects. Size int64 // StartOffset is the byte offset within the object @@ -161,7 +161,9 @@ func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) // Must be called on a gRPC client created using [NewGRPCClient]. // // This uses the gRPC-specific bi-directional read API, which is in private -// preview; please contact your account manager if interested. +// preview; please contact your account manager if interested. The option +// [experimental.WithGRPCBidiReads] or [experimental.WithZonalBucketAPIs] +// must be selected in order to use this API. func (o *ObjectHandle) NewMultiRangeDownloader(ctx context.Context) (mrd *MultiRangeDownloader, err error) { // This span covers the life of the reader. It is closed via the context // in Reader.Close. @@ -258,7 +260,7 @@ func setConditionsHeaders(headers http.Header, conds *Conditions) error { return nil } -var emptyBody = ioutil.NopCloser(strings.NewReader("")) +var emptyBody = io.NopCloser(strings.NewReader("")) // Reader reads a Cloud Storage object. // It implements io.Reader. @@ -273,10 +275,11 @@ type Reader struct { seen, remain, size int64 checkCRC bool // Did we check the CRC? This is now only used by tests. - reader io.ReadCloser - ctx context.Context - mu sync.Mutex - handle *ReadHandle + reader io.ReadCloser + ctx context.Context + mu sync.Mutex + handle *ReadHandle + unfinalized bool } // Close closes the Reader. It must be called when done reading. @@ -309,6 +312,7 @@ func (r *Reader) WriteTo(w io.Writer) (int64, error) { // Size returns the size of the object in bytes. // The returned value is always the same and is not affected by // calls to Read or Close. +// Size may be out of date for a Reader to an unfinalized object. // // Deprecated: use Reader.Attrs.Size. func (r *Reader) Size() int64 { @@ -316,7 +320,11 @@ func (r *Reader) Size() int64 { } // Remain returns the number of bytes left to read, or -1 if unknown. +// Unfinalized objects will return -1. func (r *Reader) Remain() int64 { + if r.unfinalized { + return -1 + } return r.remain } @@ -393,6 +401,7 @@ type multiRangeDownloader interface { wait() close() error getHandle() []byte + error() error } // Add adds a new range to MultiRangeDownloader. @@ -411,6 +420,10 @@ type multiRangeDownloader interface { // This will initiate the read range but is non-blocking; call callback to // process the result. Add is thread-safe and can be called simultaneously // from different goroutines. +// +// Callback will be called with the offset, length of data read, and error +// of the read. Note that the length of the data read may be less than the +// requested length if the end of the object is reached. func (mrd *MultiRangeDownloader) Add(output io.Writer, offset, length int64, callback func(int64, int64, error)) { mrd.reader.add(output, offset, length, callback) } @@ -439,3 +452,10 @@ func (mrd *MultiRangeDownloader) Wait() { func (mrd *MultiRangeDownloader) GetHandle() []byte { return mrd.reader.getHandle() } + +// Error returns an error if the MultiRangeDownloader is in a permanent failure +// state. It returns a nil error if the MultiRangeDownloader is open and can be +// used. +func (mrd *MultiRangeDownloader) Error() error { + return mrd.reader.error() +} diff --git a/vendor/cloud.google.com/go/storage/storage.go b/vendor/cloud.google.com/go/storage/storage.go index 9c40ca1b47e..d8455425fdc 100644 --- a/vendor/cloud.google.com/go/storage/storage.go +++ b/vendor/cloud.google.com/go/storage/storage.go @@ -38,6 +38,7 @@ import ( "time" "unicode/utf8" + "cloud.google.com/go/auth" "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" "cloud.google.com/go/storage/internal" @@ -46,15 +47,15 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/metric" "go.opentelemetry.io/otel/sdk/metric/metricdata" - "golang.org/x/oauth2/google" "google.golang.org/api/googleapi" "google.golang.org/api/option" "google.golang.org/api/option/internaloption" raw "google.golang.org/api/storage/v1" - "google.golang.org/api/transport" htransport "google.golang.org/api/transport/http" + "google.golang.org/grpc/codes" "google.golang.org/grpc/experimental/stats" "google.golang.org/grpc/stats/opentelemetry" + "google.golang.org/grpc/status" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/types/known/fieldmaskpb" @@ -65,9 +66,11 @@ import ( var signedURLMethods = map[string]bool{"DELETE": true, "GET": true, "HEAD": true, "POST": true, "PUT": true} var ( - // ErrBucketNotExist indicates that the bucket does not exist. + // ErrBucketNotExist indicates that the bucket does not exist. It should be + // checked for using [errors.Is] instead of direct equality. ErrBucketNotExist = errors.New("storage: bucket doesn't exist") - // ErrObjectNotExist indicates that the object does not exist. + // ErrObjectNotExist indicates that the object does not exist. It should be + // checked for using [errors.Is] instead of direct equality. ErrObjectNotExist = errors.New("storage: object doesn't exist") // errMethodNotSupported indicates that the method called is not currently supported by the client. // TODO: Export this error when launching the transport-agnostic client. @@ -117,11 +120,23 @@ type Client struct { // xmlHost is the default host used for XML requests. xmlHost string // May be nil. - creds *google.Credentials + creds *auth.Credentials retry *retryConfig // tc is the transport-agnostic client implemented with either gRPC or HTTP. tc storageClient + + // Option to use gRRPC appendable upload API was set. + grpcAppendableUploads bool +} + +// credsJSON returns the raw JSON of the Client's creds and true, or an empty slice +// and false if no credentials JSON is available. +func (c Client) credsJSON() ([]byte, bool) { + if c.creds != nil && len(c.creds.JSON()) > 0 { + return c.creds.JSON(), true + } + return []byte{}, false } // NewClient creates a new Google Cloud Storage client using the HTTP transport. @@ -134,7 +149,7 @@ type Client struct { // You may configure the client by passing in options from the [google.golang.org/api/option] // package. You may also use options defined in this package, such as [WithJSONReads]. func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error) { - var creds *google.Credentials + var creds *auth.Credentials // In general, it is recommended to use raw.NewService instead of htransport.NewClient // since raw.NewService configures the correct default endpoints when initializing the @@ -150,14 +165,15 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error opts = append(opts, internaloption.WithDefaultEndpointTemplate("https://storage.UNIVERSE_DOMAIN/storage/v1/"), internaloption.WithDefaultMTLSEndpoint("https://storage.mtls.googleapis.com/storage/v1/"), internaloption.WithDefaultUniverseDomain("googleapis.com"), + internaloption.EnableNewAuthLibrary(), ) // Don't error out here. The user may have passed in their own HTTP // client which does not auth with ADC or other common conventions. - c, err := transport.Creds(ctx, opts...) + c, err := internaloption.AuthCreds(ctx, opts) if err == nil { creds = c - opts = append(opts, internaloption.WithCredentials(creds)) + opts = append(opts, option.WithAuthCredentials(creds)) } } else { var hostURL *url.URL @@ -234,8 +250,10 @@ func NewGRPCClient(ctx context.Context, opts ...option.ClientOption) (*Client, e if err != nil { return nil, err } - - return &Client{tc: tc}, nil + return &Client{ + tc: tc, + grpcAppendableUploads: tc.config.grpcAppendableUploads, + }, nil } // CheckDirectConnectivitySupported checks if gRPC direct connectivity @@ -1019,8 +1037,8 @@ func (o *ObjectHandle) Key(encryptionKey []byte) *ObjectHandle { // Attrs returns meta information about the object. // ErrObjectNotExist will be returned if the object is not found. func (o *ObjectHandle) Attrs(ctx context.Context) (attrs *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Attrs") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Object.Attrs") + defer func() { endSpan(ctx, err) }() if err := o.validate(); err != nil { return nil, err @@ -1033,8 +1051,8 @@ func (o *ObjectHandle) Attrs(ctx context.Context) (attrs *ObjectAttrs, err error // ObjectAttrsToUpdate docs for details on treatment of zero values. // ErrObjectNotExist will be returned if the object is not found. func (o *ObjectHandle) Update(ctx context.Context, uattrs ObjectAttrsToUpdate) (oa *ObjectAttrs, err error) { - ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Update") - defer func() { trace.EndSpan(ctx, err) }() + ctx, _ = startSpan(ctx, "Object.Update") + defer func() { endSpan(ctx, err) }() if err := o.validate(); err != nil { return nil, err @@ -1103,7 +1121,9 @@ type ObjectAttrsToUpdate struct { } // Delete deletes the single specified object. -func (o *ObjectHandle) Delete(ctx context.Context) error { +func (o *ObjectHandle) Delete(ctx context.Context) (err error) { + ctx, _ = startSpan(ctx, "Object.Delete") + defer func() { endSpan(ctx, err) }() if err := o.validate(); err != nil { return err } @@ -1234,7 +1254,85 @@ func (o *ObjectHandle) NewWriter(ctx context.Context) *Writer { donec: make(chan struct{}), ObjectAttrs: ObjectAttrs{Name: o.object}, ChunkSize: googleapi.DefaultUploadChunkSize, + Append: o.c.grpcAppendableUploads, + } +} + +// NewWriterFromAppendableObject opens a new Writer to an object which has been +// partially flushed to GCS, but not finalized. It returns the Writer as well +// as the current end offset of the object. All bytes written will be appended +// continuing from the offset. +// +// Generation must be set on the ObjectHandle or an error will be returned. +// +// Writer fields such as ChunkSize or ChunkRetryDuration can be set only +// by setting the equivalent field in [AppendableWriterOpts]. Attributes set +// on the returned Writer will not be honored since the stream to GCS has +// already been opened. Some fields such as ObjectAttrs and checksums cannot +// be set on a takeover for append. +// +// It is the caller's responsibility to call Close when writing is complete to +// close the stream. +// Calling Close or Flush is necessary to sync any data in the pipe to GCS. +// +// The returned Writer is not safe to use across multiple go routines. In +// addition, if you attempt to append to the same object from multiple +// Writers at the same time, an error will be returned on Flush or Close. +// +// NewWriterFromAppendableObject is supported only for gRPC clients and only for +// objects which were created append semantics and not finalized. +// This feature is in preview and is not yet available for general use. +func (o *ObjectHandle) NewWriterFromAppendableObject(ctx context.Context, opts *AppendableWriterOpts) (*Writer, int64, error) { + ctx = trace.StartSpan(ctx, "cloud.google.com/go/storage.Object.Writer") + if o.gen < 0 { + return nil, 0, errors.New("storage: ObjectHandle.Generation must be set to use NewWriterFromAppendableObject") + } + w := &Writer{ + ctx: ctx, + o: o, + donec: make(chan struct{}), + ObjectAttrs: ObjectAttrs{Name: o.object}, + Append: true, + } + opts.apply(w) + if w.ChunkSize == 0 { + w.ChunkSize = googleapi.DefaultUploadChunkSize + } + err := w.openWriter() + if err != nil { + return nil, 0, err + } + return w, w.takeoverOffset, nil +} + +// AppendableWriterOpts provides options to set on a Writer initialized +// by [NewWriterFromAppendableObject]. Writer options must be set via this +// struct rather than being modified on the returned Writer. All Writer +// fields not present in this struct cannot be set when taking over an +// appendable object. +// +// AppendableWriterOpts is supported only for gRPC clients and only for +// objects which were created append semantics and not finalized. +// This feature is in preview and is not yet available for general use. +type AppendableWriterOpts struct { + // ChunkSize: See Writer.ChunkSize. + ChunkSize int + // ChunkRetryDeadline: See Writer.ChunkRetryDeadline. + ChunkRetryDeadline time.Duration + // ProgressFunc: See Writer.ProgressFunc. + ProgressFunc func(int64) + // FinalizeOnClose: See Writer.FinalizeOnClose. + FinalizeOnClose bool +} + +func (opts *AppendableWriterOpts) apply(w *Writer) { + if opts == nil { + return } + w.ChunkRetryDeadline = opts.ChunkRetryDeadline + w.ProgressFunc = opts.ProgressFunc + w.ChunkSize = opts.ChunkSize + w.FinalizeOnClose = opts.FinalizeOnClose } func (o *ObjectHandle) validate() error { @@ -1328,6 +1426,7 @@ func (o *ObjectAttrs) toProtoObject(b string) *storagepb.Object { Acl: toProtoObjectACL(o.ACL), Metadata: o.Metadata, CreateTime: toProtoTimestamp(o.Created), + FinalizeTime: toProtoTimestamp(o.Finalized), CustomTime: toProtoTimestamp(o.CustomTime), DeleteTime: toProtoTimestamp(o.Deleted), RetentionExpireTime: toProtoTimestamp(o.RetentionExpirationTime), @@ -1490,6 +1589,10 @@ type ObjectAttrs struct { // Created is the time the object was created. This field is read-only. Created time.Time + // Finalized is the time the object contents were finalized. This may differ + // from Created for appendable objects. This field is read-only. + Finalized time.Time + // Deleted is the time the object was deleted. // If not deleted, it is the zero value. This field is read-only. Deleted time.Time @@ -1654,6 +1757,7 @@ func newObject(o *raw.Object) *ObjectAttrs { CustomerKeySHA256: sha256, KMSKeyName: o.KmsKeyName, Created: convertTime(o.TimeCreated), + Finalized: convertTime(o.TimeFinalized), Deleted: convertTime(o.TimeDeleted), Updated: convertTime(o.Updated), Etag: o.Etag, @@ -1693,6 +1797,7 @@ func newObjectFromProto(o *storagepb.Object) *ObjectAttrs { CustomerKeySHA256: base64.StdEncoding.EncodeToString(o.GetCustomerEncryption().GetKeySha256Bytes()), KMSKeyName: o.GetKmsKey(), Created: convertProtoTime(o.GetCreateTime()), + Finalized: convertProtoTime(o.GetFinalizeTime()), Deleted: convertProtoTime(o.GetDeleteTime()), Updated: convertProtoTime(o.GetUpdateTime()), CustomTime: convertProtoTime(o.GetCustomTime()), @@ -1840,6 +1945,7 @@ var attrToFieldMap = map[string]string{ "CustomerKeySHA256": "customerEncryption", "KMSKeyName": "kmsKeyName", "Created": "timeCreated", + "Finalized": "timeFinalized", "Deleted": "timeDeleted", "Updated": "updated", "Etag": "etag", @@ -1868,6 +1974,7 @@ var attrToProtoFieldMap = map[string]string{ "Deleted": "delete_time", "ContentType": "content_type", "Created": "create_time", + "Finalized": "finalize_time", "CRC32C": "checksums.crc32c", "MD5": "checksums.md5_hash", "Updated": "update_time", @@ -2420,6 +2527,10 @@ type retryConfig struct { policy RetryPolicy shouldRetry func(err error) bool maxAttempts *int + // maxRetryDuration, if set, specifies a deadline after which the request + // will no longer be retried. A value of 0 allows infinite retries. + // maxRetryDuration is currently only set by Writer.ChunkRetryDeadline. + maxRetryDuration time.Duration } func (r *retryConfig) clone() *retryConfig { @@ -2437,10 +2548,11 @@ func (r *retryConfig) clone() *retryConfig { } return &retryConfig{ - backoff: bo, - policy: r.policy, - shouldRetry: r.shouldRetry, - maxAttempts: r.maxAttempts, + backoff: bo, + policy: r.policy, + shouldRetry: r.shouldRetry, + maxAttempts: r.maxAttempts, + maxRetryDuration: r.maxRetryDuration, } } @@ -2614,3 +2726,25 @@ func applyCondsProto(method string, gen int64, conds *Conditions, msg proto.Mess } return nil } + +// formatObjectErr checks if the provided error is NotFound and if so, wraps +// it in an ErrObjectNotExist error. If not, formatObjectErr has no effect. +func formatObjectErr(err error) error { + var e *googleapi.Error + if s, ok := status.FromError(err); (ok && s.Code() == codes.NotFound) || + (errors.As(err, &e) && e.Code == http.StatusNotFound) { + return fmt.Errorf("%w: %w", ErrObjectNotExist, err) + } + return err +} + +// formatBucketError checks if the provided error is NotFound and if so, wraps +// it in an ErrBucketNotExist error. If not, formatBucketError has no effect. +func formatBucketError(err error) error { + var e *googleapi.Error + if s, ok := status.FromError(err); (ok && s.Code() == codes.NotFound) || + (errors.As(err, &e) && e.Code == http.StatusNotFound) { + return fmt.Errorf("%w: %w", ErrBucketNotExist, err) + } + return err +} diff --git a/vendor/cloud.google.com/go/storage/trace.go b/vendor/cloud.google.com/go/storage/trace.go new file mode 100644 index 00000000000..0fb02325929 --- /dev/null +++ b/vendor/cloud.google.com/go/storage/trace.go @@ -0,0 +1,98 @@ +// Copyright 2025 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package storage + +import ( + "context" + "fmt" + "os" + + internalTrace "cloud.google.com/go/internal/trace" + "cloud.google.com/go/storage/internal" + "go.opentelemetry.io/otel" + "go.opentelemetry.io/otel/attribute" + otelcodes "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/trace" +) + +const ( + storageOtelTracingDevVar = "GO_STORAGE_DEV_OTEL_TRACING" + defaultTracerName = "cloud.google.com/go/storage" + gcpClientRepo = "googleapis/google-cloud-go" + gcpClientArtifact = "cloud.google.com/go/storage" +) + +// isOTelTracingDevEnabled checks the development flag until experimental feature is launched. +// TODO: Remove development flag upon experimental launch. +func isOTelTracingDevEnabled() bool { + return os.Getenv(storageOtelTracingDevVar) == "true" +} + +func tracer() trace.Tracer { + return otel.Tracer(defaultTracerName, trace.WithInstrumentationVersion(internal.Version)) +} + +// startSpan creates a span and a context.Context containing the newly-created span. +// If the context.Context provided in `ctx` contains a span then the newly-created +// span will be a child of that span, otherwise it will be a root span. +func startSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span) { + name = appendPackageName(name) + // TODO: Remove internalTrace upon experimental launch. + if !isOTelTracingDevEnabled() { + ctx = internalTrace.StartSpan(ctx, name) + return ctx, nil + } + opts = append(opts, getCommonTraceOptions()...) + ctx, span := tracer().Start(ctx, name, opts...) + return ctx, span +} + +// endSpan retrieves the current span from ctx and completes the span. +// If an error occurs, the error is recorded as an exception span event for this span, +// and the span status is set in the form of a code and a description. +func endSpan(ctx context.Context, err error) { + // TODO: Remove internalTrace upon experimental launch. + if !isOTelTracingDevEnabled() { + internalTrace.EndSpan(ctx, err) + } else { + span := trace.SpanFromContext(ctx) + if err != nil { + span.SetStatus(otelcodes.Error, err.Error()) + span.RecordError(err) + } + span.End() + } +} + +// getCommonTraceOptions makes a SpanStartOption with common attributes. +func getCommonTraceOptions() []trace.SpanStartOption { + opts := []trace.SpanStartOption{ + trace.WithAttributes(getCommonAttributes()...), + } + return opts +} + +// getCommonAttributes includes the common attributes used for Cloud Trace adoption tracking. +func getCommonAttributes() []attribute.KeyValue { + return []attribute.KeyValue{ + attribute.String("gcp.client.version", internal.Version), + attribute.String("gcp.client.repo", gcpClientRepo), + attribute.String("gcp.client.artifact", gcpClientArtifact), + } +} + +func appendPackageName(spanName string) string { + return fmt.Sprintf("%s.%s", gcpClientArtifact, spanName) +} diff --git a/vendor/cloud.google.com/go/storage/writer.go b/vendor/cloud.google.com/go/storage/writer.go index ae8f6a63928..bc0893eeac9 100644 --- a/vendor/cloud.google.com/go/storage/writer.go +++ b/vendor/cloud.google.com/go/storage/writer.go @@ -26,6 +26,16 @@ import ( "cloud.google.com/go/internal/trace" ) +// Interface internalWriter wraps low-level implementations which may vary +// across client types. +type internalWriter interface { + io.WriteCloser + Flush() (int64, error) + // CloseWithError terminates the write operation and sets its status. + // Note that CloseWithError always returns nil. + CloseWithError(error) error +} + // A Writer writes a Cloud Storage object. type Writer struct { // ObjectAttrs are optional attributes to set on the object. Any attributes @@ -77,12 +87,12 @@ type Writer struct { // For uploads of larger files, the Writer will attempt to retry if the // request to upload a particular chunk fails with a transient error. // If a single chunk has been attempting to upload for longer than this - // deadline and the request fails, it will no longer be retried, and the error - // will be returned to the caller. This is only applicable for files which are - // large enough to require a multi-chunk resumable upload. The default value - // is 32s. Users may want to pick a longer deadline if they are using larger - // values for ChunkSize or if they expect to have a slow or unreliable - // internet connection. + // deadline and the request fails, it will no longer be retried, and the + // error will be returned to the caller. This is only applicable for files + // which are large enough to require a multi-chunk resumable upload. The + // default value is 32s. Users may want to pick a longer deadline if they + // are using larger values for ChunkSize or if they expect to have a slow or + // unreliable internet connection. // // To set a deadline on the entire upload, use context timeout or // cancellation. @@ -90,9 +100,11 @@ type Writer struct { // ChunkTransferTimeout sets a per-chunk request timeout for resumable uploads. // - // For resumable uploads, the Writer will terminate the request and attempt a retry - // if the request to upload a particular chunk stalls for longer than this duration. Retries - // may continue until the ChunkRetryDeadline is reached. + // For resumable uploads, the Writer will terminate the request and attempt + // a retry if the request to upload a particular chunk stalls for longer than + // this duration. Retries may continue until the ChunkRetryDeadline is reached. + // + // ChunkTransferTimeout is not applicable to uploads made using a gRPC client. // // The default value is no timeout. ChunkTransferTimeout time.Duration @@ -105,12 +117,28 @@ type Writer struct { // Append is a parameter to indicate whether the writer should use appendable // object semantics for the new object generation. Appendable objects are // visible on the first Write() call, and can be appended to until they are - // finalized. The object is finalized on a call to Close(). + // finalized. If Writer.FinalizeOnClose is set to true, the object is finalized + // when Writer.Close() is called; otherwise, the object is left unfinalized + // and can be appended to later. + // + // Defaults to false unless the experiemental WithZonalBucketAPIs option was + // set. // // Append is only supported for gRPC. This feature is in preview and is not // yet available for general use. Append bool + // FinalizeOnClose indicates whether the Writer should finalize an object when + // closing the write stream. This only applies to Writers where Append is + // true, since append semantics allow a prefix of the object to be durable and + // readable. By default, objects written with Append semantics will not be + // finalized, which means they can be appended to later. If Append is set + // to false, this parameter will be ignored; non-appendable objects will + // always be finalized when Writer.Close returns without error. + // + // This feature is in preview and is not yet available for general use. + FinalizeOnClose bool + // ProgressFunc can be used to monitor the progress of a large write // operation. If ProgressFunc is not nil and writing requires multiple // calls to the underlying service (see @@ -125,13 +153,15 @@ type Writer struct { o *ObjectHandle opened bool - pw *io.PipeWriter + closed bool + iw internalWriter donec chan struct{} // closed after err and obj are set. obj *ObjectAttrs - mu sync.Mutex - err error + mu sync.Mutex + err error + takeoverOffset int64 // offset from which the writer started appending to the object. } // Write appends to w. It implements the io.Writer interface. @@ -155,7 +185,7 @@ func (w *Writer) Write(p []byte) (n int, err error) { return 0, err } } - n, err = w.pw.Write(p) + n, err = w.iw.Write(p) if err != nil { w.mu.Lock() werr := w.err @@ -170,6 +200,49 @@ func (w *Writer) Write(p []byte) (n int, err error) { return n, err } +// Flush syncs all bytes currently in the Writer's buffer to Cloud Storage. +// It returns the offset of bytes that have been currently synced to +// Cloud Storage and an error. +// +// If Flush is never called, Writer will sync data automatically every +// [Writer.ChunkSize] bytes and on [Writer.Close]. +// +// [Writer.ProgressFunc] will be called on Flush if present. +// +// Do not call Flush concurrently with Write or Close. A single Writer is not +// safe for unsynchronized use across threads. +// +// Note that calling Flush very early (before 512 bytes) may interfere with +// automatic content sniffing in the Writer. +// +// Flush is supported only on gRPC clients where [Writer.Append] is set +// to true. This feature is in preview and is not yet available for general use. +func (w *Writer) Flush() (int64, error) { + // Return error if Append is not true. + if !w.Append { + return 0, errors.New("storage: Flush not supported unless client uses gRPC and Append is set to true") + } + if w.closed { + return 0, errors.New("storage: Flush called on closed Writer") + } + // Return error if already in error state. + w.mu.Lock() + werr := w.err + w.mu.Unlock() + if werr != nil { + return 0, werr + } + // If Flush called before any bytes written, it should start the upload + // at zero bytes. This will make the object visible with zero length data. + if !w.opened { + if err := w.openWriter(); err != nil { + return 0, err + } + } + + return w.iw.Flush() +} + // Close completes the write operation and flushes any buffered data. // If Close doesn't return an error, metadata about the written object // can be retrieved by calling Attrs. @@ -180,12 +253,12 @@ func (w *Writer) Close() error { } } - // Closing either the read or write causes the entire pipe to close. - if err := w.pw.Close(); err != nil { + if err := w.iw.Close(); err != nil { return err } <-w.donec + w.closed = true w.mu.Lock() defer w.mu.Unlock() trace.EndSpan(w.ctx, w.err) @@ -196,33 +269,41 @@ func (w *Writer) openWriter() (err error) { if err := w.validateWriteAttrs(); err != nil { return err } - if w.o.gen != defaultGen { - return fmt.Errorf("storage: generation not supported on Writer, got %v", w.o.gen) + if w.o.gen != defaultGen && !w.Append { + return fmt.Errorf("storage: generation supported on Writer for appendable objects only, got %v", w.o.gen) } - isIdempotent := w.o.conds != nil && (w.o.conds.GenerationMatch >= 0 || w.o.conds.DoesNotExist == true) + isIdempotent := w.o.conds != nil && (w.o.conds.GenerationMatch >= 0 || w.o.conds.DoesNotExist) opts := makeStorageOpts(isIdempotent, w.o.retry, w.o.userProject) params := &openWriterParams{ - ctx: w.ctx, - chunkSize: w.ChunkSize, - chunkRetryDeadline: w.ChunkRetryDeadline, - chunkTransferTimeout: w.ChunkTransferTimeout, - bucket: w.o.bucket, - attrs: &w.ObjectAttrs, - conds: w.o.conds, - encryptionKey: w.o.encryptionKey, - sendCRC32C: w.SendCRC32C, - append: w.Append, - donec: w.donec, - setError: w.error, - progress: w.progress, - setObj: func(o *ObjectAttrs) { w.obj = o }, + ctx: w.ctx, + chunkSize: w.ChunkSize, + chunkRetryDeadline: w.ChunkRetryDeadline, + chunkTransferTimeout: w.ChunkTransferTimeout, + bucket: w.o.bucket, + attrs: &w.ObjectAttrs, + conds: w.o.conds, + appendGen: w.o.gen, + encryptionKey: w.o.encryptionKey, + sendCRC32C: w.SendCRC32C, + append: w.Append, + finalizeOnClose: w.FinalizeOnClose, + donec: w.donec, + setError: w.error, + progress: w.progress, + setObj: func(o *ObjectAttrs) { w.obj = o }, + setSize: func(n int64) { + if w.obj != nil { + w.obj.Size = n + } + }, + setTakeoverOffset: func(n int64) { w.takeoverOffset = n }, forceEmptyContentType: w.ForceEmptyContentType, } if err := w.ctx.Err(); err != nil { return err // short-circuit } - w.pw, err = w.o.c.tc.OpenWriter(params, opts...) + w.iw, err = w.o.c.tc.OpenWriter(params, opts...) if err != nil { return err } @@ -243,7 +324,6 @@ func (w *Writer) monitorCancel() { w.err = werr w.mu.Unlock() - // Closing either the read or write causes the entire pipe to close. w.CloseWithError(werr) case <-w.donec: } @@ -257,7 +337,7 @@ func (w *Writer) CloseWithError(err error) error { if !w.opened { return nil } - return w.pw.CloseWithError(err) + return w.iw.CloseWithError(err) } // Attrs returns metadata about a successfully-written object. @@ -286,9 +366,9 @@ func (w *Writer) validateWriteAttrs() error { } // progress is a convenience wrapper that reports write progress to the Writer -// ProgressFunc if it is set and progress is non-zero. +// ProgressFunc if it is set. func (w *Writer) progress(p int64) { - if w.ProgressFunc != nil && p != 0 { + if w.ProgressFunc != nil { w.ProgressFunc(p) } } diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go index b0ab713c6d0..c69f43dbae9 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/metric.go @@ -106,25 +106,29 @@ func newMetricExporter(o *options) (*metricExporter, error) { return nil, errBlankProjectID } - clientOpts := append([]option.ClientOption{option.WithGRPCDialOption(grpc.WithUserAgent(userAgent))}, o.monitoringClientOptions...) - ctx := o.context - if ctx == nil { - ctx = context.Background() - } - client, err := monitoring.NewMetricClient(ctx, clientOpts...) - if err != nil { - return nil, err - } + client := o.monitoringClient + if client == nil { + clientOpts := append([]option.ClientOption{option.WithGRPCDialOption(grpc.WithUserAgent(userAgent))}, o.monitoringClientOptions...) + ctx := o.context + if ctx == nil { + ctx = context.Background() + } + var err error + client, err = monitoring.NewMetricClient(ctx, clientOpts...) + if err != nil { + return nil, err + } - if o.compression == "gzip" { - client.CallOptions.GetMetricDescriptor = append(client.CallOptions.GetMetricDescriptor, - gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) - client.CallOptions.CreateMetricDescriptor = append(client.CallOptions.CreateMetricDescriptor, - gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) - client.CallOptions.CreateTimeSeries = append(client.CallOptions.CreateTimeSeries, - gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) - client.CallOptions.CreateServiceTimeSeries = append(client.CallOptions.CreateServiceTimeSeries, - gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) + if o.compression == "gzip" { + client.CallOptions.GetMetricDescriptor = append(client.CallOptions.GetMetricDescriptor, + gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) + client.CallOptions.CreateMetricDescriptor = append(client.CallOptions.CreateMetricDescriptor, + gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) + client.CallOptions.CreateTimeSeries = append(client.CallOptions.CreateTimeSeries, + gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) + client.CallOptions.CreateServiceTimeSeries = append(client.CallOptions.CreateServiceTimeSeries, + gax.WithGRPCOptions(grpc.UseCompressor(gzip.Name))) + } } cache := map[key]*googlemetricpb.MetricDescriptor{} diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go index 701b10b1014..8f2927b110b 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/option.go @@ -21,8 +21,9 @@ import ( "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/sdk/metric/metricdata" - semconv "go.opentelemetry.io/otel/semconv/v1.24.0" + monitoring "cloud.google.com/go/monitoring/apiv3/v2" + semconv "go.opentelemetry.io/otel/semconv/v1.24.0" apioption "google.golang.org/api/option" ) @@ -69,8 +70,11 @@ type options struct { projectID string // compression enables gzip compression on gRPC calls. compression string + // monitoringClient is used as the default client when not nil. If + // monitoringClient is nil, a client is created instead. + monitoringClient *monitoring.MetricClient // monitoringClientOptions are additional options to be passed - // to the underlying Stackdriver Monitoring API client. + // to the underlying Cloud Monitoring API client. // Optional. monitoringClientOptions []apioption.ClientOption // destinationProjectQuota sets whether the request should use quota from @@ -108,6 +112,16 @@ func WithDestinationProjectQuota() func(o *options) { } } +// WithMonitoringClient configures the client used by the exporter to write +// metrics to Cloud Monitoring. This option is mutually exclusive with +// WithMonitoringClientOptions. If both options are provided, +// WithMonitoringClient is used and WithMonitoringClientOptions is ignored. +func WithMonitoringClient(cl *monitoring.MetricClient) func(o *options) { + return func(o *options) { + o.monitoringClient = cl + } +} + // WithMonitoringClientOptions add the options for Cloud Monitoring client instance. // Available options are defined in. func WithMonitoringClientOptions(opts ...apioption.ClientOption) func(o *options) { diff --git a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go index 57dfab0c99f..bee9d333286 100644 --- a/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go +++ b/vendor/github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric/version.go @@ -17,5 +17,5 @@ package metric // Version is the current release version of the OpenTelemetry // Operations Metric Exporter in use. func Version() string { - return "0.50.0" + return "0.53.0" } diff --git a/vendor/github.com/VictoriaMetrics/fastcache/fastcache.go b/vendor/github.com/VictoriaMetrics/fastcache/fastcache.go index 046af6cebb1..9358a2b42b6 100644 --- a/vendor/github.com/VictoriaMetrics/fastcache/fastcache.go +++ b/vendor/github.com/VictoriaMetrics/fastcache/fastcache.go @@ -217,6 +217,10 @@ func (c *Cache) UpdateStats(s *Stats) { type bucket struct { mu sync.RWMutex + getCalls uint64 + setCalls uint64 + misses uint64 + // chunks is a ring buffer with encoded (k, v) pairs. // It consists of 64KB chunks. chunks [][]byte @@ -224,15 +228,12 @@ type bucket struct { // m maps hash(k) to idx of (k, v) pair in chunks. m map[uint64]uint64 - // idx points to chunks for writing the next (k, v) pair. - idx uint64 - // gen is the generation of chunks. gen uint64 - getCalls uint64 - setCalls uint64 - misses uint64 + // idx points to chunks for writing the next (k, v) pair. + idx uint64 + collisions uint64 corruptions uint64 } @@ -333,9 +334,9 @@ func (b *bucket) Set(k, v []byte, h uint64) { return } + b.mu.Lock() chunks := b.chunks needClean := false - b.mu.Lock() idx := b.idx idxNew := idx + kvLen chunkIdx := idx / chunkSize @@ -375,10 +376,10 @@ func (b *bucket) Set(k, v []byte, h uint64) { } func (b *bucket) Get(dst, k []byte, h uint64, returnDst bool) ([]byte, bool) { + b.mu.RLock() atomic.AddUint64(&b.getCalls, 1) found := false chunks := b.chunks - b.mu.RLock() v := b.m[h] bGen := b.gen & ((1 << genSizeBits) - 1) if v > 0 { diff --git a/vendor/github.com/VictoriaMetrics/fastcache/file.go b/vendor/github.com/VictoriaMetrics/fastcache/file.go index dfbc0701d93..46e3613bbcd 100644 --- a/vendor/github.com/VictoriaMetrics/fastcache/file.go +++ b/vendor/github.com/VictoriaMetrics/fastcache/file.go @@ -76,6 +76,16 @@ func (c *Cache) SaveToFileConcurrent(filePath string, concurrency int) error { return nil } +// LoadFromFileMaxBytes loads cache data from the specified filePath, +// enforcing that the cache capacity matches the provided maxBytes value. +// +// Returns an error if the stored cache's capacity differs from maxBytes. +// +// See SaveToFile* for functions that persist cache data to a file. +func LoadFromFileMaxBytes(filePath string, maxBytes int) (*Cache, error) { + return load(filePath, maxBytes) +} + // LoadFromFile loads cache data from the given filePath. // // See SaveToFile* for saving cache data to file. @@ -134,14 +144,14 @@ func load(filePath string, maxBytes int) (*Cache, error) { maxBucketBytes := uint64((maxBytes + bucketsCount - 1) / bucketsCount) expectedBucketChunks := (maxBucketBytes + chunkSize - 1) / chunkSize if maxBucketChunks != expectedBucketChunks { - return nil, fmt.Errorf("cache file %s contains maxBytes=%d; want %d", filePath, maxBytes, expectedBucketChunks*chunkSize*bucketsCount) + return nil, fmt.Errorf("cache file %s contains unexpected number of bucket chunks; got %d; want %d", filePath, maxBucketChunks, expectedBucketChunks) } } // Read bucket files from filePath dir. d, err := os.Open(filePath) if err != nil { - return nil, fmt.Errorf("cannot open %q: %s", filePath, err) + return nil, fmt.Errorf("cannot open %q: %w", filePath, err) } defer func() { _ = d.Close() @@ -206,7 +216,7 @@ func loadMetadata(dir string) (uint64, error) { metadataPath := dir + "/metadata.bin" metadataFile, err := os.Open(metadataPath) if err != nil { - return 0, fmt.Errorf("cannot open %q: %s", metadataPath, err) + return 0, fmt.Errorf("cannot open %q: %w", metadataPath, err) } defer func() { _ = metadataFile.Close() diff --git a/vendor/github.com/VictoriaMetrics/fastcache/malloc_heap.go b/vendor/github.com/VictoriaMetrics/fastcache/malloc_heap.go index 810d460b79e..54846f40f08 100644 --- a/vendor/github.com/VictoriaMetrics/fastcache/malloc_heap.go +++ b/vendor/github.com/VictoriaMetrics/fastcache/malloc_heap.go @@ -1,5 +1,5 @@ -//go:build appengine || windows -// +build appengine windows +//go:build appengine || windows || wasm || tinygo.wasm || js +// +build appengine windows wasm tinygo.wasm js package fastcache diff --git a/vendor/github.com/VictoriaMetrics/fastcache/malloc_mmap.go b/vendor/github.com/VictoriaMetrics/fastcache/malloc_mmap.go index e24d578bf75..c636b385f31 100644 --- a/vendor/github.com/VictoriaMetrics/fastcache/malloc_mmap.go +++ b/vendor/github.com/VictoriaMetrics/fastcache/malloc_mmap.go @@ -1,5 +1,5 @@ -//go:build !appengine && !windows -// +build !appengine,!windows +//go:build !appengine && !windows && !wasm && !tinygo.wasm && !js +// +build !appengine,!windows,!wasm,!tinygo.wasm,!js package fastcache diff --git a/vendor/github.com/asaskevich/govalidator/.travis.yml b/vendor/github.com/asaskevich/govalidator/.travis.yml deleted file mode 100644 index bb83c6670df..00000000000 --- a/vendor/github.com/asaskevich/govalidator/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: go -dist: xenial -go: - - '1.10' - - '1.11' - - '1.12' - - '1.13' - - 'tip' - -script: - - go test -coverpkg=./... -coverprofile=coverage.info -timeout=5s - - bash <(curl -s https://codecov.io/bash) diff --git a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md b/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md deleted file mode 100644 index 4b462b0d81b..00000000000 --- a/vendor/github.com/asaskevich/govalidator/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,43 +0,0 @@ -# Contributor Code of Conduct - -This project adheres to [The Code Manifesto](http://codemanifesto.com) -as its guidelines for contributor interactions. - -## The Code Manifesto - -We want to work in an ecosystem that empowers developers to reach their -potential — one that encourages growth and effective collaboration. A space -that is safe for all. - -A space such as this benefits everyone that participates in it. It encourages -new developers to enter our field. It is through discussion and collaboration -that we grow, and through growth that we improve. - -In the effort to create such a place, we hold to these values: - -1. **Discrimination limits us.** This includes discrimination on the basis of - race, gender, sexual orientation, gender identity, age, nationality, - technology and any other arbitrary exclusion of a group of people. -2. **Boundaries honor us.** Your comfort levels are not everyone’s comfort - levels. Remember that, and if brought to your attention, heed it. -3. **We are our biggest assets.** None of us were born masters of our trade. - Each of us has been helped along the way. Return that favor, when and where - you can. -4. **We are resources for the future.** As an extension of #3, share what you - know. Make yourself a resource to help those that come after you. -5. **Respect defines us.** Treat others as you wish to be treated. Make your - discussions, criticisms and debates from a position of respectfulness. Ask - yourself, is it true? Is it necessary? Is it constructive? Anything less is - unacceptable. -6. **Reactions require grace.** Angry responses are valid, but abusive language - and vindictive actions are toxic. When something happens that offends you, - handle it assertively, but be respectful. Escalate reasonably, and try to - allow the offender an opportunity to explain themselves, and possibly - correct the issue. -7. **Opinions are just that: opinions.** Each and every one of us, due to our - background and upbringing, have varying opinions. That is perfectly - acceptable. Remember this: if you respect your own opinions, you should - respect the opinions of others. -8. **To err is human.** You might not intend it, but mistakes do happen and - contribute to build experience. Tolerate honest mistakes, and don't - hesitate to apologize if you make one yourself. diff --git a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md b/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md deleted file mode 100644 index 7ed268a1edd..00000000000 --- a/vendor/github.com/asaskevich/govalidator/CONTRIBUTING.md +++ /dev/null @@ -1,63 +0,0 @@ -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Financial contributions - -We also welcome financial contributions in full transparency on our [open collective](https://opencollective.com/govalidator). -Anyone can file an expense. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. - - -## Credits - - -### Contributors - -Thank you to all the people who have already contributed to govalidator! - - - -### Backers - -Thank you to all our backers! [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Thank you to all our sponsors! (please ask your company to also support this open source project by [becoming a sponsor](https://opencollective.com/govalidator#sponsor)) - - - - - - - - - - - \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/LICENSE b/vendor/github.com/asaskevich/govalidator/LICENSE deleted file mode 100644 index cacba910240..00000000000 --- a/vendor/github.com/asaskevich/govalidator/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2020 Alex Saskevich - -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. \ No newline at end of file diff --git a/vendor/github.com/asaskevich/govalidator/README.md b/vendor/github.com/asaskevich/govalidator/README.md deleted file mode 100644 index 2c3fc35eb64..00000000000 --- a/vendor/github.com/asaskevich/govalidator/README.md +++ /dev/null @@ -1,622 +0,0 @@ -govalidator -=========== -[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/asaskevich/govalidator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) [![GoDoc](https://godoc.org/github.com/asaskevich/govalidator?status.png)](https://godoc.org/github.com/asaskevich/govalidator) -[![Build Status](https://travis-ci.org/asaskevich/govalidator.svg?branch=master)](https://travis-ci.org/asaskevich/govalidator) -[![Coverage](https://codecov.io/gh/asaskevich/govalidator/branch/master/graph/badge.svg)](https://codecov.io/gh/asaskevich/govalidator) [![Go Report Card](https://goreportcard.com/badge/github.com/asaskevich/govalidator)](https://goreportcard.com/report/github.com/asaskevich/govalidator) [![GoSearch](http://go-search.org/badge?id=github.com%2Fasaskevich%2Fgovalidator)](http://go-search.org/view?id=github.com%2Fasaskevich%2Fgovalidator) [![Backers on Open Collective](https://opencollective.com/govalidator/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/govalidator/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_shield) - -A package of validators and sanitizers for strings, structs and collections. Based on [validator.js](https://github.com/chriso/validator.js). - -#### Installation -Make sure that Go is installed on your computer. -Type the following command in your terminal: - - go get github.com/asaskevich/govalidator - -or you can get specified release of the package with `gopkg.in`: - - go get gopkg.in/asaskevich/govalidator.v10 - -After it the package is ready to use. - - -#### Import package in your project -Add following line in your `*.go` file: -```go -import "github.com/asaskevich/govalidator" -``` -If you are unhappy to use long `govalidator`, you can do something like this: -```go -import ( - valid "github.com/asaskevich/govalidator" -) -``` - -#### Activate behavior to require all fields have a validation tag by default -`SetFieldsRequiredByDefault` causes validation to fail when struct fields do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). A good place to activate this is a package init function or the main() function. - -`SetNilPtrAllowedByRequired` causes validation to pass when struct fields marked by `required` are set to nil. This is disabled by default for consistency, but some packages that need to be able to determine between `nil` and `zero value` state can use this. If disabled, both `nil` and `zero` values cause validation errors. - -```go -import "github.com/asaskevich/govalidator" - -func init() { - govalidator.SetFieldsRequiredByDefault(true) -} -``` - -Here's some code to explain it: -```go -// this struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -type exampleStruct struct { - Name string `` - Email string `valid:"email"` -} - -// this, however, will only fail when Email is empty or an invalid email address: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email"` -} - -// lastly, this will only fail when Email is an invalid email address but not when it's empty: -type exampleStruct2 struct { - Name string `valid:"-"` - Email string `valid:"email,optional"` -} -``` - -#### Recent breaking changes (see [#123](https://github.com/asaskevich/govalidator/pull/123)) -##### Custom validator function signature -A context was added as the second parameter, for structs this is the object being validated – this makes dependent validation possible. -```go -import "github.com/asaskevich/govalidator" - -// old signature -func(i interface{}) bool - -// new signature -func(i interface{}, o interface{}) bool -``` - -##### Adding a custom validator -This was changed to prevent data races when accessing custom validators. -```go -import "github.com/asaskevich/govalidator" - -// before -govalidator.CustomTypeTagMap["customByteArrayValidator"] = func(i interface{}, o interface{}) bool { - // ... -} - -// after -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, o interface{}) bool { - // ... -}) -``` - -#### List of functions: -```go -func Abs(value float64) float64 -func BlackList(str, chars string) string -func ByteLength(str string, params ...string) bool -func CamelCaseToUnderscore(str string) string -func Contains(str, substring string) bool -func Count(array []interface{}, iterator ConditionIterator) int -func Each(array []interface{}, iterator Iterator) -func ErrorByField(e error, field string) string -func ErrorsByField(e error) map[string]string -func Filter(array []interface{}, iterator ConditionIterator) []interface{} -func Find(array []interface{}, iterator ConditionIterator) interface{} -func GetLine(s string, index int) (string, error) -func GetLines(s string) []string -func HasLowerCase(str string) bool -func HasUpperCase(str string) bool -func HasWhitespace(str string) bool -func HasWhitespaceOnly(str string) bool -func InRange(value interface{}, left interface{}, right interface{}) bool -func InRangeFloat32(value, left, right float32) bool -func InRangeFloat64(value, left, right float64) bool -func InRangeInt(value, left, right interface{}) bool -func IsASCII(str string) bool -func IsAlpha(str string) bool -func IsAlphanumeric(str string) bool -func IsBase64(str string) bool -func IsByteLength(str string, min, max int) bool -func IsCIDR(str string) bool -func IsCRC32(str string) bool -func IsCRC32b(str string) bool -func IsCreditCard(str string) bool -func IsDNSName(str string) bool -func IsDataURI(str string) bool -func IsDialString(str string) bool -func IsDivisibleBy(str, num string) bool -func IsEmail(str string) bool -func IsExistingEmail(email string) bool -func IsFilePath(str string) (bool, int) -func IsFloat(str string) bool -func IsFullWidth(str string) bool -func IsHalfWidth(str string) bool -func IsHash(str string, algorithm string) bool -func IsHexadecimal(str string) bool -func IsHexcolor(str string) bool -func IsHost(str string) bool -func IsIP(str string) bool -func IsIPv4(str string) bool -func IsIPv6(str string) bool -func IsISBN(str string, version int) bool -func IsISBN10(str string) bool -func IsISBN13(str string) bool -func IsISO3166Alpha2(str string) bool -func IsISO3166Alpha3(str string) bool -func IsISO4217(str string) bool -func IsISO693Alpha2(str string) bool -func IsISO693Alpha3b(str string) bool -func IsIn(str string, params ...string) bool -func IsInRaw(str string, params ...string) bool -func IsInt(str string) bool -func IsJSON(str string) bool -func IsLatitude(str string) bool -func IsLongitude(str string) bool -func IsLowerCase(str string) bool -func IsMAC(str string) bool -func IsMD4(str string) bool -func IsMD5(str string) bool -func IsMagnetURI(str string) bool -func IsMongoID(str string) bool -func IsMultibyte(str string) bool -func IsNatural(value float64) bool -func IsNegative(value float64) bool -func IsNonNegative(value float64) bool -func IsNonPositive(value float64) bool -func IsNotNull(str string) bool -func IsNull(str string) bool -func IsNumeric(str string) bool -func IsPort(str string) bool -func IsPositive(value float64) bool -func IsPrintableASCII(str string) bool -func IsRFC3339(str string) bool -func IsRFC3339WithoutZone(str string) bool -func IsRGBcolor(str string) bool -func IsRegex(str string) bool -func IsRequestURI(rawurl string) bool -func IsRequestURL(rawurl string) bool -func IsRipeMD128(str string) bool -func IsRipeMD160(str string) bool -func IsRsaPub(str string, params ...string) bool -func IsRsaPublicKey(str string, keylen int) bool -func IsSHA1(str string) bool -func IsSHA256(str string) bool -func IsSHA384(str string) bool -func IsSHA512(str string) bool -func IsSSN(str string) bool -func IsSemver(str string) bool -func IsTiger128(str string) bool -func IsTiger160(str string) bool -func IsTiger192(str string) bool -func IsTime(str string, format string) bool -func IsType(v interface{}, params ...string) bool -func IsURL(str string) bool -func IsUTFDigit(str string) bool -func IsUTFLetter(str string) bool -func IsUTFLetterNumeric(str string) bool -func IsUTFNumeric(str string) bool -func IsUUID(str string) bool -func IsUUIDv3(str string) bool -func IsUUIDv4(str string) bool -func IsUUIDv5(str string) bool -func IsULID(str string) bool -func IsUnixTime(str string) bool -func IsUpperCase(str string) bool -func IsVariableWidth(str string) bool -func IsWhole(value float64) bool -func LeftTrim(str, chars string) string -func Map(array []interface{}, iterator ResultIterator) []interface{} -func Matches(str, pattern string) bool -func MaxStringLength(str string, params ...string) bool -func MinStringLength(str string, params ...string) bool -func NormalizeEmail(str string) (string, error) -func PadBoth(str string, padStr string, padLen int) string -func PadLeft(str string, padStr string, padLen int) string -func PadRight(str string, padStr string, padLen int) string -func PrependPathToErrors(err error, path string) error -func Range(str string, params ...string) bool -func RemoveTags(s string) string -func ReplacePattern(str, pattern, replace string) string -func Reverse(s string) string -func RightTrim(str, chars string) string -func RuneLength(str string, params ...string) bool -func SafeFileName(str string) string -func SetFieldsRequiredByDefault(value bool) -func SetNilPtrAllowedByRequired(value bool) -func Sign(value float64) float64 -func StringLength(str string, params ...string) bool -func StringMatches(s string, params ...string) bool -func StripLow(str string, keepNewLines bool) string -func ToBoolean(str string) (bool, error) -func ToFloat(str string) (float64, error) -func ToInt(value interface{}) (res int64, err error) -func ToJSON(obj interface{}) (string, error) -func ToString(obj interface{}) string -func Trim(str, chars string) string -func Truncate(str string, length int, ending string) string -func TruncatingErrorf(str string, args ...interface{}) error -func UnderscoreToCamelCase(s string) string -func ValidateMap(inputMap map[string]interface{}, validationMap map[string]interface{}) (bool, error) -func ValidateStruct(s interface{}) (bool, error) -func WhiteList(str, chars string) string -type ConditionIterator -type CustomTypeValidator -type Error -func (e Error) Error() string -type Errors -func (es Errors) Error() string -func (es Errors) Errors() []error -type ISO3166Entry -type ISO693Entry -type InterfaceParamValidator -type Iterator -type ParamValidator -type ResultIterator -type UnsupportedTypeError -func (e *UnsupportedTypeError) Error() string -type Validator -``` - -#### Examples -###### IsURL -```go -println(govalidator.IsURL(`http://user@pass:domain.com/path/page`)) -``` -###### IsType -```go -println(govalidator.IsType("Bob", "string")) -println(govalidator.IsType(1, "int")) -i := 1 -println(govalidator.IsType(&i, "*int")) -``` - -IsType can be used through the tag `type` which is essential for map validation: -```go -type User struct { - Name string `valid:"type(string)"` - Age int `valid:"type(int)"` - Meta interface{} `valid:"type(string)"` -} -result, err := govalidator.ValidateStruct(User{"Bob", 20, "meta"}) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ToString -```go -type User struct { - FirstName string - LastName string -} - -str := govalidator.ToString(&User{"John", "Juan"}) -println(str) -``` -###### Each, Map, Filter, Count for slices -Each iterates over the slice/array and calls Iterator for every item -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.Iterator = func(value interface{}, index int) { - println(value.(int)) -} -govalidator.Each(data, fn) -``` -```go -data := []interface{}{1, 2, 3, 4, 5} -var fn govalidator.ResultIterator = func(value interface{}, index int) interface{} { - return value.(int) * 3 -} -_ = govalidator.Map(data, fn) // result = []interface{}{1, 6, 9, 12, 15} -``` -```go -data := []interface{}{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} -var fn govalidator.ConditionIterator = func(value interface{}, index int) bool { - return value.(int)%2 == 0 -} -_ = govalidator.Filter(data, fn) // result = []interface{}{2, 4, 6, 8, 10} -_ = govalidator.Count(data, fn) // result = 5 -``` -###### ValidateStruct [#2](https://github.com/asaskevich/govalidator/pull/2) -If you want to validate structs, you can use tag `valid` for any field in your structure. All validators used with this field in one tag are separated by comma. If you want to skip validation, place `-` in your tag. If you need a validator that is not on the list below, you can add it like this: -```go -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) -``` -For completely custom validators (interface-based), see below. - -Here is a list of available validators for struct fields (validator - used function): -```go -"email": IsEmail, -"url": IsURL, -"dialstring": IsDialString, -"requrl": IsRequestURL, -"requri": IsRequestURI, -"alpha": IsAlpha, -"utfletter": IsUTFLetter, -"alphanum": IsAlphanumeric, -"utfletternum": IsUTFLetterNumeric, -"numeric": IsNumeric, -"utfnumeric": IsUTFNumeric, -"utfdigit": IsUTFDigit, -"hexadecimal": IsHexadecimal, -"hexcolor": IsHexcolor, -"rgbcolor": IsRGBcolor, -"lowercase": IsLowerCase, -"uppercase": IsUpperCase, -"int": IsInt, -"float": IsFloat, -"null": IsNull, -"uuid": IsUUID, -"uuidv3": IsUUIDv3, -"uuidv4": IsUUIDv4, -"uuidv5": IsUUIDv5, -"creditcard": IsCreditCard, -"isbn10": IsISBN10, -"isbn13": IsISBN13, -"json": IsJSON, -"multibyte": IsMultibyte, -"ascii": IsASCII, -"printableascii": IsPrintableASCII, -"fullwidth": IsFullWidth, -"halfwidth": IsHalfWidth, -"variablewidth": IsVariableWidth, -"base64": IsBase64, -"datauri": IsDataURI, -"ip": IsIP, -"port": IsPort, -"ipv4": IsIPv4, -"ipv6": IsIPv6, -"dns": IsDNSName, -"host": IsHost, -"mac": IsMAC, -"latitude": IsLatitude, -"longitude": IsLongitude, -"ssn": IsSSN, -"semver": IsSemver, -"rfc3339": IsRFC3339, -"rfc3339WithoutZone": IsRFC3339WithoutZone, -"ISO3166Alpha2": IsISO3166Alpha2, -"ISO3166Alpha3": IsISO3166Alpha3, -"ulid": IsULID, -``` -Validators with parameters - -```go -"range(min|max)": Range, -"length(min|max)": ByteLength, -"runelength(min|max)": RuneLength, -"stringlength(min|max)": StringLength, -"matches(pattern)": StringMatches, -"in(string1|string2|...|stringN)": IsIn, -"rsapub(keylength)" : IsRsaPub, -"minstringlength(int): MinStringLength, -"maxstringlength(int): MaxStringLength, -``` -Validators with parameters for any type - -```go -"type(type)": IsType, -``` - -And here is small example of usage: -```go -type Post struct { - Title string `valid:"alphanum,required"` - Message string `valid:"duck,ascii"` - Message2 string `valid:"animal(dog)"` - AuthorIP string `valid:"ipv4"` - Date string `valid:"-"` -} -post := &Post{ - Title: "My Example Post", - Message: "duck", - Message2: "dog", - AuthorIP: "123.234.54.3", -} - -// Add your own struct validation tags -govalidator.TagMap["duck"] = govalidator.Validator(func(str string) bool { - return str == "duck" -}) - -// Add your own struct validation tags with parameter -govalidator.ParamTagMap["animal"] = govalidator.ParamValidator(func(str string, params ...string) bool { - species := params[0] - return str == species -}) -govalidator.ParamTagRegexMap["animal"] = regexp.MustCompile("^animal\\((\\w+)\\)$") - -result, err := govalidator.ValidateStruct(post) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` -###### ValidateMap [#2](https://github.com/asaskevich/govalidator/pull/338) -If you want to validate maps, you can use the map to be validated and a validation map that contain the same tags used in ValidateStruct, both maps have to be in the form `map[string]interface{}` - -So here is small example of usage: -```go -var mapTemplate = map[string]interface{}{ - "name":"required,alpha", - "family":"required,alpha", - "email":"required,email", - "cell-phone":"numeric", - "address":map[string]interface{}{ - "line1":"required,alphanum", - "line2":"alphanum", - "postal-code":"numeric", - }, -} - -var inputMap = map[string]interface{}{ - "name":"Bob", - "family":"Smith", - "email":"foo@bar.baz", - "address":map[string]interface{}{ - "line1":"", - "line2":"", - "postal-code":"", - }, -} - -result, err := govalidator.ValidateMap(inputMap, mapTemplate) -if err != nil { - println("error: " + err.Error()) -} -println(result) -``` - -###### WhiteList -```go -// Remove all characters from string ignoring characters between "a" and "z" -println(govalidator.WhiteList("a3a43a5a4a3a2a23a4a5a4a3a4", "a-z") == "aaaaaaaaaaaa") -``` - -###### Custom validation functions -Custom validation using your own domain specific validators is also available - here's an example of how to use it: -```go -import "github.com/asaskevich/govalidator" - -type CustomByteArray [6]byte // custom types are supported and can be validated - -type StructWithCustomByteArray struct { - ID CustomByteArray `valid:"customByteArrayValidator,customMinLengthValidator"` // multiple custom validators are possible as well and will be evaluated in sequence - Email string `valid:"email"` - CustomMinLength int `valid:"-"` -} - -govalidator.CustomTypeTagMap.Set("customByteArrayValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // you can type switch on the context interface being validated - case StructWithCustomByteArray: - // you can check and validate against some other field in the context, - // return early or not validate against the context at all – your choice - case SomeOtherType: - // ... - default: - // expecting some other type? Throw/panic here or continue - } - - switch v := i.(type) { // type switch on the struct field being validated - case CustomByteArray: - for _, e := range v { // this validator checks that the byte array is not empty, i.e. not all zeroes - if e != 0 { - return true - } - } - } - return false -}) -govalidator.CustomTypeTagMap.Set("customMinLengthValidator", func(i interface{}, context interface{}) bool { - switch v := context.(type) { // this validates a field against the value in another field, i.e. dependent validation - case StructWithCustomByteArray: - return len(v.ID) >= v.CustomMinLength - } - return false -}) -``` - -###### Loop over Error() -By default .Error() returns all errors in a single String. To access each error you can do this: -```go - if err != nil { - errs := err.(govalidator.Errors).Errors() - for _, e := range errs { - fmt.Println(e.Error()) - } - } -``` - -###### Custom error messages -Custom error messages are supported via annotations by adding the `~` separator - here's an example of how to use it: -```go -type Ticket struct { - Id int64 `json:"id"` - FirstName string `json:"firstname" valid:"required~First name is blank"` -} -``` - -#### Notes -Documentation is available here: [godoc.org](https://godoc.org/github.com/asaskevich/govalidator). -Full information about code coverage is also available here: [govalidator on gocover.io](http://gocover.io/github.com/asaskevich/govalidator). - -#### Support -If you do have a contribution to the package, feel free to create a Pull Request or an Issue. - -#### What to contribute -If you don't know what to do, there are some features and functions that need to be done - -- [ ] Refactor code -- [ ] Edit docs and [README](https://github.com/asaskevich/govalidator/README.md): spellcheck, grammar and typo check -- [ ] Create actual list of contributors and projects that currently using this package -- [ ] Resolve [issues and bugs](https://github.com/asaskevich/govalidator/issues) -- [ ] Update actual [list of functions](https://github.com/asaskevich/govalidator#list-of-functions) -- [ ] Update [list of validators](https://github.com/asaskevich/govalidator#validatestruct-2) that available for `ValidateStruct` and add new -- [ ] Implement new validators: `IsFQDN`, `IsIMEI`, `IsPostalCode`, `IsISIN`, `IsISRC` etc -- [x] Implement [validation by maps](https://github.com/asaskevich/govalidator/issues/224) -- [ ] Implement fuzzing testing -- [ ] Implement some struct/map/array utilities -- [ ] Implement map/array validation -- [ ] Implement benchmarking -- [ ] Implement batch of examples -- [ ] Look at forks for new features and fixes - -#### Advice -Feel free to create what you want, but keep in mind when you implement new features: -- Code must be clear and readable, names of variables/constants clearly describes what they are doing -- Public functions must be documented and described in source file and added to README.md to the list of available functions -- There are must be unit-tests for any new functions and improvements - -## Credits -### Contributors - -This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)]. - -#### Special thanks to [contributors](https://github.com/asaskevich/govalidator/graphs/contributors) -* [Daniel Lohse](https://github.com/annismckenzie) -* [Attila Oláh](https://github.com/attilaolah) -* [Daniel Korner](https://github.com/Dadie) -* [Steven Wilkin](https://github.com/stevenwilkin) -* [Deiwin Sarjas](https://github.com/deiwin) -* [Noah Shibley](https://github.com/slugmobile) -* [Nathan Davies](https://github.com/nathj07) -* [Matt Sanford](https://github.com/mzsanford) -* [Simon ccl1115](https://github.com/ccl1115) - - - - -### Backers - -Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/govalidator#backer)] - - - - -### Sponsors - -Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/govalidator#sponsor)] - - - - - - - - - - - - - - - -## License -[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fasaskevich%2Fgovalidator?ref=badge_large) diff --git a/vendor/github.com/asaskevich/govalidator/arrays.go b/vendor/github.com/asaskevich/govalidator/arrays.go deleted file mode 100644 index 3e1da7cb480..00000000000 --- a/vendor/github.com/asaskevich/govalidator/arrays.go +++ /dev/null @@ -1,87 +0,0 @@ -package govalidator - -// Iterator is the function that accepts element of slice/array and its index -type Iterator func(interface{}, int) - -// ResultIterator is the function that accepts element of slice/array and its index and returns any result -type ResultIterator func(interface{}, int) interface{} - -// ConditionIterator is the function that accepts element of slice/array and its index and returns boolean -type ConditionIterator func(interface{}, int) bool - -// ReduceIterator is the function that accepts two element of slice/array and returns result of merging those values -type ReduceIterator func(interface{}, interface{}) interface{} - -// Some validates that any item of array corresponds to ConditionIterator. Returns boolean. -func Some(array []interface{}, iterator ConditionIterator) bool { - res := false - for index, data := range array { - res = res || iterator(data, index) - } - return res -} - -// Every validates that every item of array corresponds to ConditionIterator. Returns boolean. -func Every(array []interface{}, iterator ConditionIterator) bool { - res := true - for index, data := range array { - res = res && iterator(data, index) - } - return res -} - -// Reduce boils down a list of values into a single value by ReduceIterator -func Reduce(array []interface{}, iterator ReduceIterator, initialValue interface{}) interface{} { - for _, data := range array { - initialValue = iterator(initialValue, data) - } - return initialValue -} - -// Each iterates over the slice and apply Iterator to every item -func Each(array []interface{}, iterator Iterator) { - for index, data := range array { - iterator(data, index) - } -} - -// Map iterates over the slice and apply ResultIterator to every item. Returns new slice as a result. -func Map(array []interface{}, iterator ResultIterator) []interface{} { - var result = make([]interface{}, len(array)) - for index, data := range array { - result[index] = iterator(data, index) - } - return result -} - -// Find iterates over the slice and apply ConditionIterator to every item. Returns first item that meet ConditionIterator or nil otherwise. -func Find(array []interface{}, iterator ConditionIterator) interface{} { - for index, data := range array { - if iterator(data, index) { - return data - } - } - return nil -} - -// Filter iterates over the slice and apply ConditionIterator to every item. Returns new slice. -func Filter(array []interface{}, iterator ConditionIterator) []interface{} { - var result = make([]interface{}, 0) - for index, data := range array { - if iterator(data, index) { - result = append(result, data) - } - } - return result -} - -// Count iterates over the slice and apply ConditionIterator to every item. Returns count of items that meets ConditionIterator. -func Count(array []interface{}, iterator ConditionIterator) int { - count := 0 - for index, data := range array { - if iterator(data, index) { - count = count + 1 - } - } - return count -} diff --git a/vendor/github.com/asaskevich/govalidator/converter.go b/vendor/github.com/asaskevich/govalidator/converter.go deleted file mode 100644 index d68e990fc25..00000000000 --- a/vendor/github.com/asaskevich/govalidator/converter.go +++ /dev/null @@ -1,81 +0,0 @@ -package govalidator - -import ( - "encoding/json" - "fmt" - "reflect" - "strconv" -) - -// ToString convert the input to a string. -func ToString(obj interface{}) string { - res := fmt.Sprintf("%v", obj) - return res -} - -// ToJSON convert the input to a valid JSON string -func ToJSON(obj interface{}) (string, error) { - res, err := json.Marshal(obj) - if err != nil { - res = []byte("") - } - return string(res), err -} - -// ToFloat convert the input string to a float, or 0.0 if the input is not a float. -func ToFloat(value interface{}) (res float64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = float64(val.Int()) - case uint, uint8, uint16, uint32, uint64: - res = float64(val.Uint()) - case float32, float64: - res = val.Float() - case string: - res, err = strconv.ParseFloat(val.String(), 64) - if err != nil { - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToInt convert the input string or any int type to an integer type 64, or 0 if the input is not an integer. -func ToInt(value interface{}) (res int64, err error) { - val := reflect.ValueOf(value) - - switch value.(type) { - case int, int8, int16, int32, int64: - res = val.Int() - case uint, uint8, uint16, uint32, uint64: - res = int64(val.Uint()) - case float32, float64: - res = int64(val.Float()) - case string: - if IsInt(val.String()) { - res, err = strconv.ParseInt(val.String(), 0, 64) - if err != nil { - res = 0 - } - } else { - err = fmt.Errorf("ToInt: invalid numeric format %g", value) - res = 0 - } - default: - err = fmt.Errorf("ToInt: unknown interface type %T", value) - res = 0 - } - - return -} - -// ToBoolean convert the input string to a boolean. -func ToBoolean(str string) (bool, error) { - return strconv.ParseBool(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/doc.go b/vendor/github.com/asaskevich/govalidator/doc.go deleted file mode 100644 index 55dce62dc8c..00000000000 --- a/vendor/github.com/asaskevich/govalidator/doc.go +++ /dev/null @@ -1,3 +0,0 @@ -package govalidator - -// A package of validators and sanitizers for strings, structures and collections. diff --git a/vendor/github.com/asaskevich/govalidator/error.go b/vendor/github.com/asaskevich/govalidator/error.go deleted file mode 100644 index 1da2336f47e..00000000000 --- a/vendor/github.com/asaskevich/govalidator/error.go +++ /dev/null @@ -1,47 +0,0 @@ -package govalidator - -import ( - "sort" - "strings" -) - -// Errors is an array of multiple errors and conforms to the error interface. -type Errors []error - -// Errors returns itself. -func (es Errors) Errors() []error { - return es -} - -func (es Errors) Error() string { - var errs []string - for _, e := range es { - errs = append(errs, e.Error()) - } - sort.Strings(errs) - return strings.Join(errs, ";") -} - -// Error encapsulates a name, an error and whether there's a custom error message or not. -type Error struct { - Name string - Err error - CustomErrorMessageExists bool - - // Validator indicates the name of the validator that failed - Validator string - Path []string -} - -func (e Error) Error() string { - if e.CustomErrorMessageExists { - return e.Err.Error() - } - - errName := e.Name - if len(e.Path) > 0 { - errName = strings.Join(append(e.Path, e.Name), ".") - } - - return errName + ": " + e.Err.Error() -} diff --git a/vendor/github.com/asaskevich/govalidator/numerics.go b/vendor/github.com/asaskevich/govalidator/numerics.go deleted file mode 100644 index 5041d9e8684..00000000000 --- a/vendor/github.com/asaskevich/govalidator/numerics.go +++ /dev/null @@ -1,100 +0,0 @@ -package govalidator - -import ( - "math" -) - -// Abs returns absolute value of number -func Abs(value float64) float64 { - return math.Abs(value) -} - -// Sign returns signum of number: 1 in case of value > 0, -1 in case of value < 0, 0 otherwise -func Sign(value float64) float64 { - if value > 0 { - return 1 - } else if value < 0 { - return -1 - } else { - return 0 - } -} - -// IsNegative returns true if value < 0 -func IsNegative(value float64) bool { - return value < 0 -} - -// IsPositive returns true if value > 0 -func IsPositive(value float64) bool { - return value > 0 -} - -// IsNonNegative returns true if value >= 0 -func IsNonNegative(value float64) bool { - return value >= 0 -} - -// IsNonPositive returns true if value <= 0 -func IsNonPositive(value float64) bool { - return value <= 0 -} - -// InRangeInt returns true if value lies between left and right border -func InRangeInt(value, left, right interface{}) bool { - value64, _ := ToInt(value) - left64, _ := ToInt(left) - right64, _ := ToInt(right) - if left64 > right64 { - left64, right64 = right64, left64 - } - return value64 >= left64 && value64 <= right64 -} - -// InRangeFloat32 returns true if value lies between left and right border -func InRangeFloat32(value, left, right float32) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRangeFloat64 returns true if value lies between left and right border -func InRangeFloat64(value, left, right float64) bool { - if left > right { - left, right = right, left - } - return value >= left && value <= right -} - -// InRange returns true if value lies between left and right border, generic type to handle int, float32, float64 and string. -// All types must the same type. -// False if value doesn't lie in range or if it incompatible or not comparable -func InRange(value interface{}, left interface{}, right interface{}) bool { - switch value.(type) { - case int: - intValue, _ := ToInt(value) - intLeft, _ := ToInt(left) - intRight, _ := ToInt(right) - return InRangeInt(intValue, intLeft, intRight) - case float32, float64: - intValue, _ := ToFloat(value) - intLeft, _ := ToFloat(left) - intRight, _ := ToFloat(right) - return InRangeFloat64(intValue, intLeft, intRight) - case string: - return value.(string) >= left.(string) && value.(string) <= right.(string) - default: - return false - } -} - -// IsWhole returns true if value is whole number -func IsWhole(value float64) bool { - return math.Remainder(value, 1) == 0 -} - -// IsNatural returns true if value is natural number (positive and whole) -func IsNatural(value float64) bool { - return IsWhole(value) && IsPositive(value) -} diff --git a/vendor/github.com/asaskevich/govalidator/patterns.go b/vendor/github.com/asaskevich/govalidator/patterns.go deleted file mode 100644 index bafc3765ea1..00000000000 --- a/vendor/github.com/asaskevich/govalidator/patterns.go +++ /dev/null @@ -1,113 +0,0 @@ -package govalidator - -import "regexp" - -// Basic regular expressions for validating strings -const ( - Email string = "^(((([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+(\\.([a-zA-Z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|\\.|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|\\d|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.)+(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])|(([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])([a-zA-Z]|\\d|-|_|~|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])*([a-zA-Z]|[\\x{00A0}-\\x{D7FF}\\x{F900}-\\x{FDCF}\\x{FDF0}-\\x{FFEF}])))\\.?$" - CreditCard string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" - ISBN10 string = "^(?:[0-9]{9}X|[0-9]{10})$" - ISBN13 string = "^(?:[0-9]{13})$" - UUID3 string = "^[0-9a-f]{8}-[0-9a-f]{4}-3[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$" - UUID4 string = "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID5 string = "^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - UUID string = "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - Alpha string = "^[a-zA-Z]+$" - Alphanumeric string = "^[a-zA-Z0-9]+$" - Numeric string = "^[0-9]+$" - Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" - Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" - Hexadecimal string = "^[0-9a-fA-F]+$" - Hexcolor string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" - RGBcolor string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" - ASCII string = "^[\x00-\x7F]+$" - Multibyte string = "[^\x00-\x7F]" - FullWidth string = "[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - HalfWidth string = "[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]" - Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" - PrintableASCII string = "^[\x20-\x7E]+$" - DataURI string = "^data:.+\\/(.+);base64$" - MagnetURI string = "^magnet:\\?xt=urn:[a-zA-Z0-9]+:[a-zA-Z0-9]{32,40}&dn=.+&tr=.+$" - Latitude string = "^[-+]?([1-8]?\\d(\\.\\d+)?|90(\\.0+)?)$" - Longitude string = "^[-+]?(180(\\.0+)?|((1[0-7]\\d)|([1-9]?\\d))(\\.\\d+)?)$" - DNSName string = `^([a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62}){1}(\.[a-zA-Z0-9_]{1}[a-zA-Z0-9_-]{0,62})*[\._]?$` - IP string = `(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))` - URLSchema string = `((ftp|tcp|udp|wss?|https?):\/\/)` - URLUsername string = `(\S+(:\S*)?@)` - URLPath string = `((\/|\?|#)[^\s]*)` - URLPort string = `(:(\d{1,5}))` - URLIP string = `([1-9]\d?|1\d\d|2[01]\d|22[0-3]|24\d|25[0-5])(\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])){2}(?:\.([0-9]\d?|1\d\d|2[0-4]\d|25[0-5]))` - URLSubdomain string = `((www\.)|([a-zA-Z0-9]+([-_\.]?[a-zA-Z0-9])*[a-zA-Z0-9]\.[a-zA-Z0-9]+))` - URL = `^` + URLSchema + `?` + URLUsername + `?` + `((` + URLIP + `|(\[` + IP + `\])|(([a-zA-Z0-9]([a-zA-Z0-9-_]+)?[a-zA-Z0-9]([-\.][a-zA-Z0-9]+)*)|(` + URLSubdomain + `?))?(([a-zA-Z\x{00a1}-\x{ffff}0-9]+-?-?)*[a-zA-Z\x{00a1}-\x{ffff}0-9]+)(?:\.([a-zA-Z\x{00a1}-\x{ffff}]{1,}))?))\.?` + URLPort + `?` + URLPath + `?$` - SSN string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` - WinPath string = `^[a-zA-Z]:\\(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixPath string = `^(/[^/\x00]*)+/?$` - WinARPath string = `^(?:(?:[a-zA-Z]:|\\\\[a-z0-9_.$●-]+\\[a-z0-9_.$●-]+)\\|\\?[^\\/:*?"<>|\r\n]+\\?)(?:[^\\/:*?"<>|\r\n]+\\)*[^\\/:*?"<>|\r\n]*$` - UnixARPath string = `^((\.{0,2}/)?([^/\x00]*))+/?$` - Semver string = "^v?(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(-(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(\\.(0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\\+[0-9a-zA-Z-]+(\\.[0-9a-zA-Z-]+)*)?$" - tagName string = "valid" - hasLowerCase string = ".*[[:lower:]]" - hasUpperCase string = ".*[[:upper:]]" - hasWhitespace string = ".*[[:space:]]" - hasWhitespaceOnly string = "^[[:space:]]+$" - IMEI string = "^[0-9a-f]{14}$|^\\d{15}$|^\\d{18}$" - IMSI string = "^\\d{14,15}$" - E164 string = `^\+?[1-9]\d{1,14}$` -) - -// Used by IsFilePath func -const ( - // Unknown is unresolved OS type - Unknown = iota - // Win is Windows type - Win - // Unix is *nix OS types - Unix -) - -var ( - userRegexp = regexp.MustCompile("^[a-zA-Z0-9!#$%&'*+/=?^_`{|}~.-]+$") - hostRegexp = regexp.MustCompile("^[^\\s]+\\.[^\\s]+$") - userDotRegexp = regexp.MustCompile("(^[.]{1})|([.]{1}$)|([.]{2,})") - rxEmail = regexp.MustCompile(Email) - rxCreditCard = regexp.MustCompile(CreditCard) - rxISBN10 = regexp.MustCompile(ISBN10) - rxISBN13 = regexp.MustCompile(ISBN13) - rxUUID3 = regexp.MustCompile(UUID3) - rxUUID4 = regexp.MustCompile(UUID4) - rxUUID5 = regexp.MustCompile(UUID5) - rxUUID = regexp.MustCompile(UUID) - rxAlpha = regexp.MustCompile(Alpha) - rxAlphanumeric = regexp.MustCompile(Alphanumeric) - rxNumeric = regexp.MustCompile(Numeric) - rxInt = regexp.MustCompile(Int) - rxFloat = regexp.MustCompile(Float) - rxHexadecimal = regexp.MustCompile(Hexadecimal) - rxHexcolor = regexp.MustCompile(Hexcolor) - rxRGBcolor = regexp.MustCompile(RGBcolor) - rxASCII = regexp.MustCompile(ASCII) - rxPrintableASCII = regexp.MustCompile(PrintableASCII) - rxMultibyte = regexp.MustCompile(Multibyte) - rxFullWidth = regexp.MustCompile(FullWidth) - rxHalfWidth = regexp.MustCompile(HalfWidth) - rxBase64 = regexp.MustCompile(Base64) - rxDataURI = regexp.MustCompile(DataURI) - rxMagnetURI = regexp.MustCompile(MagnetURI) - rxLatitude = regexp.MustCompile(Latitude) - rxLongitude = regexp.MustCompile(Longitude) - rxDNSName = regexp.MustCompile(DNSName) - rxURL = regexp.MustCompile(URL) - rxSSN = regexp.MustCompile(SSN) - rxWinPath = regexp.MustCompile(WinPath) - rxUnixPath = regexp.MustCompile(UnixPath) - rxARWinPath = regexp.MustCompile(WinARPath) - rxARUnixPath = regexp.MustCompile(UnixARPath) - rxSemver = regexp.MustCompile(Semver) - rxHasLowerCase = regexp.MustCompile(hasLowerCase) - rxHasUpperCase = regexp.MustCompile(hasUpperCase) - rxHasWhitespace = regexp.MustCompile(hasWhitespace) - rxHasWhitespaceOnly = regexp.MustCompile(hasWhitespaceOnly) - rxIMEI = regexp.MustCompile(IMEI) - rxIMSI = regexp.MustCompile(IMSI) - rxE164 = regexp.MustCompile(E164) -) diff --git a/vendor/github.com/asaskevich/govalidator/types.go b/vendor/github.com/asaskevich/govalidator/types.go deleted file mode 100644 index c573abb51af..00000000000 --- a/vendor/github.com/asaskevich/govalidator/types.go +++ /dev/null @@ -1,656 +0,0 @@ -package govalidator - -import ( - "reflect" - "regexp" - "sort" - "sync" -) - -// Validator is a wrapper for a validator function that returns bool and accepts string. -type Validator func(str string) bool - -// CustomTypeValidator is a wrapper for validator functions that returns bool and accepts any type. -// The second parameter should be the context (in the case of validating a struct: the whole object being validated). -type CustomTypeValidator func(i interface{}, o interface{}) bool - -// ParamValidator is a wrapper for validator functions that accept additional parameters. -type ParamValidator func(str string, params ...string) bool - -// InterfaceParamValidator is a wrapper for functions that accept variants parameters for an interface value -type InterfaceParamValidator func(in interface{}, params ...string) bool -type tagOptionsMap map[string]tagOption - -func (t tagOptionsMap) orderedKeys() []string { - var keys []string - for k := range t { - keys = append(keys, k) - } - - sort.Slice(keys, func(a, b int) bool { - return t[keys[a]].order < t[keys[b]].order - }) - - return keys -} - -type tagOption struct { - name string - customErrorMessage string - order int -} - -// UnsupportedTypeError is a wrapper for reflect.Type -type UnsupportedTypeError struct { - Type reflect.Type -} - -// stringValues is a slice of reflect.Value holding *reflect.StringValue. -// It implements the methods to sort by string. -type stringValues []reflect.Value - -// InterfaceParamTagMap is a map of functions accept variants parameters for an interface value -var InterfaceParamTagMap = map[string]InterfaceParamValidator{ - "type": IsType, -} - -// InterfaceParamTagRegexMap maps interface param tags to their respective regexes. -var InterfaceParamTagRegexMap = map[string]*regexp.Regexp{ - "type": regexp.MustCompile(`^type\((.*)\)$`), -} - -// ParamTagMap is a map of functions accept variants parameters -var ParamTagMap = map[string]ParamValidator{ - "length": ByteLength, - "range": Range, - "runelength": RuneLength, - "stringlength": StringLength, - "matches": StringMatches, - "in": IsInRaw, - "rsapub": IsRsaPub, - "minstringlength": MinStringLength, - "maxstringlength": MaxStringLength, -} - -// ParamTagRegexMap maps param tags to their respective regexes. -var ParamTagRegexMap = map[string]*regexp.Regexp{ - "range": regexp.MustCompile("^range\\((\\d+)\\|(\\d+)\\)$"), - "length": regexp.MustCompile("^length\\((\\d+)\\|(\\d+)\\)$"), - "runelength": regexp.MustCompile("^runelength\\((\\d+)\\|(\\d+)\\)$"), - "stringlength": regexp.MustCompile("^stringlength\\((\\d+)\\|(\\d+)\\)$"), - "in": regexp.MustCompile(`^in\((.*)\)`), - "matches": regexp.MustCompile(`^matches\((.+)\)$`), - "rsapub": regexp.MustCompile("^rsapub\\((\\d+)\\)$"), - "minstringlength": regexp.MustCompile("^minstringlength\\((\\d+)\\)$"), - "maxstringlength": regexp.MustCompile("^maxstringlength\\((\\d+)\\)$"), -} - -type customTypeTagMap struct { - validators map[string]CustomTypeValidator - - sync.RWMutex -} - -func (tm *customTypeTagMap) Get(name string) (CustomTypeValidator, bool) { - tm.RLock() - defer tm.RUnlock() - v, ok := tm.validators[name] - return v, ok -} - -func (tm *customTypeTagMap) Set(name string, ctv CustomTypeValidator) { - tm.Lock() - defer tm.Unlock() - tm.validators[name] = ctv -} - -// CustomTypeTagMap is a map of functions that can be used as tags for ValidateStruct function. -// Use this to validate compound or custom types that need to be handled as a whole, e.g. -// `type UUID [16]byte` (this would be handled as an array of bytes). -var CustomTypeTagMap = &customTypeTagMap{validators: make(map[string]CustomTypeValidator)} - -// TagMap is a map of functions, that can be used as tags for ValidateStruct function. -var TagMap = map[string]Validator{ - "email": IsEmail, - "url": IsURL, - "dialstring": IsDialString, - "requrl": IsRequestURL, - "requri": IsRequestURI, - "alpha": IsAlpha, - "utfletter": IsUTFLetter, - "alphanum": IsAlphanumeric, - "utfletternum": IsUTFLetterNumeric, - "numeric": IsNumeric, - "utfnumeric": IsUTFNumeric, - "utfdigit": IsUTFDigit, - "hexadecimal": IsHexadecimal, - "hexcolor": IsHexcolor, - "rgbcolor": IsRGBcolor, - "lowercase": IsLowerCase, - "uppercase": IsUpperCase, - "int": IsInt, - "float": IsFloat, - "null": IsNull, - "notnull": IsNotNull, - "uuid": IsUUID, - "uuidv3": IsUUIDv3, - "uuidv4": IsUUIDv4, - "uuidv5": IsUUIDv5, - "creditcard": IsCreditCard, - "isbn10": IsISBN10, - "isbn13": IsISBN13, - "json": IsJSON, - "multibyte": IsMultibyte, - "ascii": IsASCII, - "printableascii": IsPrintableASCII, - "fullwidth": IsFullWidth, - "halfwidth": IsHalfWidth, - "variablewidth": IsVariableWidth, - "base64": IsBase64, - "datauri": IsDataURI, - "ip": IsIP, - "port": IsPort, - "ipv4": IsIPv4, - "ipv6": IsIPv6, - "dns": IsDNSName, - "host": IsHost, - "mac": IsMAC, - "latitude": IsLatitude, - "longitude": IsLongitude, - "ssn": IsSSN, - "semver": IsSemver, - "rfc3339": IsRFC3339, - "rfc3339WithoutZone": IsRFC3339WithoutZone, - "ISO3166Alpha2": IsISO3166Alpha2, - "ISO3166Alpha3": IsISO3166Alpha3, - "ISO4217": IsISO4217, - "IMEI": IsIMEI, - "ulid": IsULID, -} - -// ISO3166Entry stores country codes -type ISO3166Entry struct { - EnglishShortName string - FrenchShortName string - Alpha2Code string - Alpha3Code string - Numeric string -} - -//ISO3166List based on https://www.iso.org/obp/ui/#search/code/ Code Type "Officially Assigned Codes" -var ISO3166List = []ISO3166Entry{ - {"Afghanistan", "Afghanistan (l')", "AF", "AFG", "004"}, - {"Albania", "Albanie (l')", "AL", "ALB", "008"}, - {"Antarctica", "Antarctique (l')", "AQ", "ATA", "010"}, - {"Algeria", "Algérie (l')", "DZ", "DZA", "012"}, - {"American Samoa", "Samoa américaines (les)", "AS", "ASM", "016"}, - {"Andorra", "Andorre (l')", "AD", "AND", "020"}, - {"Angola", "Angola (l')", "AO", "AGO", "024"}, - {"Antigua and Barbuda", "Antigua-et-Barbuda", "AG", "ATG", "028"}, - {"Azerbaijan", "Azerbaïdjan (l')", "AZ", "AZE", "031"}, - {"Argentina", "Argentine (l')", "AR", "ARG", "032"}, - {"Australia", "Australie (l')", "AU", "AUS", "036"}, - {"Austria", "Autriche (l')", "AT", "AUT", "040"}, - {"Bahamas (the)", "Bahamas (les)", "BS", "BHS", "044"}, - {"Bahrain", "Bahreïn", "BH", "BHR", "048"}, - {"Bangladesh", "Bangladesh (le)", "BD", "BGD", "050"}, - {"Armenia", "Arménie (l')", "AM", "ARM", "051"}, - {"Barbados", "Barbade (la)", "BB", "BRB", "052"}, - {"Belgium", "Belgique (la)", "BE", "BEL", "056"}, - {"Bermuda", "Bermudes (les)", "BM", "BMU", "060"}, - {"Bhutan", "Bhoutan (le)", "BT", "BTN", "064"}, - {"Bolivia (Plurinational State of)", "Bolivie (État plurinational de)", "BO", "BOL", "068"}, - {"Bosnia and Herzegovina", "Bosnie-Herzégovine (la)", "BA", "BIH", "070"}, - {"Botswana", "Botswana (le)", "BW", "BWA", "072"}, - {"Bouvet Island", "Bouvet (l'Île)", "BV", "BVT", "074"}, - {"Brazil", "Brésil (le)", "BR", "BRA", "076"}, - {"Belize", "Belize (le)", "BZ", "BLZ", "084"}, - {"British Indian Ocean Territory (the)", "Indien (le Territoire britannique de l'océan)", "IO", "IOT", "086"}, - {"Solomon Islands", "Salomon (Îles)", "SB", "SLB", "090"}, - {"Virgin Islands (British)", "Vierges britanniques (les Îles)", "VG", "VGB", "092"}, - {"Brunei Darussalam", "Brunéi Darussalam (le)", "BN", "BRN", "096"}, - {"Bulgaria", "Bulgarie (la)", "BG", "BGR", "100"}, - {"Myanmar", "Myanmar (le)", "MM", "MMR", "104"}, - {"Burundi", "Burundi (le)", "BI", "BDI", "108"}, - {"Belarus", "Bélarus (le)", "BY", "BLR", "112"}, - {"Cambodia", "Cambodge (le)", "KH", "KHM", "116"}, - {"Cameroon", "Cameroun (le)", "CM", "CMR", "120"}, - {"Canada", "Canada (le)", "CA", "CAN", "124"}, - {"Cabo Verde", "Cabo Verde", "CV", "CPV", "132"}, - {"Cayman Islands (the)", "Caïmans (les Îles)", "KY", "CYM", "136"}, - {"Central African Republic (the)", "République centrafricaine (la)", "CF", "CAF", "140"}, - {"Sri Lanka", "Sri Lanka", "LK", "LKA", "144"}, - {"Chad", "Tchad (le)", "TD", "TCD", "148"}, - {"Chile", "Chili (le)", "CL", "CHL", "152"}, - {"China", "Chine (la)", "CN", "CHN", "156"}, - {"Taiwan (Province of China)", "Taïwan (Province de Chine)", "TW", "TWN", "158"}, - {"Christmas Island", "Christmas (l'Île)", "CX", "CXR", "162"}, - {"Cocos (Keeling) Islands (the)", "Cocos (les Îles)/ Keeling (les Îles)", "CC", "CCK", "166"}, - {"Colombia", "Colombie (la)", "CO", "COL", "170"}, - {"Comoros (the)", "Comores (les)", "KM", "COM", "174"}, - {"Mayotte", "Mayotte", "YT", "MYT", "175"}, - {"Congo (the)", "Congo (le)", "CG", "COG", "178"}, - {"Congo (the Democratic Republic of the)", "Congo (la République démocratique du)", "CD", "COD", "180"}, - {"Cook Islands (the)", "Cook (les Îles)", "CK", "COK", "184"}, - {"Costa Rica", "Costa Rica (le)", "CR", "CRI", "188"}, - {"Croatia", "Croatie (la)", "HR", "HRV", "191"}, - {"Cuba", "Cuba", "CU", "CUB", "192"}, - {"Cyprus", "Chypre", "CY", "CYP", "196"}, - {"Czech Republic (the)", "tchèque (la République)", "CZ", "CZE", "203"}, - {"Benin", "Bénin (le)", "BJ", "BEN", "204"}, - {"Denmark", "Danemark (le)", "DK", "DNK", "208"}, - {"Dominica", "Dominique (la)", "DM", "DMA", "212"}, - {"Dominican Republic (the)", "dominicaine (la République)", "DO", "DOM", "214"}, - {"Ecuador", "Équateur (l')", "EC", "ECU", "218"}, - {"El Salvador", "El Salvador", "SV", "SLV", "222"}, - {"Equatorial Guinea", "Guinée équatoriale (la)", "GQ", "GNQ", "226"}, - {"Ethiopia", "Éthiopie (l')", "ET", "ETH", "231"}, - {"Eritrea", "Érythrée (l')", "ER", "ERI", "232"}, - {"Estonia", "Estonie (l')", "EE", "EST", "233"}, - {"Faroe Islands (the)", "Féroé (les Îles)", "FO", "FRO", "234"}, - {"Falkland Islands (the) [Malvinas]", "Falkland (les Îles)/Malouines (les Îles)", "FK", "FLK", "238"}, - {"South Georgia and the South Sandwich Islands", "Géorgie du Sud-et-les Îles Sandwich du Sud (la)", "GS", "SGS", "239"}, - {"Fiji", "Fidji (les)", "FJ", "FJI", "242"}, - {"Finland", "Finlande (la)", "FI", "FIN", "246"}, - {"Åland Islands", "Åland(les Îles)", "AX", "ALA", "248"}, - {"France", "France (la)", "FR", "FRA", "250"}, - {"French Guiana", "Guyane française (la )", "GF", "GUF", "254"}, - {"French Polynesia", "Polynésie française (la)", "PF", "PYF", "258"}, - {"French Southern Territories (the)", "Terres australes françaises (les)", "TF", "ATF", "260"}, - {"Djibouti", "Djibouti", "DJ", "DJI", "262"}, - {"Gabon", "Gabon (le)", "GA", "GAB", "266"}, - {"Georgia", "Géorgie (la)", "GE", "GEO", "268"}, - {"Gambia (the)", "Gambie (la)", "GM", "GMB", "270"}, - {"Palestine, State of", "Palestine, État de", "PS", "PSE", "275"}, - {"Germany", "Allemagne (l')", "DE", "DEU", "276"}, - {"Ghana", "Ghana (le)", "GH", "GHA", "288"}, - {"Gibraltar", "Gibraltar", "GI", "GIB", "292"}, - {"Kiribati", "Kiribati", "KI", "KIR", "296"}, - {"Greece", "Grèce (la)", "GR", "GRC", "300"}, - {"Greenland", "Groenland (le)", "GL", "GRL", "304"}, - {"Grenada", "Grenade (la)", "GD", "GRD", "308"}, - {"Guadeloupe", "Guadeloupe (la)", "GP", "GLP", "312"}, - {"Guam", "Guam", "GU", "GUM", "316"}, - {"Guatemala", "Guatemala (le)", "GT", "GTM", "320"}, - {"Guinea", "Guinée (la)", "GN", "GIN", "324"}, - {"Guyana", "Guyana (le)", "GY", "GUY", "328"}, - {"Haiti", "Haïti", "HT", "HTI", "332"}, - {"Heard Island and McDonald Islands", "Heard-et-Îles MacDonald (l'Île)", "HM", "HMD", "334"}, - {"Holy See (the)", "Saint-Siège (le)", "VA", "VAT", "336"}, - {"Honduras", "Honduras (le)", "HN", "HND", "340"}, - {"Hong Kong", "Hong Kong", "HK", "HKG", "344"}, - {"Hungary", "Hongrie (la)", "HU", "HUN", "348"}, - {"Iceland", "Islande (l')", "IS", "ISL", "352"}, - {"India", "Inde (l')", "IN", "IND", "356"}, - {"Indonesia", "Indonésie (l')", "ID", "IDN", "360"}, - {"Iran (Islamic Republic of)", "Iran (République Islamique d')", "IR", "IRN", "364"}, - {"Iraq", "Iraq (l')", "IQ", "IRQ", "368"}, - {"Ireland", "Irlande (l')", "IE", "IRL", "372"}, - {"Israel", "Israël", "IL", "ISR", "376"}, - {"Italy", "Italie (l')", "IT", "ITA", "380"}, - {"Côte d'Ivoire", "Côte d'Ivoire (la)", "CI", "CIV", "384"}, - {"Jamaica", "Jamaïque (la)", "JM", "JAM", "388"}, - {"Japan", "Japon (le)", "JP", "JPN", "392"}, - {"Kazakhstan", "Kazakhstan (le)", "KZ", "KAZ", "398"}, - {"Jordan", "Jordanie (la)", "JO", "JOR", "400"}, - {"Kenya", "Kenya (le)", "KE", "KEN", "404"}, - {"Korea (the Democratic People's Republic of)", "Corée (la République populaire démocratique de)", "KP", "PRK", "408"}, - {"Korea (the Republic of)", "Corée (la République de)", "KR", "KOR", "410"}, - {"Kuwait", "Koweït (le)", "KW", "KWT", "414"}, - {"Kyrgyzstan", "Kirghizistan (le)", "KG", "KGZ", "417"}, - {"Lao People's Democratic Republic (the)", "Lao, République démocratique populaire", "LA", "LAO", "418"}, - {"Lebanon", "Liban (le)", "LB", "LBN", "422"}, - {"Lesotho", "Lesotho (le)", "LS", "LSO", "426"}, - {"Latvia", "Lettonie (la)", "LV", "LVA", "428"}, - {"Liberia", "Libéria (le)", "LR", "LBR", "430"}, - {"Libya", "Libye (la)", "LY", "LBY", "434"}, - {"Liechtenstein", "Liechtenstein (le)", "LI", "LIE", "438"}, - {"Lithuania", "Lituanie (la)", "LT", "LTU", "440"}, - {"Luxembourg", "Luxembourg (le)", "LU", "LUX", "442"}, - {"Macao", "Macao", "MO", "MAC", "446"}, - {"Madagascar", "Madagascar", "MG", "MDG", "450"}, - {"Malawi", "Malawi (le)", "MW", "MWI", "454"}, - {"Malaysia", "Malaisie (la)", "MY", "MYS", "458"}, - {"Maldives", "Maldives (les)", "MV", "MDV", "462"}, - {"Mali", "Mali (le)", "ML", "MLI", "466"}, - {"Malta", "Malte", "MT", "MLT", "470"}, - {"Martinique", "Martinique (la)", "MQ", "MTQ", "474"}, - {"Mauritania", "Mauritanie (la)", "MR", "MRT", "478"}, - {"Mauritius", "Maurice", "MU", "MUS", "480"}, - {"Mexico", "Mexique (le)", "MX", "MEX", "484"}, - {"Monaco", "Monaco", "MC", "MCO", "492"}, - {"Mongolia", "Mongolie (la)", "MN", "MNG", "496"}, - {"Moldova (the Republic of)", "Moldova , République de", "MD", "MDA", "498"}, - {"Montenegro", "Monténégro (le)", "ME", "MNE", "499"}, - {"Montserrat", "Montserrat", "MS", "MSR", "500"}, - {"Morocco", "Maroc (le)", "MA", "MAR", "504"}, - {"Mozambique", "Mozambique (le)", "MZ", "MOZ", "508"}, - {"Oman", "Oman", "OM", "OMN", "512"}, - {"Namibia", "Namibie (la)", "NA", "NAM", "516"}, - {"Nauru", "Nauru", "NR", "NRU", "520"}, - {"Nepal", "Népal (le)", "NP", "NPL", "524"}, - {"Netherlands (the)", "Pays-Bas (les)", "NL", "NLD", "528"}, - {"Curaçao", "Curaçao", "CW", "CUW", "531"}, - {"Aruba", "Aruba", "AW", "ABW", "533"}, - {"Sint Maarten (Dutch part)", "Saint-Martin (partie néerlandaise)", "SX", "SXM", "534"}, - {"Bonaire, Sint Eustatius and Saba", "Bonaire, Saint-Eustache et Saba", "BQ", "BES", "535"}, - {"New Caledonia", "Nouvelle-Calédonie (la)", "NC", "NCL", "540"}, - {"Vanuatu", "Vanuatu (le)", "VU", "VUT", "548"}, - {"New Zealand", "Nouvelle-Zélande (la)", "NZ", "NZL", "554"}, - {"Nicaragua", "Nicaragua (le)", "NI", "NIC", "558"}, - {"Niger (the)", "Niger (le)", "NE", "NER", "562"}, - {"Nigeria", "Nigéria (le)", "NG", "NGA", "566"}, - {"Niue", "Niue", "NU", "NIU", "570"}, - {"Norfolk Island", "Norfolk (l'Île)", "NF", "NFK", "574"}, - {"Norway", "Norvège (la)", "NO", "NOR", "578"}, - {"Northern Mariana Islands (the)", "Mariannes du Nord (les Îles)", "MP", "MNP", "580"}, - {"United States Minor Outlying Islands (the)", "Îles mineures éloignées des États-Unis (les)", "UM", "UMI", "581"}, - {"Micronesia (Federated States of)", "Micronésie (États fédérés de)", "FM", "FSM", "583"}, - {"Marshall Islands (the)", "Marshall (Îles)", "MH", "MHL", "584"}, - {"Palau", "Palaos (les)", "PW", "PLW", "585"}, - {"Pakistan", "Pakistan (le)", "PK", "PAK", "586"}, - {"Panama", "Panama (le)", "PA", "PAN", "591"}, - {"Papua New Guinea", "Papouasie-Nouvelle-Guinée (la)", "PG", "PNG", "598"}, - {"Paraguay", "Paraguay (le)", "PY", "PRY", "600"}, - {"Peru", "Pérou (le)", "PE", "PER", "604"}, - {"Philippines (the)", "Philippines (les)", "PH", "PHL", "608"}, - {"Pitcairn", "Pitcairn", "PN", "PCN", "612"}, - {"Poland", "Pologne (la)", "PL", "POL", "616"}, - {"Portugal", "Portugal (le)", "PT", "PRT", "620"}, - {"Guinea-Bissau", "Guinée-Bissau (la)", "GW", "GNB", "624"}, - {"Timor-Leste", "Timor-Leste (le)", "TL", "TLS", "626"}, - {"Puerto Rico", "Porto Rico", "PR", "PRI", "630"}, - {"Qatar", "Qatar (le)", "QA", "QAT", "634"}, - {"Réunion", "Réunion (La)", "RE", "REU", "638"}, - {"Romania", "Roumanie (la)", "RO", "ROU", "642"}, - {"Russian Federation (the)", "Russie (la Fédération de)", "RU", "RUS", "643"}, - {"Rwanda", "Rwanda (le)", "RW", "RWA", "646"}, - {"Saint Barthélemy", "Saint-Barthélemy", "BL", "BLM", "652"}, - {"Saint Helena, Ascension and Tristan da Cunha", "Sainte-Hélène, Ascension et Tristan da Cunha", "SH", "SHN", "654"}, - {"Saint Kitts and Nevis", "Saint-Kitts-et-Nevis", "KN", "KNA", "659"}, - {"Anguilla", "Anguilla", "AI", "AIA", "660"}, - {"Saint Lucia", "Sainte-Lucie", "LC", "LCA", "662"}, - {"Saint Martin (French part)", "Saint-Martin (partie française)", "MF", "MAF", "663"}, - {"Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "PM", "SPM", "666"}, - {"Saint Vincent and the Grenadines", "Saint-Vincent-et-les Grenadines", "VC", "VCT", "670"}, - {"San Marino", "Saint-Marin", "SM", "SMR", "674"}, - {"Sao Tome and Principe", "Sao Tomé-et-Principe", "ST", "STP", "678"}, - {"Saudi Arabia", "Arabie saoudite (l')", "SA", "SAU", "682"}, - {"Senegal", "Sénégal (le)", "SN", "SEN", "686"}, - {"Serbia", "Serbie (la)", "RS", "SRB", "688"}, - {"Seychelles", "Seychelles (les)", "SC", "SYC", "690"}, - {"Sierra Leone", "Sierra Leone (la)", "SL", "SLE", "694"}, - {"Singapore", "Singapour", "SG", "SGP", "702"}, - {"Slovakia", "Slovaquie (la)", "SK", "SVK", "703"}, - {"Viet Nam", "Viet Nam (le)", "VN", "VNM", "704"}, - {"Slovenia", "Slovénie (la)", "SI", "SVN", "705"}, - {"Somalia", "Somalie (la)", "SO", "SOM", "706"}, - {"South Africa", "Afrique du Sud (l')", "ZA", "ZAF", "710"}, - {"Zimbabwe", "Zimbabwe (le)", "ZW", "ZWE", "716"}, - {"Spain", "Espagne (l')", "ES", "ESP", "724"}, - {"South Sudan", "Soudan du Sud (le)", "SS", "SSD", "728"}, - {"Sudan (the)", "Soudan (le)", "SD", "SDN", "729"}, - {"Western Sahara*", "Sahara occidental (le)*", "EH", "ESH", "732"}, - {"Suriname", "Suriname (le)", "SR", "SUR", "740"}, - {"Svalbard and Jan Mayen", "Svalbard et l'Île Jan Mayen (le)", "SJ", "SJM", "744"}, - {"Swaziland", "Swaziland (le)", "SZ", "SWZ", "748"}, - {"Sweden", "Suède (la)", "SE", "SWE", "752"}, - {"Switzerland", "Suisse (la)", "CH", "CHE", "756"}, - {"Syrian Arab Republic", "République arabe syrienne (la)", "SY", "SYR", "760"}, - {"Tajikistan", "Tadjikistan (le)", "TJ", "TJK", "762"}, - {"Thailand", "Thaïlande (la)", "TH", "THA", "764"}, - {"Togo", "Togo (le)", "TG", "TGO", "768"}, - {"Tokelau", "Tokelau (les)", "TK", "TKL", "772"}, - {"Tonga", "Tonga (les)", "TO", "TON", "776"}, - {"Trinidad and Tobago", "Trinité-et-Tobago (la)", "TT", "TTO", "780"}, - {"United Arab Emirates (the)", "Émirats arabes unis (les)", "AE", "ARE", "784"}, - {"Tunisia", "Tunisie (la)", "TN", "TUN", "788"}, - {"Turkey", "Turquie (la)", "TR", "TUR", "792"}, - {"Turkmenistan", "Turkménistan (le)", "TM", "TKM", "795"}, - {"Turks and Caicos Islands (the)", "Turks-et-Caïcos (les Îles)", "TC", "TCA", "796"}, - {"Tuvalu", "Tuvalu (les)", "TV", "TUV", "798"}, - {"Uganda", "Ouganda (l')", "UG", "UGA", "800"}, - {"Ukraine", "Ukraine (l')", "UA", "UKR", "804"}, - {"Macedonia (the former Yugoslav Republic of)", "Macédoine (l'ex‑République yougoslave de)", "MK", "MKD", "807"}, - {"Egypt", "Égypte (l')", "EG", "EGY", "818"}, - {"United Kingdom of Great Britain and Northern Ireland (the)", "Royaume-Uni de Grande-Bretagne et d'Irlande du Nord (le)", "GB", "GBR", "826"}, - {"Guernsey", "Guernesey", "GG", "GGY", "831"}, - {"Jersey", "Jersey", "JE", "JEY", "832"}, - {"Isle of Man", "Île de Man", "IM", "IMN", "833"}, - {"Tanzania, United Republic of", "Tanzanie, République-Unie de", "TZ", "TZA", "834"}, - {"United States of America (the)", "États-Unis d'Amérique (les)", "US", "USA", "840"}, - {"Virgin Islands (U.S.)", "Vierges des États-Unis (les Îles)", "VI", "VIR", "850"}, - {"Burkina Faso", "Burkina Faso (le)", "BF", "BFA", "854"}, - {"Uruguay", "Uruguay (l')", "UY", "URY", "858"}, - {"Uzbekistan", "Ouzbékistan (l')", "UZ", "UZB", "860"}, - {"Venezuela (Bolivarian Republic of)", "Venezuela (République bolivarienne du)", "VE", "VEN", "862"}, - {"Wallis and Futuna", "Wallis-et-Futuna", "WF", "WLF", "876"}, - {"Samoa", "Samoa (le)", "WS", "WSM", "882"}, - {"Yemen", "Yémen (le)", "YE", "YEM", "887"}, - {"Zambia", "Zambie (la)", "ZM", "ZMB", "894"}, -} - -// ISO4217List is the list of ISO currency codes -var ISO4217List = []string{ - "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", - "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", - "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", - "DJF", "DKK", "DOP", "DZD", - "EGP", "ERN", "ETB", "EUR", - "FJD", "FKP", - "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", - "HKD", "HNL", "HRK", "HTG", "HUF", - "IDR", "ILS", "INR", "IQD", "IRR", "ISK", - "JMD", "JOD", "JPY", - "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", - "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", - "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRO", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", - "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", - "OMR", - "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", - "QAR", - "RON", "RSD", "RUB", "RWF", - "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STD", "STN", "SVC", "SYP", "SZL", - "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", - "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UYW", "UZS", - "VEF", "VES", "VND", "VUV", - "WST", - "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XTS", "XUA", "XXX", - "YER", - "ZAR", "ZMW", "ZWL", -} - -// ISO693Entry stores ISO language codes -type ISO693Entry struct { - Alpha3bCode string - Alpha2Code string - English string -} - -//ISO693List based on http://data.okfn.org/data/core/language-codes/r/language-codes-3b2.json -var ISO693List = []ISO693Entry{ - {Alpha3bCode: "aar", Alpha2Code: "aa", English: "Afar"}, - {Alpha3bCode: "abk", Alpha2Code: "ab", English: "Abkhazian"}, - {Alpha3bCode: "afr", Alpha2Code: "af", English: "Afrikaans"}, - {Alpha3bCode: "aka", Alpha2Code: "ak", English: "Akan"}, - {Alpha3bCode: "alb", Alpha2Code: "sq", English: "Albanian"}, - {Alpha3bCode: "amh", Alpha2Code: "am", English: "Amharic"}, - {Alpha3bCode: "ara", Alpha2Code: "ar", English: "Arabic"}, - {Alpha3bCode: "arg", Alpha2Code: "an", English: "Aragonese"}, - {Alpha3bCode: "arm", Alpha2Code: "hy", English: "Armenian"}, - {Alpha3bCode: "asm", Alpha2Code: "as", English: "Assamese"}, - {Alpha3bCode: "ava", Alpha2Code: "av", English: "Avaric"}, - {Alpha3bCode: "ave", Alpha2Code: "ae", English: "Avestan"}, - {Alpha3bCode: "aym", Alpha2Code: "ay", English: "Aymara"}, - {Alpha3bCode: "aze", Alpha2Code: "az", English: "Azerbaijani"}, - {Alpha3bCode: "bak", Alpha2Code: "ba", English: "Bashkir"}, - {Alpha3bCode: "bam", Alpha2Code: "bm", English: "Bambara"}, - {Alpha3bCode: "baq", Alpha2Code: "eu", English: "Basque"}, - {Alpha3bCode: "bel", Alpha2Code: "be", English: "Belarusian"}, - {Alpha3bCode: "ben", Alpha2Code: "bn", English: "Bengali"}, - {Alpha3bCode: "bih", Alpha2Code: "bh", English: "Bihari languages"}, - {Alpha3bCode: "bis", Alpha2Code: "bi", English: "Bislama"}, - {Alpha3bCode: "bos", Alpha2Code: "bs", English: "Bosnian"}, - {Alpha3bCode: "bre", Alpha2Code: "br", English: "Breton"}, - {Alpha3bCode: "bul", Alpha2Code: "bg", English: "Bulgarian"}, - {Alpha3bCode: "bur", Alpha2Code: "my", English: "Burmese"}, - {Alpha3bCode: "cat", Alpha2Code: "ca", English: "Catalan; Valencian"}, - {Alpha3bCode: "cha", Alpha2Code: "ch", English: "Chamorro"}, - {Alpha3bCode: "che", Alpha2Code: "ce", English: "Chechen"}, - {Alpha3bCode: "chi", Alpha2Code: "zh", English: "Chinese"}, - {Alpha3bCode: "chu", Alpha2Code: "cu", English: "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic"}, - {Alpha3bCode: "chv", Alpha2Code: "cv", English: "Chuvash"}, - {Alpha3bCode: "cor", Alpha2Code: "kw", English: "Cornish"}, - {Alpha3bCode: "cos", Alpha2Code: "co", English: "Corsican"}, - {Alpha3bCode: "cre", Alpha2Code: "cr", English: "Cree"}, - {Alpha3bCode: "cze", Alpha2Code: "cs", English: "Czech"}, - {Alpha3bCode: "dan", Alpha2Code: "da", English: "Danish"}, - {Alpha3bCode: "div", Alpha2Code: "dv", English: "Divehi; Dhivehi; Maldivian"}, - {Alpha3bCode: "dut", Alpha2Code: "nl", English: "Dutch; Flemish"}, - {Alpha3bCode: "dzo", Alpha2Code: "dz", English: "Dzongkha"}, - {Alpha3bCode: "eng", Alpha2Code: "en", English: "English"}, - {Alpha3bCode: "epo", Alpha2Code: "eo", English: "Esperanto"}, - {Alpha3bCode: "est", Alpha2Code: "et", English: "Estonian"}, - {Alpha3bCode: "ewe", Alpha2Code: "ee", English: "Ewe"}, - {Alpha3bCode: "fao", Alpha2Code: "fo", English: "Faroese"}, - {Alpha3bCode: "fij", Alpha2Code: "fj", English: "Fijian"}, - {Alpha3bCode: "fin", Alpha2Code: "fi", English: "Finnish"}, - {Alpha3bCode: "fre", Alpha2Code: "fr", English: "French"}, - {Alpha3bCode: "fry", Alpha2Code: "fy", English: "Western Frisian"}, - {Alpha3bCode: "ful", Alpha2Code: "ff", English: "Fulah"}, - {Alpha3bCode: "geo", Alpha2Code: "ka", English: "Georgian"}, - {Alpha3bCode: "ger", Alpha2Code: "de", English: "German"}, - {Alpha3bCode: "gla", Alpha2Code: "gd", English: "Gaelic; Scottish Gaelic"}, - {Alpha3bCode: "gle", Alpha2Code: "ga", English: "Irish"}, - {Alpha3bCode: "glg", Alpha2Code: "gl", English: "Galician"}, - {Alpha3bCode: "glv", Alpha2Code: "gv", English: "Manx"}, - {Alpha3bCode: "gre", Alpha2Code: "el", English: "Greek, Modern (1453-)"}, - {Alpha3bCode: "grn", Alpha2Code: "gn", English: "Guarani"}, - {Alpha3bCode: "guj", Alpha2Code: "gu", English: "Gujarati"}, - {Alpha3bCode: "hat", Alpha2Code: "ht", English: "Haitian; Haitian Creole"}, - {Alpha3bCode: "hau", Alpha2Code: "ha", English: "Hausa"}, - {Alpha3bCode: "heb", Alpha2Code: "he", English: "Hebrew"}, - {Alpha3bCode: "her", Alpha2Code: "hz", English: "Herero"}, - {Alpha3bCode: "hin", Alpha2Code: "hi", English: "Hindi"}, - {Alpha3bCode: "hmo", Alpha2Code: "ho", English: "Hiri Motu"}, - {Alpha3bCode: "hrv", Alpha2Code: "hr", English: "Croatian"}, - {Alpha3bCode: "hun", Alpha2Code: "hu", English: "Hungarian"}, - {Alpha3bCode: "ibo", Alpha2Code: "ig", English: "Igbo"}, - {Alpha3bCode: "ice", Alpha2Code: "is", English: "Icelandic"}, - {Alpha3bCode: "ido", Alpha2Code: "io", English: "Ido"}, - {Alpha3bCode: "iii", Alpha2Code: "ii", English: "Sichuan Yi; Nuosu"}, - {Alpha3bCode: "iku", Alpha2Code: "iu", English: "Inuktitut"}, - {Alpha3bCode: "ile", Alpha2Code: "ie", English: "Interlingue; Occidental"}, - {Alpha3bCode: "ina", Alpha2Code: "ia", English: "Interlingua (International Auxiliary Language Association)"}, - {Alpha3bCode: "ind", Alpha2Code: "id", English: "Indonesian"}, - {Alpha3bCode: "ipk", Alpha2Code: "ik", English: "Inupiaq"}, - {Alpha3bCode: "ita", Alpha2Code: "it", English: "Italian"}, - {Alpha3bCode: "jav", Alpha2Code: "jv", English: "Javanese"}, - {Alpha3bCode: "jpn", Alpha2Code: "ja", English: "Japanese"}, - {Alpha3bCode: "kal", Alpha2Code: "kl", English: "Kalaallisut; Greenlandic"}, - {Alpha3bCode: "kan", Alpha2Code: "kn", English: "Kannada"}, - {Alpha3bCode: "kas", Alpha2Code: "ks", English: "Kashmiri"}, - {Alpha3bCode: "kau", Alpha2Code: "kr", English: "Kanuri"}, - {Alpha3bCode: "kaz", Alpha2Code: "kk", English: "Kazakh"}, - {Alpha3bCode: "khm", Alpha2Code: "km", English: "Central Khmer"}, - {Alpha3bCode: "kik", Alpha2Code: "ki", English: "Kikuyu; Gikuyu"}, - {Alpha3bCode: "kin", Alpha2Code: "rw", English: "Kinyarwanda"}, - {Alpha3bCode: "kir", Alpha2Code: "ky", English: "Kirghiz; Kyrgyz"}, - {Alpha3bCode: "kom", Alpha2Code: "kv", English: "Komi"}, - {Alpha3bCode: "kon", Alpha2Code: "kg", English: "Kongo"}, - {Alpha3bCode: "kor", Alpha2Code: "ko", English: "Korean"}, - {Alpha3bCode: "kua", Alpha2Code: "kj", English: "Kuanyama; Kwanyama"}, - {Alpha3bCode: "kur", Alpha2Code: "ku", English: "Kurdish"}, - {Alpha3bCode: "lao", Alpha2Code: "lo", English: "Lao"}, - {Alpha3bCode: "lat", Alpha2Code: "la", English: "Latin"}, - {Alpha3bCode: "lav", Alpha2Code: "lv", English: "Latvian"}, - {Alpha3bCode: "lim", Alpha2Code: "li", English: "Limburgan; Limburger; Limburgish"}, - {Alpha3bCode: "lin", Alpha2Code: "ln", English: "Lingala"}, - {Alpha3bCode: "lit", Alpha2Code: "lt", English: "Lithuanian"}, - {Alpha3bCode: "ltz", Alpha2Code: "lb", English: "Luxembourgish; Letzeburgesch"}, - {Alpha3bCode: "lub", Alpha2Code: "lu", English: "Luba-Katanga"}, - {Alpha3bCode: "lug", Alpha2Code: "lg", English: "Ganda"}, - {Alpha3bCode: "mac", Alpha2Code: "mk", English: "Macedonian"}, - {Alpha3bCode: "mah", Alpha2Code: "mh", English: "Marshallese"}, - {Alpha3bCode: "mal", Alpha2Code: "ml", English: "Malayalam"}, - {Alpha3bCode: "mao", Alpha2Code: "mi", English: "Maori"}, - {Alpha3bCode: "mar", Alpha2Code: "mr", English: "Marathi"}, - {Alpha3bCode: "may", Alpha2Code: "ms", English: "Malay"}, - {Alpha3bCode: "mlg", Alpha2Code: "mg", English: "Malagasy"}, - {Alpha3bCode: "mlt", Alpha2Code: "mt", English: "Maltese"}, - {Alpha3bCode: "mon", Alpha2Code: "mn", English: "Mongolian"}, - {Alpha3bCode: "nau", Alpha2Code: "na", English: "Nauru"}, - {Alpha3bCode: "nav", Alpha2Code: "nv", English: "Navajo; Navaho"}, - {Alpha3bCode: "nbl", Alpha2Code: "nr", English: "Ndebele, South; South Ndebele"}, - {Alpha3bCode: "nde", Alpha2Code: "nd", English: "Ndebele, North; North Ndebele"}, - {Alpha3bCode: "ndo", Alpha2Code: "ng", English: "Ndonga"}, - {Alpha3bCode: "nep", Alpha2Code: "ne", English: "Nepali"}, - {Alpha3bCode: "nno", Alpha2Code: "nn", English: "Norwegian Nynorsk; Nynorsk, Norwegian"}, - {Alpha3bCode: "nob", Alpha2Code: "nb", English: "Bokmål, Norwegian; Norwegian Bokmål"}, - {Alpha3bCode: "nor", Alpha2Code: "no", English: "Norwegian"}, - {Alpha3bCode: "nya", Alpha2Code: "ny", English: "Chichewa; Chewa; Nyanja"}, - {Alpha3bCode: "oci", Alpha2Code: "oc", English: "Occitan (post 1500); Provençal"}, - {Alpha3bCode: "oji", Alpha2Code: "oj", English: "Ojibwa"}, - {Alpha3bCode: "ori", Alpha2Code: "or", English: "Oriya"}, - {Alpha3bCode: "orm", Alpha2Code: "om", English: "Oromo"}, - {Alpha3bCode: "oss", Alpha2Code: "os", English: "Ossetian; Ossetic"}, - {Alpha3bCode: "pan", Alpha2Code: "pa", English: "Panjabi; Punjabi"}, - {Alpha3bCode: "per", Alpha2Code: "fa", English: "Persian"}, - {Alpha3bCode: "pli", Alpha2Code: "pi", English: "Pali"}, - {Alpha3bCode: "pol", Alpha2Code: "pl", English: "Polish"}, - {Alpha3bCode: "por", Alpha2Code: "pt", English: "Portuguese"}, - {Alpha3bCode: "pus", Alpha2Code: "ps", English: "Pushto; Pashto"}, - {Alpha3bCode: "que", Alpha2Code: "qu", English: "Quechua"}, - {Alpha3bCode: "roh", Alpha2Code: "rm", English: "Romansh"}, - {Alpha3bCode: "rum", Alpha2Code: "ro", English: "Romanian; Moldavian; Moldovan"}, - {Alpha3bCode: "run", Alpha2Code: "rn", English: "Rundi"}, - {Alpha3bCode: "rus", Alpha2Code: "ru", English: "Russian"}, - {Alpha3bCode: "sag", Alpha2Code: "sg", English: "Sango"}, - {Alpha3bCode: "san", Alpha2Code: "sa", English: "Sanskrit"}, - {Alpha3bCode: "sin", Alpha2Code: "si", English: "Sinhala; Sinhalese"}, - {Alpha3bCode: "slo", Alpha2Code: "sk", English: "Slovak"}, - {Alpha3bCode: "slv", Alpha2Code: "sl", English: "Slovenian"}, - {Alpha3bCode: "sme", Alpha2Code: "se", English: "Northern Sami"}, - {Alpha3bCode: "smo", Alpha2Code: "sm", English: "Samoan"}, - {Alpha3bCode: "sna", Alpha2Code: "sn", English: "Shona"}, - {Alpha3bCode: "snd", Alpha2Code: "sd", English: "Sindhi"}, - {Alpha3bCode: "som", Alpha2Code: "so", English: "Somali"}, - {Alpha3bCode: "sot", Alpha2Code: "st", English: "Sotho, Southern"}, - {Alpha3bCode: "spa", Alpha2Code: "es", English: "Spanish; Castilian"}, - {Alpha3bCode: "srd", Alpha2Code: "sc", English: "Sardinian"}, - {Alpha3bCode: "srp", Alpha2Code: "sr", English: "Serbian"}, - {Alpha3bCode: "ssw", Alpha2Code: "ss", English: "Swati"}, - {Alpha3bCode: "sun", Alpha2Code: "su", English: "Sundanese"}, - {Alpha3bCode: "swa", Alpha2Code: "sw", English: "Swahili"}, - {Alpha3bCode: "swe", Alpha2Code: "sv", English: "Swedish"}, - {Alpha3bCode: "tah", Alpha2Code: "ty", English: "Tahitian"}, - {Alpha3bCode: "tam", Alpha2Code: "ta", English: "Tamil"}, - {Alpha3bCode: "tat", Alpha2Code: "tt", English: "Tatar"}, - {Alpha3bCode: "tel", Alpha2Code: "te", English: "Telugu"}, - {Alpha3bCode: "tgk", Alpha2Code: "tg", English: "Tajik"}, - {Alpha3bCode: "tgl", Alpha2Code: "tl", English: "Tagalog"}, - {Alpha3bCode: "tha", Alpha2Code: "th", English: "Thai"}, - {Alpha3bCode: "tib", Alpha2Code: "bo", English: "Tibetan"}, - {Alpha3bCode: "tir", Alpha2Code: "ti", English: "Tigrinya"}, - {Alpha3bCode: "ton", Alpha2Code: "to", English: "Tonga (Tonga Islands)"}, - {Alpha3bCode: "tsn", Alpha2Code: "tn", English: "Tswana"}, - {Alpha3bCode: "tso", Alpha2Code: "ts", English: "Tsonga"}, - {Alpha3bCode: "tuk", Alpha2Code: "tk", English: "Turkmen"}, - {Alpha3bCode: "tur", Alpha2Code: "tr", English: "Turkish"}, - {Alpha3bCode: "twi", Alpha2Code: "tw", English: "Twi"}, - {Alpha3bCode: "uig", Alpha2Code: "ug", English: "Uighur; Uyghur"}, - {Alpha3bCode: "ukr", Alpha2Code: "uk", English: "Ukrainian"}, - {Alpha3bCode: "urd", Alpha2Code: "ur", English: "Urdu"}, - {Alpha3bCode: "uzb", Alpha2Code: "uz", English: "Uzbek"}, - {Alpha3bCode: "ven", Alpha2Code: "ve", English: "Venda"}, - {Alpha3bCode: "vie", Alpha2Code: "vi", English: "Vietnamese"}, - {Alpha3bCode: "vol", Alpha2Code: "vo", English: "Volapük"}, - {Alpha3bCode: "wel", Alpha2Code: "cy", English: "Welsh"}, - {Alpha3bCode: "wln", Alpha2Code: "wa", English: "Walloon"}, - {Alpha3bCode: "wol", Alpha2Code: "wo", English: "Wolof"}, - {Alpha3bCode: "xho", Alpha2Code: "xh", English: "Xhosa"}, - {Alpha3bCode: "yid", Alpha2Code: "yi", English: "Yiddish"}, - {Alpha3bCode: "yor", Alpha2Code: "yo", English: "Yoruba"}, - {Alpha3bCode: "zha", Alpha2Code: "za", English: "Zhuang; Chuang"}, - {Alpha3bCode: "zul", Alpha2Code: "zu", English: "Zulu"}, -} diff --git a/vendor/github.com/asaskevich/govalidator/utils.go b/vendor/github.com/asaskevich/govalidator/utils.go deleted file mode 100644 index f4c30f824a2..00000000000 --- a/vendor/github.com/asaskevich/govalidator/utils.go +++ /dev/null @@ -1,270 +0,0 @@ -package govalidator - -import ( - "errors" - "fmt" - "html" - "math" - "path" - "regexp" - "strings" - "unicode" - "unicode/utf8" -) - -// Contains checks if the string contains the substring. -func Contains(str, substring string) bool { - return strings.Contains(str, substring) -} - -// Matches checks if string matches the pattern (pattern is regular expression) -// In case of error return false -func Matches(str, pattern string) bool { - match, _ := regexp.MatchString(pattern, str) - return match -} - -// LeftTrim trims characters from the left side of the input. -// If second argument is empty, it will remove leading spaces. -func LeftTrim(str, chars string) string { - if chars == "" { - return strings.TrimLeftFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("^[" + chars + "]+") - return r.ReplaceAllString(str, "") -} - -// RightTrim trims characters from the right side of the input. -// If second argument is empty, it will remove trailing spaces. -func RightTrim(str, chars string) string { - if chars == "" { - return strings.TrimRightFunc(str, unicode.IsSpace) - } - r, _ := regexp.Compile("[" + chars + "]+$") - return r.ReplaceAllString(str, "") -} - -// Trim trims characters from both sides of the input. -// If second argument is empty, it will remove spaces. -func Trim(str, chars string) string { - return LeftTrim(RightTrim(str, chars), chars) -} - -// WhiteList removes characters that do not appear in the whitelist. -func WhiteList(str, chars string) string { - pattern := "[^" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// BlackList removes characters that appear in the blacklist. -func BlackList(str, chars string) string { - pattern := "[" + chars + "]+" - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, "") -} - -// StripLow removes characters with a numerical value < 32 and 127, mostly control characters. -// If keep_new_lines is true, newline characters are preserved (\n and \r, hex 0xA and 0xD). -func StripLow(str string, keepNewLines bool) string { - chars := "" - if keepNewLines { - chars = "\x00-\x09\x0B\x0C\x0E-\x1F\x7F" - } else { - chars = "\x00-\x1F\x7F" - } - return BlackList(str, chars) -} - -// ReplacePattern replaces regular expression pattern in string -func ReplacePattern(str, pattern, replace string) string { - r, _ := regexp.Compile(pattern) - return r.ReplaceAllString(str, replace) -} - -// Escape replaces <, >, & and " with HTML entities. -var Escape = html.EscapeString - -func addSegment(inrune, segment []rune) []rune { - if len(segment) == 0 { - return inrune - } - if len(inrune) != 0 { - inrune = append(inrune, '_') - } - inrune = append(inrune, segment...) - return inrune -} - -// UnderscoreToCamelCase converts from underscore separated form to camel case form. -// Ex.: my_func => MyFunc -func UnderscoreToCamelCase(s string) string { - return strings.Replace(strings.Title(strings.Replace(strings.ToLower(s), "_", " ", -1)), " ", "", -1) -} - -// CamelCaseToUnderscore converts from camel case form to underscore separated form. -// Ex.: MyFunc => my_func -func CamelCaseToUnderscore(str string) string { - var output []rune - var segment []rune - for _, r := range str { - - // not treat number as separate segment - if !unicode.IsLower(r) && string(r) != "_" && !unicode.IsNumber(r) { - output = addSegment(output, segment) - segment = nil - } - segment = append(segment, unicode.ToLower(r)) - } - output = addSegment(output, segment) - return string(output) -} - -// Reverse returns reversed string -func Reverse(s string) string { - r := []rune(s) - for i, j := 0, len(r)-1; i < j; i, j = i+1, j-1 { - r[i], r[j] = r[j], r[i] - } - return string(r) -} - -// GetLines splits string by "\n" and return array of lines -func GetLines(s string) []string { - return strings.Split(s, "\n") -} - -// GetLine returns specified line of multiline string -func GetLine(s string, index int) (string, error) { - lines := GetLines(s) - if index < 0 || index >= len(lines) { - return "", errors.New("line index out of bounds") - } - return lines[index], nil -} - -// RemoveTags removes all tags from HTML string -func RemoveTags(s string) string { - return ReplacePattern(s, "<[^>]*>", "") -} - -// SafeFileName returns safe string that can be used in file names -func SafeFileName(str string) string { - name := strings.ToLower(str) - name = path.Clean(path.Base(name)) - name = strings.Trim(name, " ") - separators, err := regexp.Compile(`[ &_=+:]`) - if err == nil { - name = separators.ReplaceAllString(name, "-") - } - legal, err := regexp.Compile(`[^[:alnum:]-.]`) - if err == nil { - name = legal.ReplaceAllString(name, "") - } - for strings.Contains(name, "--") { - name = strings.Replace(name, "--", "-", -1) - } - return name -} - -// NormalizeEmail canonicalize an email address. -// The local part of the email address is lowercased for all domains; the hostname is always lowercased and -// the local part of the email address is always lowercased for hosts that are known to be case-insensitive (currently only GMail). -// Normalization follows special rules for known providers: currently, GMail addresses have dots removed in the local part and -// are stripped of tags (e.g. some.one+tag@gmail.com becomes someone@gmail.com) and all @googlemail.com addresses are -// normalized to @gmail.com. -func NormalizeEmail(str string) (string, error) { - if !IsEmail(str) { - return "", fmt.Errorf("%s is not an email", str) - } - parts := strings.Split(str, "@") - parts[0] = strings.ToLower(parts[0]) - parts[1] = strings.ToLower(parts[1]) - if parts[1] == "gmail.com" || parts[1] == "googlemail.com" { - parts[1] = "gmail.com" - parts[0] = strings.Split(ReplacePattern(parts[0], `\.`, ""), "+")[0] - } - return strings.Join(parts, "@"), nil -} - -// Truncate a string to the closest length without breaking words. -func Truncate(str string, length int, ending string) string { - var aftstr, befstr string - if len(str) > length { - words := strings.Fields(str) - before, present := 0, 0 - for i := range words { - befstr = aftstr - before = present - aftstr = aftstr + words[i] + " " - present = len(aftstr) - if present > length && i != 0 { - if (length - before) < (present - length) { - return Trim(befstr, " /\\.,\"'#!?&@+-") + ending - } - return Trim(aftstr, " /\\.,\"'#!?&@+-") + ending - } - } - } - - return str -} - -// PadLeft pads left side of a string if size of string is less then indicated pad length -func PadLeft(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, false) -} - -// PadRight pads right side of a string if size of string is less then indicated pad length -func PadRight(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, false, true) -} - -// PadBoth pads both sides of a string if size of string is less then indicated pad length -func PadBoth(str string, padStr string, padLen int) string { - return buildPadStr(str, padStr, padLen, true, true) -} - -// PadString either left, right or both sides. -// Note that padding string can be unicode and more then one character -func buildPadStr(str string, padStr string, padLen int, padLeft bool, padRight bool) string { - - // When padded length is less then the current string size - if padLen < utf8.RuneCountInString(str) { - return str - } - - padLen -= utf8.RuneCountInString(str) - - targetLen := padLen - - targetLenLeft := targetLen - targetLenRight := targetLen - if padLeft && padRight { - targetLenLeft = padLen / 2 - targetLenRight = padLen - targetLenLeft - } - - strToRepeatLen := utf8.RuneCountInString(padStr) - - repeatTimes := int(math.Ceil(float64(targetLen) / float64(strToRepeatLen))) - repeatedString := strings.Repeat(padStr, repeatTimes) - - leftSide := "" - if padLeft { - leftSide = repeatedString[0:targetLenLeft] - } - - rightSide := "" - if padRight { - rightSide = repeatedString[0:targetLenRight] - } - - return leftSide + str + rightSide -} - -// TruncatingErrorf removes extra args from fmt.Errorf if not formatted in the str object -func TruncatingErrorf(str string, args ...interface{}) error { - n := strings.Count(str, "%s") - return fmt.Errorf(str, args[:n]...) -} diff --git a/vendor/github.com/asaskevich/govalidator/validator.go b/vendor/github.com/asaskevich/govalidator/validator.go deleted file mode 100644 index c9c4fac0655..00000000000 --- a/vendor/github.com/asaskevich/govalidator/validator.go +++ /dev/null @@ -1,1768 +0,0 @@ -// Package govalidator is package of validators and sanitizers for strings, structs and collections. -package govalidator - -import ( - "bytes" - "crypto/rsa" - "crypto/x509" - "encoding/base64" - "encoding/json" - "encoding/pem" - "fmt" - "io/ioutil" - "net" - "net/url" - "reflect" - "regexp" - "sort" - "strconv" - "strings" - "time" - "unicode" - "unicode/utf8" -) - -var ( - fieldsRequiredByDefault bool - nilPtrAllowedByRequired = false - notNumberRegexp = regexp.MustCompile("[^0-9]+") - whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) - paramsRegexp = regexp.MustCompile(`\(.*\)$`) -) - -const maxURLRuneCount = 2083 -const minURLRuneCount = 3 -const rfc3339WithoutZone = "2006-01-02T15:04:05" - -// SetFieldsRequiredByDefault causes validation to fail when struct fields -// do not include validations or are not explicitly marked as exempt (using `valid:"-"` or `valid:"email,optional"`). -// This struct definition will fail govalidator.ValidateStruct() (and the field values do not matter): -// type exampleStruct struct { -// Name string `` -// Email string `valid:"email"` -// This, however, will only fail when Email is empty or an invalid email address: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email"` -// Lastly, this will only fail when Email is an invalid email address but not when it's empty: -// type exampleStruct2 struct { -// Name string `valid:"-"` -// Email string `valid:"email,optional"` -func SetFieldsRequiredByDefault(value bool) { - fieldsRequiredByDefault = value -} - -// SetNilPtrAllowedByRequired causes validation to pass for nil ptrs when a field is set to required. -// The validation will still reject ptr fields in their zero value state. Example with this enabled: -// type exampleStruct struct { -// Name *string `valid:"required"` -// With `Name` set to "", this will be considered invalid input and will cause a validation error. -// With `Name` set to nil, this will be considered valid by validation. -// By default this is disabled. -func SetNilPtrAllowedByRequired(value bool) { - nilPtrAllowedByRequired = value -} - -// IsEmail checks if the string is an email. -func IsEmail(str string) bool { - // TODO uppercase letters are not supported - return rxEmail.MatchString(str) -} - -// IsExistingEmail checks if the string is an email of existing domain -func IsExistingEmail(email string) bool { - - if len(email) < 6 || len(email) > 254 { - return false - } - at := strings.LastIndex(email, "@") - if at <= 0 || at > len(email)-3 { - return false - } - user := email[:at] - host := email[at+1:] - if len(user) > 64 { - return false - } - switch host { - case "localhost", "example.com": - return true - } - if userDotRegexp.MatchString(user) || !userRegexp.MatchString(user) || !hostRegexp.MatchString(host) { - return false - } - if _, err := net.LookupMX(host); err != nil { - if _, err := net.LookupIP(host); err != nil { - return false - } - } - - return true -} - -// IsURL checks if the string is an URL. -func IsURL(str string) bool { - if str == "" || utf8.RuneCountInString(str) >= maxURLRuneCount || len(str) <= minURLRuneCount || strings.HasPrefix(str, ".") { - return false - } - strTemp := str - if strings.Contains(str, ":") && !strings.Contains(str, "://") { - // support no indicated urlscheme but with colon for port number - // http:// is appended so url.Parse will succeed, strTemp used so it does not impact rxURL.MatchString - strTemp = "http://" + str - } - u, err := url.Parse(strTemp) - if err != nil { - return false - } - if strings.HasPrefix(u.Host, ".") { - return false - } - if u.Host == "" && (u.Path != "" && !strings.Contains(u.Path, ".")) { - return false - } - return rxURL.MatchString(str) -} - -// IsRequestURL checks if the string rawurl, assuming -// it was received in an HTTP request, is a valid -// URL confirm to RFC 3986 -func IsRequestURL(rawurl string) bool { - url, err := url.ParseRequestURI(rawurl) - if err != nil { - return false //Couldn't even parse the rawurl - } - if len(url.Scheme) == 0 { - return false //No Scheme found - } - return true -} - -// IsRequestURI checks if the string rawurl, assuming -// it was received in an HTTP request, is an -// absolute URI or an absolute path. -func IsRequestURI(rawurl string) bool { - _, err := url.ParseRequestURI(rawurl) - return err == nil -} - -// IsAlpha checks if the string contains only letters (a-zA-Z). Empty string is valid. -func IsAlpha(str string) bool { - if IsNull(str) { - return true - } - return rxAlpha.MatchString(str) -} - -//IsUTFLetter checks if the string contains only unicode letter characters. -//Similar to IsAlpha but for all languages. Empty string is valid. -func IsUTFLetter(str string) bool { - if IsNull(str) { - return true - } - - for _, c := range str { - if !unicode.IsLetter(c) { - return false - } - } - return true - -} - -// IsAlphanumeric checks if the string contains only letters and numbers. Empty string is valid. -func IsAlphanumeric(str string) bool { - if IsNull(str) { - return true - } - return rxAlphanumeric.MatchString(str) -} - -// IsUTFLetterNumeric checks if the string contains only unicode letters and numbers. Empty string is valid. -func IsUTFLetterNumeric(str string) bool { - if IsNull(str) { - return true - } - for _, c := range str { - if !unicode.IsLetter(c) && !unicode.IsNumber(c) { //letters && numbers are ok - return false - } - } - return true - -} - -// IsNumeric checks if the string contains only numbers. Empty string is valid. -func IsNumeric(str string) bool { - if IsNull(str) { - return true - } - return rxNumeric.MatchString(str) -} - -// IsUTFNumeric checks if the string contains only unicode numbers of any kind. -// Numbers can be 0-9 but also Fractions ¾,Roman Ⅸ and Hangzhou 〩. Empty string is valid. -func IsUTFNumeric(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsNumber(c) { //numbers && minus sign are ok - return false - } - } - return true - -} - -// IsUTFDigit checks if the string contains only unicode radix-10 decimal digits. Empty string is valid. -func IsUTFDigit(str string) bool { - if IsNull(str) { - return true - } - if strings.IndexAny(str, "+-") > 0 { - return false - } - if len(str) > 1 { - str = strings.TrimPrefix(str, "-") - str = strings.TrimPrefix(str, "+") - } - for _, c := range str { - if !unicode.IsDigit(c) { //digits && minus sign are ok - return false - } - } - return true - -} - -// IsHexadecimal checks if the string is a hexadecimal number. -func IsHexadecimal(str string) bool { - return rxHexadecimal.MatchString(str) -} - -// IsHexcolor checks if the string is a hexadecimal color. -func IsHexcolor(str string) bool { - return rxHexcolor.MatchString(str) -} - -// IsRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). -func IsRGBcolor(str string) bool { - return rxRGBcolor.MatchString(str) -} - -// IsLowerCase checks if the string is lowercase. Empty string is valid. -func IsLowerCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToLower(str) -} - -// IsUpperCase checks if the string is uppercase. Empty string is valid. -func IsUpperCase(str string) bool { - if IsNull(str) { - return true - } - return str == strings.ToUpper(str) -} - -// HasLowerCase checks if the string contains at least 1 lowercase. Empty string is valid. -func HasLowerCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasLowerCase.MatchString(str) -} - -// HasUpperCase checks if the string contains as least 1 uppercase. Empty string is valid. -func HasUpperCase(str string) bool { - if IsNull(str) { - return true - } - return rxHasUpperCase.MatchString(str) -} - -// IsInt checks if the string is an integer. Empty string is valid. -func IsInt(str string) bool { - if IsNull(str) { - return true - } - return rxInt.MatchString(str) -} - -// IsFloat checks if the string is a float. -func IsFloat(str string) bool { - return str != "" && rxFloat.MatchString(str) -} - -// IsDivisibleBy checks if the string is a number that's divisible by another. -// If second argument is not valid integer or zero, it's return false. -// Otherwise, if first argument is not valid integer or zero, it's return true (Invalid string converts to zero). -func IsDivisibleBy(str, num string) bool { - f, _ := ToFloat(str) - p := int64(f) - q, _ := ToInt(num) - if q == 0 { - return false - } - return (p == 0) || (p%q == 0) -} - -// IsNull checks if the string is null. -func IsNull(str string) bool { - return len(str) == 0 -} - -// IsNotNull checks if the string is not null. -func IsNotNull(str string) bool { - return !IsNull(str) -} - -// HasWhitespaceOnly checks the string only contains whitespace -func HasWhitespaceOnly(str string) bool { - return len(str) > 0 && rxHasWhitespaceOnly.MatchString(str) -} - -// HasWhitespace checks if the string contains any whitespace -func HasWhitespace(str string) bool { - return len(str) > 0 && rxHasWhitespace.MatchString(str) -} - -// IsByteLength checks if the string's length (in bytes) falls in a range. -func IsByteLength(str string, min, max int) bool { - return len(str) >= min && len(str) <= max -} - -// IsUUIDv3 checks if the string is a UUID version 3. -func IsUUIDv3(str string) bool { - return rxUUID3.MatchString(str) -} - -// IsUUIDv4 checks if the string is a UUID version 4. -func IsUUIDv4(str string) bool { - return rxUUID4.MatchString(str) -} - -// IsUUIDv5 checks if the string is a UUID version 5. -func IsUUIDv5(str string) bool { - return rxUUID5.MatchString(str) -} - -// IsUUID checks if the string is a UUID (version 3, 4 or 5). -func IsUUID(str string) bool { - return rxUUID.MatchString(str) -} - -// Byte to index table for O(1) lookups when unmarshaling. -// We use 0xFF as sentinel value for invalid indexes. -var ulidDec = [...]byte{ - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, 0x15, 0xFF, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0xFF, 0x12, 0x13, 0xFF, 0x14, - 0x15, 0xFF, 0x16, 0x17, 0x18, 0x19, 0x1A, 0xFF, 0x1B, 0x1C, - 0x1D, 0x1E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, -} - -// EncodedSize is the length of a text encoded ULID. -const ulidEncodedSize = 26 - -// IsULID checks if the string is a ULID. -// -// Implementation got from: -// https://github.com/oklog/ulid (Apache-2.0 License) -// -func IsULID(str string) bool { - // Check if a base32 encoded ULID is the right length. - if len(str) != ulidEncodedSize { - return false - } - - // Check if all the characters in a base32 encoded ULID are part of the - // expected base32 character set. - if ulidDec[str[0]] == 0xFF || - ulidDec[str[1]] == 0xFF || - ulidDec[str[2]] == 0xFF || - ulidDec[str[3]] == 0xFF || - ulidDec[str[4]] == 0xFF || - ulidDec[str[5]] == 0xFF || - ulidDec[str[6]] == 0xFF || - ulidDec[str[7]] == 0xFF || - ulidDec[str[8]] == 0xFF || - ulidDec[str[9]] == 0xFF || - ulidDec[str[10]] == 0xFF || - ulidDec[str[11]] == 0xFF || - ulidDec[str[12]] == 0xFF || - ulidDec[str[13]] == 0xFF || - ulidDec[str[14]] == 0xFF || - ulidDec[str[15]] == 0xFF || - ulidDec[str[16]] == 0xFF || - ulidDec[str[17]] == 0xFF || - ulidDec[str[18]] == 0xFF || - ulidDec[str[19]] == 0xFF || - ulidDec[str[20]] == 0xFF || - ulidDec[str[21]] == 0xFF || - ulidDec[str[22]] == 0xFF || - ulidDec[str[23]] == 0xFF || - ulidDec[str[24]] == 0xFF || - ulidDec[str[25]] == 0xFF { - return false - } - - // Check if the first character in a base32 encoded ULID will overflow. This - // happens because the base32 representation encodes 130 bits, while the - // ULID is only 128 bits. - // - // See https://github.com/oklog/ulid/issues/9 for details. - if str[0] > '7' { - return false - } - return true -} - -// IsCreditCard checks if the string is a credit card. -func IsCreditCard(str string) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - if !rxCreditCard.MatchString(sanitized) { - return false - } - - number, _ := ToInt(sanitized) - number, lastDigit := number / 10, number % 10 - - var sum int64 - for i:=0; number > 0; i++ { - digit := number % 10 - - if i % 2 == 0 { - digit *= 2 - if digit > 9 { - digit -= 9 - } - } - - sum += digit - number = number / 10 - } - - return (sum + lastDigit) % 10 == 0 -} - -// IsISBN10 checks if the string is an ISBN version 10. -func IsISBN10(str string) bool { - return IsISBN(str, 10) -} - -// IsISBN13 checks if the string is an ISBN version 13. -func IsISBN13(str string) bool { - return IsISBN(str, 13) -} - -// IsISBN checks if the string is an ISBN (version 10 or 13). -// If version value is not equal to 10 or 13, it will be checks both variants. -func IsISBN(str string, version int) bool { - sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") - var checksum int32 - var i int32 - if version == 10 { - if !rxISBN10.MatchString(sanitized) { - return false - } - for i = 0; i < 9; i++ { - checksum += (i + 1) * int32(sanitized[i]-'0') - } - if sanitized[9] == 'X' { - checksum += 10 * 10 - } else { - checksum += 10 * int32(sanitized[9]-'0') - } - if checksum%11 == 0 { - return true - } - return false - } else if version == 13 { - if !rxISBN13.MatchString(sanitized) { - return false - } - factor := []int32{1, 3} - for i = 0; i < 12; i++ { - checksum += factor[i%2] * int32(sanitized[i]-'0') - } - return (int32(sanitized[12]-'0'))-((10-(checksum%10))%10) == 0 - } - return IsISBN(str, 10) || IsISBN(str, 13) -} - -// IsJSON checks if the string is valid JSON (note: uses json.Unmarshal). -func IsJSON(str string) bool { - var js json.RawMessage - return json.Unmarshal([]byte(str), &js) == nil -} - -// IsMultibyte checks if the string contains one or more multibyte chars. Empty string is valid. -func IsMultibyte(str string) bool { - if IsNull(str) { - return true - } - return rxMultibyte.MatchString(str) -} - -// IsASCII checks if the string contains ASCII chars only. Empty string is valid. -func IsASCII(str string) bool { - if IsNull(str) { - return true - } - return rxASCII.MatchString(str) -} - -// IsPrintableASCII checks if the string contains printable ASCII chars only. Empty string is valid. -func IsPrintableASCII(str string) bool { - if IsNull(str) { - return true - } - return rxPrintableASCII.MatchString(str) -} - -// IsFullWidth checks if the string contains any full-width chars. Empty string is valid. -func IsFullWidth(str string) bool { - if IsNull(str) { - return true - } - return rxFullWidth.MatchString(str) -} - -// IsHalfWidth checks if the string contains any half-width chars. Empty string is valid. -func IsHalfWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) -} - -// IsVariableWidth checks if the string contains a mixture of full and half-width chars. Empty string is valid. -func IsVariableWidth(str string) bool { - if IsNull(str) { - return true - } - return rxHalfWidth.MatchString(str) && rxFullWidth.MatchString(str) -} - -// IsBase64 checks if a string is base64 encoded. -func IsBase64(str string) bool { - return rxBase64.MatchString(str) -} - -// IsFilePath checks is a string is Win or Unix file path and returns it's type. -func IsFilePath(str string) (bool, int) { - if rxWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false, Win - } - return true, Win - } else if rxUnixPath.MatchString(str) { - return true, Unix - } - return false, Unknown -} - -//IsWinFilePath checks both relative & absolute paths in Windows -func IsWinFilePath(str string) bool { - if rxARWinPath.MatchString(str) { - //check windows path limit see: - // http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath - if len(str[3:]) > 32767 { - return false - } - return true - } - return false -} - -//IsUnixFilePath checks both relative & absolute paths in Unix -func IsUnixFilePath(str string) bool { - if rxARUnixPath.MatchString(str) { - return true - } - return false -} - -// IsDataURI checks if a string is base64 encoded data URI such as an image -func IsDataURI(str string) bool { - dataURI := strings.Split(str, ",") - if !rxDataURI.MatchString(dataURI[0]) { - return false - } - return IsBase64(dataURI[1]) -} - -// IsMagnetURI checks if a string is valid magnet URI -func IsMagnetURI(str string) bool { - return rxMagnetURI.MatchString(str) -} - -// IsISO3166Alpha2 checks if a string is valid two-letter country code -func IsISO3166Alpha2(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO3166Alpha3 checks if a string is valid three-letter country code -func IsISO3166Alpha3(str string) bool { - for _, entry := range ISO3166List { - if str == entry.Alpha3Code { - return true - } - } - return false -} - -// IsISO693Alpha2 checks if a string is valid two-letter language code -func IsISO693Alpha2(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha2Code { - return true - } - } - return false -} - -// IsISO693Alpha3b checks if a string is valid three-letter language code -func IsISO693Alpha3b(str string) bool { - for _, entry := range ISO693List { - if str == entry.Alpha3bCode { - return true - } - } - return false -} - -// IsDNSName will validate the given string as a DNS name -func IsDNSName(str string) bool { - if str == "" || len(strings.Replace(str, ".", "", -1)) > 255 { - // constraints already violated - return false - } - return !IsIP(str) && rxDNSName.MatchString(str) -} - -// IsHash checks if a string is a hash of type algorithm. -// Algorithm is one of ['md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'] -func IsHash(str string, algorithm string) bool { - var len string - algo := strings.ToLower(algorithm) - - if algo == "crc32" || algo == "crc32b" { - len = "8" - } else if algo == "md5" || algo == "md4" || algo == "ripemd128" || algo == "tiger128" { - len = "32" - } else if algo == "sha1" || algo == "ripemd160" || algo == "tiger160" { - len = "40" - } else if algo == "tiger192" { - len = "48" - } else if algo == "sha3-224" { - len = "56" - } else if algo == "sha256" || algo == "sha3-256" { - len = "64" - } else if algo == "sha384" || algo == "sha3-384" { - len = "96" - } else if algo == "sha512" || algo == "sha3-512" { - len = "128" - } else { - return false - } - - return Matches(str, "^[a-f0-9]{"+len+"}$") -} - -// IsSHA3224 checks is a string is a SHA3-224 hash. Alias for `IsHash(str, "sha3-224")` -func IsSHA3224(str string) bool { - return IsHash(str, "sha3-224") -} - -// IsSHA3256 checks is a string is a SHA3-256 hash. Alias for `IsHash(str, "sha3-256")` -func IsSHA3256(str string) bool { - return IsHash(str, "sha3-256") -} - -// IsSHA3384 checks is a string is a SHA3-384 hash. Alias for `IsHash(str, "sha3-384")` -func IsSHA3384(str string) bool { - return IsHash(str, "sha3-384") -} - -// IsSHA3512 checks is a string is a SHA3-512 hash. Alias for `IsHash(str, "sha3-512")` -func IsSHA3512(str string) bool { - return IsHash(str, "sha3-512") -} - -// IsSHA512 checks is a string is a SHA512 hash. Alias for `IsHash(str, "sha512")` -func IsSHA512(str string) bool { - return IsHash(str, "sha512") -} - -// IsSHA384 checks is a string is a SHA384 hash. Alias for `IsHash(str, "sha384")` -func IsSHA384(str string) bool { - return IsHash(str, "sha384") -} - -// IsSHA256 checks is a string is a SHA256 hash. Alias for `IsHash(str, "sha256")` -func IsSHA256(str string) bool { - return IsHash(str, "sha256") -} - -// IsTiger192 checks is a string is a Tiger192 hash. Alias for `IsHash(str, "tiger192")` -func IsTiger192(str string) bool { - return IsHash(str, "tiger192") -} - -// IsTiger160 checks is a string is a Tiger160 hash. Alias for `IsHash(str, "tiger160")` -func IsTiger160(str string) bool { - return IsHash(str, "tiger160") -} - -// IsRipeMD160 checks is a string is a RipeMD160 hash. Alias for `IsHash(str, "ripemd160")` -func IsRipeMD160(str string) bool { - return IsHash(str, "ripemd160") -} - -// IsSHA1 checks is a string is a SHA-1 hash. Alias for `IsHash(str, "sha1")` -func IsSHA1(str string) bool { - return IsHash(str, "sha1") -} - -// IsTiger128 checks is a string is a Tiger128 hash. Alias for `IsHash(str, "tiger128")` -func IsTiger128(str string) bool { - return IsHash(str, "tiger128") -} - -// IsRipeMD128 checks is a string is a RipeMD128 hash. Alias for `IsHash(str, "ripemd128")` -func IsRipeMD128(str string) bool { - return IsHash(str, "ripemd128") -} - -// IsCRC32 checks is a string is a CRC32 hash. Alias for `IsHash(str, "crc32")` -func IsCRC32(str string) bool { - return IsHash(str, "crc32") -} - -// IsCRC32b checks is a string is a CRC32b hash. Alias for `IsHash(str, "crc32b")` -func IsCRC32b(str string) bool { - return IsHash(str, "crc32b") -} - -// IsMD5 checks is a string is a MD5 hash. Alias for `IsHash(str, "md5")` -func IsMD5(str string) bool { - return IsHash(str, "md5") -} - -// IsMD4 checks is a string is a MD4 hash. Alias for `IsHash(str, "md4")` -func IsMD4(str string) bool { - return IsHash(str, "md4") -} - -// IsDialString validates the given string for usage with the various Dial() functions -func IsDialString(str string) bool { - if h, p, err := net.SplitHostPort(str); err == nil && h != "" && p != "" && (IsDNSName(h) || IsIP(h)) && IsPort(p) { - return true - } - - return false -} - -// IsIP checks if a string is either IP version 4 or 6. Alias for `net.ParseIP` -func IsIP(str string) bool { - return net.ParseIP(str) != nil -} - -// IsPort checks if a string represents a valid port -func IsPort(str string) bool { - if i, err := strconv.Atoi(str); err == nil && i > 0 && i < 65536 { - return true - } - return false -} - -// IsIPv4 checks if the string is an IP version 4. -func IsIPv4(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ".") -} - -// IsIPv6 checks if the string is an IP version 6. -func IsIPv6(str string) bool { - ip := net.ParseIP(str) - return ip != nil && strings.Contains(str, ":") -} - -// IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) -func IsCIDR(str string) bool { - _, _, err := net.ParseCIDR(str) - return err == nil -} - -// IsMAC checks if a string is valid MAC address. -// Possible MAC formats: -// 01:23:45:67:89:ab -// 01:23:45:67:89:ab:cd:ef -// 01-23-45-67-89-ab -// 01-23-45-67-89-ab-cd-ef -// 0123.4567.89ab -// 0123.4567.89ab.cdef -func IsMAC(str string) bool { - _, err := net.ParseMAC(str) - return err == nil -} - -// IsHost checks if the string is a valid IP (both v4 and v6) or a valid DNS name -func IsHost(str string) bool { - return IsIP(str) || IsDNSName(str) -} - -// IsMongoID checks if the string is a valid hex-encoded representation of a MongoDB ObjectId. -func IsMongoID(str string) bool { - return rxHexadecimal.MatchString(str) && (len(str) == 24) -} - -// IsLatitude checks if a string is valid latitude. -func IsLatitude(str string) bool { - return rxLatitude.MatchString(str) -} - -// IsLongitude checks if a string is valid longitude. -func IsLongitude(str string) bool { - return rxLongitude.MatchString(str) -} - -// IsIMEI checks if a string is valid IMEI -func IsIMEI(str string) bool { - return rxIMEI.MatchString(str) -} - -// IsIMSI checks if a string is valid IMSI -func IsIMSI(str string) bool { - if !rxIMSI.MatchString(str) { - return false - } - - mcc, err := strconv.ParseInt(str[0:3], 10, 32) - if err != nil { - return false - } - - switch mcc { - case 202, 204, 206, 208, 212, 213, 214, 216, 218, 219: - case 220, 221, 222, 226, 228, 230, 231, 232, 234, 235: - case 238, 240, 242, 244, 246, 247, 248, 250, 255, 257: - case 259, 260, 262, 266, 268, 270, 272, 274, 276, 278: - case 280, 282, 283, 284, 286, 288, 289, 290, 292, 293: - case 294, 295, 297, 302, 308, 310, 311, 312, 313, 314: - case 315, 316, 330, 332, 334, 338, 340, 342, 344, 346: - case 348, 350, 352, 354, 356, 358, 360, 362, 363, 364: - case 365, 366, 368, 370, 372, 374, 376, 400, 401, 402: - case 404, 405, 406, 410, 412, 413, 414, 415, 416, 417: - case 418, 419, 420, 421, 422, 424, 425, 426, 427, 428: - case 429, 430, 431, 432, 434, 436, 437, 438, 440, 441: - case 450, 452, 454, 455, 456, 457, 460, 461, 466, 467: - case 470, 472, 502, 505, 510, 514, 515, 520, 525, 528: - case 530, 536, 537, 539, 540, 541, 542, 543, 544, 545: - case 546, 547, 548, 549, 550, 551, 552, 553, 554, 555: - case 602, 603, 604, 605, 606, 607, 608, 609, 610, 611: - case 612, 613, 614, 615, 616, 617, 618, 619, 620, 621: - case 622, 623, 624, 625, 626, 627, 628, 629, 630, 631: - case 632, 633, 634, 635, 636, 637, 638, 639, 640, 641: - case 642, 643, 645, 646, 647, 648, 649, 650, 651, 652: - case 653, 654, 655, 657, 658, 659, 702, 704, 706, 708: - case 710, 712, 714, 716, 722, 724, 730, 732, 734, 736: - case 738, 740, 742, 744, 746, 748, 750, 995: - return true - default: - return false - } - return true -} - -// IsRsaPublicKey checks if a string is valid public key with provided length -func IsRsaPublicKey(str string, keylen int) bool { - bb := bytes.NewBufferString(str) - pemBytes, err := ioutil.ReadAll(bb) - if err != nil { - return false - } - block, _ := pem.Decode(pemBytes) - if block != nil && block.Type != "PUBLIC KEY" { - return false - } - var der []byte - - if block != nil { - der = block.Bytes - } else { - der, err = base64.StdEncoding.DecodeString(str) - if err != nil { - return false - } - } - - key, err := x509.ParsePKIXPublicKey(der) - if err != nil { - return false - } - pubkey, ok := key.(*rsa.PublicKey) - if !ok { - return false - } - bitlen := len(pubkey.N.Bytes()) * 8 - return bitlen == int(keylen) -} - -// IsRegex checks if a give string is a valid regex with RE2 syntax or not -func IsRegex(str string) bool { - if _, err := regexp.Compile(str); err == nil { - return true - } - return false -} - -func toJSONName(tag string) string { - if tag == "" { - return "" - } - - // JSON name always comes first. If there's no options then split[0] is - // JSON name, if JSON name is not set, then split[0] is an empty string. - split := strings.SplitN(tag, ",", 2) - - name := split[0] - - // However it is possible that the field is skipped when - // (de-)serializing from/to JSON, in which case assume that there is no - // tag name to use - if name == "-" { - return "" - } - return name -} - -func prependPathToErrors(err error, path string) error { - switch err2 := err.(type) { - case Error: - err2.Path = append([]string{path}, err2.Path...) - return err2 - case Errors: - errors := err2.Errors() - for i, err3 := range errors { - errors[i] = prependPathToErrors(err3, path) - } - return err2 - } - return err -} - -// ValidateArray performs validation according to condition iterator that validates every element of the array -func ValidateArray(array []interface{}, iterator ConditionIterator) bool { - return Every(array, iterator) -} - -// ValidateMap use validation map for fields. -// result will be equal to `false` if there are any errors. -// s is the map containing the data to be validated. -// m is the validation map in the form: -// map[string]interface{}{"name":"required,alpha","address":map[string]interface{}{"line1":"required,alphanum"}} -func ValidateMap(s map[string]interface{}, m map[string]interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - var errs Errors - var index int - val := reflect.ValueOf(s) - for key, value := range s { - presentResult := true - validator, ok := m[key] - if !ok { - presentResult = false - var err error - err = fmt.Errorf("all map keys has to be present in the validation map; got %s", key) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - valueField := reflect.ValueOf(value) - mapResult := true - typeResult := true - structResult := true - resultField := true - switch subValidator := validator.(type) { - case map[string]interface{}: - var err error - if v, ok := value.(map[string]interface{}); !ok { - mapResult = false - err = fmt.Errorf("map validator has to be for the map type only; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } else { - mapResult, err = ValidateMap(v, subValidator) - if err != nil { - mapResult = false - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - case string: - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - subValidator != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - } - resultField, err = typeCheck(valueField, reflect.StructField{ - Name: key, - PkgPath: "", - Type: val.Type(), - Tag: reflect.StructTag(fmt.Sprintf("%s:%q", tagName, subValidator)), - Offset: 0, - Index: []int{index}, - Anonymous: false, - }, val, nil) - if err != nil { - errs = append(errs, err) - } - case nil: - // already handlerd when checked before - default: - typeResult = false - err = fmt.Errorf("map validator has to be either map[string]interface{} or string; got %s", valueField.Type().String()) - err = prependPathToErrors(err, key) - errs = append(errs, err) - } - result = result && presentResult && typeResult && resultField && structResult && mapResult - index++ - } - // checks required keys - requiredResult := true - for key, value := range m { - if schema, ok := value.(string); ok { - tags := parseTagIntoMap(schema) - if required, ok := tags["required"]; ok { - if _, ok := s[key]; !ok { - requiredResult = false - if required.customErrorMessage != "" { - err = Error{key, fmt.Errorf(required.customErrorMessage), true, "required", []string{}} - } else { - err = Error{key, fmt.Errorf("required field missing"), false, "required", []string{}} - } - errs = append(errs, err) - } - } - } - } - - if len(errs) > 0 { - err = errs - } - return result && requiredResult, err -} - -// ValidateStruct use tags for fields. -// result will be equal to `false` if there are any errors. -// todo currently there is no guarantee that errors will be returned in predictable order (tests may to fail) -func ValidateStruct(s interface{}) (bool, error) { - if s == nil { - return true, nil - } - result := true - var err error - val := reflect.ValueOf(s) - if val.Kind() == reflect.Interface || val.Kind() == reflect.Ptr { - val = val.Elem() - } - // we only accept structs - if val.Kind() != reflect.Struct { - return false, fmt.Errorf("function only accepts structs; got %s", val.Kind()) - } - var errs Errors - for i := 0; i < val.NumField(); i++ { - valueField := val.Field(i) - typeField := val.Type().Field(i) - if typeField.PkgPath != "" { - continue // Private field - } - structResult := true - if valueField.Kind() == reflect.Interface { - valueField = valueField.Elem() - } - if (valueField.Kind() == reflect.Struct || - (valueField.Kind() == reflect.Ptr && valueField.Elem().Kind() == reflect.Struct)) && - typeField.Tag.Get(tagName) != "-" { - var err error - structResult, err = ValidateStruct(valueField.Interface()) - if err != nil { - err = prependPathToErrors(err, typeField.Name) - errs = append(errs, err) - } - } - resultField, err2 := typeCheck(valueField, typeField, val, nil) - if err2 != nil { - - // Replace structure name with JSON name if there is a tag on the variable - jsonTag := toJSONName(typeField.Tag.Get("json")) - if jsonTag != "" { - switch jsonError := err2.(type) { - case Error: - jsonError.Name = jsonTag - err2 = jsonError - case Errors: - for i2, err3 := range jsonError { - switch customErr := err3.(type) { - case Error: - customErr.Name = jsonTag - jsonError[i2] = customErr - } - } - - err2 = jsonError - } - } - - errs = append(errs, err2) - } - result = result && resultField && structResult - } - if len(errs) > 0 { - err = errs - } - return result, err -} - -// ValidateStructAsync performs async validation of the struct and returns results through the channels -func ValidateStructAsync(s interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateStruct(s) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// ValidateMapAsync performs async validation of the map and returns results through the channels -func ValidateMapAsync(s map[string]interface{}, m map[string]interface{}) (<-chan bool, <-chan error) { - res := make(chan bool) - errors := make(chan error) - - go func() { - defer close(res) - defer close(errors) - - isValid, isFailed := ValidateMap(s, m) - - res <- isValid - errors <- isFailed - }() - - return res, errors -} - -// parseTagIntoMap parses a struct tag `valid:required~Some error message,length(2|3)` into map[string]string{"required": "Some error message", "length(2|3)": ""} -func parseTagIntoMap(tag string) tagOptionsMap { - optionsMap := make(tagOptionsMap) - options := strings.Split(tag, ",") - - for i, option := range options { - option = strings.TrimSpace(option) - - validationOptions := strings.Split(option, "~") - if !isValidTag(validationOptions[0]) { - continue - } - if len(validationOptions) == 2 { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], validationOptions[1], i} - } else { - optionsMap[validationOptions[0]] = tagOption{validationOptions[0], "", i} - } - } - return optionsMap -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("\\'\"!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - default: - if !unicode.IsLetter(c) && !unicode.IsDigit(c) { - return false - } - } - } - return true -} - -// IsSSN will validate the given string as a U.S. Social Security Number -func IsSSN(str string) bool { - if str == "" || len(str) != 11 { - return false - } - return rxSSN.MatchString(str) -} - -// IsSemver checks if string is valid semantic version -func IsSemver(str string) bool { - return rxSemver.MatchString(str) -} - -// IsType checks if interface is of some type -func IsType(v interface{}, params ...string) bool { - if len(params) == 1 { - typ := params[0] - return strings.Replace(reflect.TypeOf(v).String(), " ", "", -1) == strings.Replace(typ, " ", "", -1) - } - return false -} - -// IsTime checks if string is valid according to given format -func IsTime(str string, format string) bool { - _, err := time.Parse(format, str) - return err == nil -} - -// IsUnixTime checks if string is valid unix timestamp value -func IsUnixTime(str string) bool { - if _, err := strconv.Atoi(str); err == nil { - return true - } - return false -} - -// IsRFC3339 checks if string is valid timestamp value according to RFC3339 -func IsRFC3339(str string) bool { - return IsTime(str, time.RFC3339) -} - -// IsRFC3339WithoutZone checks if string is valid timestamp value according to RFC3339 which excludes the timezone. -func IsRFC3339WithoutZone(str string) bool { - return IsTime(str, rfc3339WithoutZone) -} - -// IsISO4217 checks if string is valid ISO currency code -func IsISO4217(str string) bool { - for _, currency := range ISO4217List { - if str == currency { - return true - } - } - - return false -} - -// ByteLength checks string's length -func ByteLength(str string, params ...string) bool { - if len(params) == 2 { - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return len(str) >= int(min) && len(str) <= int(max) - } - - return false -} - -// RuneLength checks string's length -// Alias for StringLength -func RuneLength(str string, params ...string) bool { - return StringLength(str, params...) -} - -// IsRsaPub checks whether string is valid RSA key -// Alias for IsRsaPublicKey -func IsRsaPub(str string, params ...string) bool { - if len(params) == 1 { - len, _ := ToInt(params[0]) - return IsRsaPublicKey(str, int(len)) - } - - return false -} - -// StringMatches checks if a string matches a given pattern. -func StringMatches(s string, params ...string) bool { - if len(params) == 1 { - pattern := params[0] - return Matches(s, pattern) - } - return false -} - -// StringLength checks string's length (including multi byte strings) -func StringLength(str string, params ...string) bool { - - if len(params) == 2 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - max, _ := ToInt(params[1]) - return strLength >= int(min) && strLength <= int(max) - } - - return false -} - -// MinStringLength checks string's minimum length (including multi byte strings) -func MinStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - min, _ := ToInt(params[0]) - return strLength >= int(min) - } - - return false -} - -// MaxStringLength checks string's maximum length (including multi byte strings) -func MaxStringLength(str string, params ...string) bool { - - if len(params) == 1 { - strLength := utf8.RuneCountInString(str) - max, _ := ToInt(params[0]) - return strLength <= int(max) - } - - return false -} - -// Range checks string's length -func Range(str string, params ...string) bool { - if len(params) == 2 { - value, _ := ToFloat(str) - min, _ := ToFloat(params[0]) - max, _ := ToFloat(params[1]) - return InRange(value, min, max) - } - - return false -} - -// IsInRaw checks if string is in list of allowed values -func IsInRaw(str string, params ...string) bool { - if len(params) == 1 { - rawParams := params[0] - - parsedParams := strings.Split(rawParams, "|") - - return IsIn(str, parsedParams...) - } - - return false -} - -// IsIn checks if string str is a member of the set of strings params -func IsIn(str string, params ...string) bool { - for _, param := range params { - if str == param { - return true - } - } - - return false -} - -func checkRequired(v reflect.Value, t reflect.StructField, options tagOptionsMap) (bool, error) { - if nilPtrAllowedByRequired { - k := v.Kind() - if (k == reflect.Ptr || k == reflect.Interface) && v.IsNil() { - return true, nil - } - } - - if requiredOption, isRequired := options["required"]; isRequired { - if len(requiredOption.customErrorMessage) > 0 { - return false, Error{t.Name, fmt.Errorf(requiredOption.customErrorMessage), true, "required", []string{}} - } - return false, Error{t.Name, fmt.Errorf("non zero value required"), false, "required", []string{}} - } else if _, isOptional := options["optional"]; fieldsRequiredByDefault && !isOptional { - return false, Error{t.Name, fmt.Errorf("Missing required field"), false, "required", []string{}} - } - // not required and empty is valid - return true, nil -} - -func typeCheck(v reflect.Value, t reflect.StructField, o reflect.Value, options tagOptionsMap) (isValid bool, resultErr error) { - if !v.IsValid() { - return false, nil - } - - tag := t.Tag.Get(tagName) - - // checks if the field should be ignored - switch tag { - case "": - if v.Kind() != reflect.Slice && v.Kind() != reflect.Map { - if !fieldsRequiredByDefault { - return true, nil - } - return false, Error{t.Name, fmt.Errorf("All fields are required to at least have one validation defined"), false, "required", []string{}} - } - case "-": - return true, nil - } - - isRootType := false - if options == nil { - isRootType = true - options = parseTagIntoMap(tag) - } - - if isEmptyValue(v) { - // an empty value is not validated, checks only required - isValid, resultErr = checkRequired(v, t, options) - for key := range options { - delete(options, key) - } - return isValid, resultErr - } - - var customTypeErrors Errors - optionsOrder := options.orderedKeys() - for _, validatorName := range optionsOrder { - validatorStruct := options[validatorName] - if validatefunc, ok := CustomTypeTagMap.Get(validatorName); ok { - delete(options, validatorName) - - if result := validatefunc(v.Interface(), o.Interface()); !result { - if len(validatorStruct.customErrorMessage) > 0 { - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: TruncatingErrorf(validatorStruct.customErrorMessage, fmt.Sprint(v), validatorName), CustomErrorMessageExists: true, Validator: stripParams(validatorName)}) - continue - } - customTypeErrors = append(customTypeErrors, Error{Name: t.Name, Err: fmt.Errorf("%s does not validate as %s", fmt.Sprint(v), validatorName), CustomErrorMessageExists: false, Validator: stripParams(validatorName)}) - } - } - } - - if len(customTypeErrors.Errors()) > 0 { - return false, customTypeErrors - } - - if isRootType { - // Ensure that we've checked the value by all specified validators before report that the value is valid - defer func() { - delete(options, "optional") - delete(options, "required") - - if isValid && resultErr == nil && len(options) != 0 { - optionsOrder := options.orderedKeys() - for _, validator := range optionsOrder { - isValid = false - resultErr = Error{t.Name, fmt.Errorf( - "The following validator is invalid or can't be applied to the field: %q", validator), false, stripParams(validator), []string{}} - return - } - } - }() - } - - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for interface param validators - for key, value := range InterfaceParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := InterfaceParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - field := fmt.Sprint(v) - if result := validatefunc(v.Interface(), ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - } - } - - switch v.Kind() { - case reflect.Bool, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr, - reflect.Float32, reflect.Float64, - reflect.String: - // for each tag option checks the map of validator functions - for _, validatorSpec := range optionsOrder { - validatorStruct := options[validatorSpec] - var negate bool - validator := validatorSpec - customMsgExists := len(validatorStruct.customErrorMessage) > 0 - - // checks whether the tag looks like '!something' or 'something' - if validator[0] == '!' { - validator = validator[1:] - negate = true - } - - // checks for param validators - for key, value := range ParamTagRegexMap { - ps := value.FindStringSubmatch(validator) - if len(ps) == 0 { - continue - } - - validatefunc, ok := ParamTagMap[key] - if !ok { - continue - } - - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field, ps[1:]...); (!result && !negate) || (result && negate) { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - // type not yet supported, fail - return false, Error{t.Name, fmt.Errorf("Validator %s doesn't support kind %s", validator, v.Kind()), false, stripParams(validatorSpec), []string{}} - } - } - - if validatefunc, ok := TagMap[validator]; ok { - delete(options, validatorSpec) - - switch v.Kind() { - case reflect.String, - reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, - reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, - reflect.Float32, reflect.Float64: - field := fmt.Sprint(v) // make value into string, then validate with regex - if result := validatefunc(field); !result && !negate || result && negate { - if customMsgExists { - return false, Error{t.Name, TruncatingErrorf(validatorStruct.customErrorMessage, field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - if negate { - return false, Error{t.Name, fmt.Errorf("%s does validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - return false, Error{t.Name, fmt.Errorf("%s does not validate as %s", field, validator), customMsgExists, stripParams(validatorSpec), []string{}} - } - default: - //Not Yet Supported Types (Fail here!) - err := fmt.Errorf("Validator %s doesn't support kind %s for value %v", validator, v.Kind(), v) - return false, Error{t.Name, err, false, stripParams(validatorSpec), []string{}} - } - } - } - return true, nil - case reflect.Map: - if v.Type().Key().Kind() != reflect.String { - return false, &UnsupportedTypeError{v.Type()} - } - var sv stringValues - sv = v.MapKeys() - sort.Sort(sv) - result := true - for i, k := range sv { - var resultItem bool - var err error - if v.MapIndex(k).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.MapIndex(k), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.MapIndex(k).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+sv[i].Interface().(string)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Slice, reflect.Array: - result := true - for i := 0; i < v.Len(); i++ { - var resultItem bool - var err error - if v.Index(i).Kind() != reflect.Struct { - resultItem, err = typeCheck(v.Index(i), t, o, options) - if err != nil { - return false, err - } - } else { - resultItem, err = ValidateStruct(v.Index(i).Interface()) - if err != nil { - err = prependPathToErrors(err, t.Name+"."+strconv.Itoa(i)) - return false, err - } - } - result = result && resultItem - } - return result, nil - case reflect.Interface: - // If the value is an interface then encode its element - if v.IsNil() { - return true, nil - } - return ValidateStruct(v.Interface()) - case reflect.Ptr: - // If the value is a pointer then checks its element - if v.IsNil() { - return true, nil - } - return typeCheck(v.Elem(), t, o, options) - case reflect.Struct: - return true, nil - default: - return false, &UnsupportedTypeError{v.Type()} - } -} - -func stripParams(validatorString string) string { - return paramsRegexp.ReplaceAllString(validatorString, "") -} - -// isEmptyValue checks whether value empty or not -func isEmptyValue(v reflect.Value) bool { - switch v.Kind() { - case reflect.String, reflect.Array: - return v.Len() == 0 - case reflect.Map, reflect.Slice: - return v.Len() == 0 || v.IsNil() - case reflect.Bool: - return !v.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v.Uint() == 0 - case reflect.Float32, reflect.Float64: - return v.Float() == 0 - case reflect.Interface, reflect.Ptr: - return v.IsNil() - } - - return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()).Interface()) -} - -// ErrorByField returns error for specified field of the struct -// validated by ValidateStruct or empty string if there are no errors -// or this field doesn't exists or doesn't have any errors. -func ErrorByField(e error, field string) string { - if e == nil { - return "" - } - return ErrorsByField(e)[field] -} - -// ErrorsByField returns map of errors of the struct validated -// by ValidateStruct or empty map if there are no errors. -func ErrorsByField(e error) map[string]string { - m := make(map[string]string) - if e == nil { - return m - } - // prototype for ValidateStruct - - switch e := e.(type) { - case Error: - m[e.Name] = e.Err.Error() - case Errors: - for _, item := range e.Errors() { - n := ErrorsByField(item) - for k, v := range n { - m[k] = v - } - } - } - - return m -} - -// Error returns string equivalent for reflect.Type -func (e *UnsupportedTypeError) Error() string { - return "validator: unsupported type: " + e.Type.String() -} - -func (sv stringValues) Len() int { return len(sv) } -func (sv stringValues) Swap(i, j int) { sv[i], sv[j] = sv[j], sv[i] } -func (sv stringValues) Less(i, j int) bool { return sv.get(i) < sv.get(j) } -func (sv stringValues) get(i int) string { return sv[i].String() } - -func IsE164(str string) bool { - return rxE164.MatchString(str) -} diff --git a/vendor/github.com/asaskevich/govalidator/wercker.yml b/vendor/github.com/asaskevich/govalidator/wercker.yml deleted file mode 100644 index bc5f7b0864b..00000000000 --- a/vendor/github.com/asaskevich/govalidator/wercker.yml +++ /dev/null @@ -1,15 +0,0 @@ -box: golang -build: - steps: - - setup-go-workspace - - - script: - name: go get - code: | - go version - go get -t ./... - - - script: - name: go test - code: | - go test -race -v ./... diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go index 4ad2ee4405d..9f94cfe0046 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/credentials.go @@ -118,6 +118,10 @@ const ( CredentialSourceHTTP // CredentialSourceIMDS credentials resolved from the instance metadata service (IMDS) CredentialSourceIMDS + // CredentialSourceProfileLogin credentials resolved from an `aws login` session sourced from a profile + CredentialSourceProfileLogin + // CredentialSourceLogin credentials resolved from an `aws login` session + CredentialSourceLogin ) // A Credentials is the AWS credentials value for individual credential fields. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go index 1820ff0fba3..c9d0bdc4cd0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go @@ -3,4 +3,4 @@ package aws // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.39.2" +const goModuleVersion = "1.41.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go index 3314230fd8c..157a71505cd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/middleware/user_agent.go @@ -137,6 +137,9 @@ const ( UserAgentFeatureCredentialsIMDS = "0" UserAgentFeatureBearerServiceEnvVars = "3" + + UserAgentFeatureCredentialsProfileLogin = "AC" + UserAgentFeatureCredentialsLogin = "AD" ) var credentialSourceToFeature = map[aws.CredentialSource]UserAgentFeature{ @@ -160,6 +163,8 @@ var credentialSourceToFeature = map[aws.CredentialSource]UserAgentFeature{ aws.CredentialSourceProcess: UserAgentFeatureCredentialsProcess, aws.CredentialSourceHTTP: UserAgentFeatureCredentialsHTTP, aws.CredentialSourceIMDS: UserAgentFeatureCredentialsIMDS, + aws.CredentialSourceProfileLogin: UserAgentFeatureCredentialsProfileLogin, + aws.CredentialSourceLogin: UserAgentFeatureCredentialsLogin, } // RequestUserAgent is a build middleware that set the User-Agent for the request. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go index 8d7c35a9ec8..c7ef0acc4d2 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/client.go @@ -18,6 +18,7 @@ var ( // Default connection pool options DefaultHTTPTransportMaxIdleConns = 100 DefaultHTTPTransportMaxIdleConnsPerHost = 10 + DefaultHTTPTransportMaxConnsPerHost = 2048 // Default connection timeouts DefaultHTTPTransportIdleConnTimeout = 90 * time.Second @@ -186,6 +187,7 @@ func defaultHTTPTransport() *http.Transport { TLSHandshakeTimeout: DefaultHTTPTransportTLSHandleshakeTimeout, MaxIdleConns: DefaultHTTPTransportMaxIdleConns, MaxIdleConnsPerHost: DefaultHTTPTransportMaxIdleConnsPerHost, + MaxConnsPerHost: DefaultHTTPTransportMaxConnsPerHost, IdleConnTimeout: DefaultHTTPTransportIdleConnTimeout, ExpectContinueTimeout: DefaultHTTPTransportExpectContinueTimeout, ForceAttemptHTTP2: true, diff --git a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go index 993929bd9b7..4881ae1445b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/aws/transport/http/timeout_read_closer.go @@ -64,6 +64,11 @@ func (r *timeoutReadCloser) Close() error { // AddResponseReadTimeoutMiddleware adds a middleware to the stack that wraps the // response body so that a read that takes too long will return an error. +// +// Deprecated: This API was previously exposed to customize behavior of the +// Kinesis service. That customization has been removed and this middleware's +// implementation can cause panics within the standard library networking loop. +// See #2752. func AddResponseReadTimeoutMiddleware(stack *middleware.Stack, duration time.Duration) error { return stack.Deserialize.Add(&readTimeout{duration: duration}, middleware.After) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md index 526537b8bb7..0d9b296e1d4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/CHANGELOG.md @@ -1,3 +1,67 @@ +# v1.32.5 (2025-12-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.4 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.3 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.32.2 (2025-11-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.1 (2025-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.32.0 (2025-11-19.2) + +* **Feature**: Add support for AWS Login credentials (package credentials/logincreds) to the default credential chain. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.21 (2025-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.20 (2025-11-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.19 (2025-11-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.18 (2025-11-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.17 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.31.16 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.15 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.14 (2025-10-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.31.13 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.31.12 (2025-09-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go index 8274236780f..bb9399d5f3c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/go_module_metadata.go @@ -3,4 +3,4 @@ package config // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.31.12" +const goModuleVersion = "1.32.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go index b00259df03a..de839859991 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/resolve_credentials.go @@ -13,10 +13,12 @@ import ( "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds" "github.com/aws/aws-sdk-go-v2/credentials/endpointcreds" + "github.com/aws/aws-sdk-go-v2/credentials/logincreds" "github.com/aws/aws-sdk-go-v2/credentials/processcreds" "github.com/aws/aws-sdk-go-v2/credentials/ssocreds" "github.com/aws/aws-sdk-go-v2/credentials/stscreds" "github.com/aws/aws-sdk-go-v2/feature/ec2/imds" + "github.com/aws/aws-sdk-go-v2/service/signin" "github.com/aws/aws-sdk-go-v2/service/sso" "github.com/aws/aws-sdk-go-v2/service/ssooidc" "github.com/aws/aws-sdk-go-v2/service/sts" @@ -172,7 +174,10 @@ func resolveCredsFromProfile(ctx context.Context, cfg *aws.Config, envConfig *En ctx = addCredentialSource(ctx, aws.CredentialSourceProfileSSO) } err = resolveSSOCredentials(ctx, cfg, sharedConfig, configs) - + case len(sharedConfig.LoginSession) > 0: + ctx = addCredentialSource(ctx, aws.CredentialSourceProfileLogin) + ctx = addCredentialSource(ctx, aws.CredentialSourceLogin) + err = resolveLoginCredentials(ctx, cfg, sharedConfig, configs) case len(sharedConfig.CredentialProcess) != 0: // Get credentials from CredentialProcess ctx = addCredentialSource(ctx, aws.CredentialSourceProfileProcess) @@ -625,3 +630,21 @@ func addCredentialSource(ctx context.Context, source aws.CredentialSource) conte func getCredentialSources(ctx context.Context) []aws.CredentialSource { return ctx.Value(credentialSource{}).([]aws.CredentialSource) } + +func resolveLoginCredentials(ctx context.Context, cfg *aws.Config, sharedCfg *SharedConfig, configs configs) error { + cacheDir := os.Getenv("AWS_LOGIN_CACHE_DIRECTORY") + tokenPath, err := logincreds.StandardCachedTokenFilepath(sharedCfg.LoginSession, cacheDir) + if err != nil { + return err + } + + svc := signin.NewFromConfig(*cfg) + provider := logincreds.New(svc, tokenPath, func(o *logincreds.Options) { + o.CredentialSources = getCredentialSources(ctx) + }) + cfg.Credentials, err = wrapWithCredentialsCache(ctx, configs, provider) + if err != nil { + return err + } + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go index 97be3f75694..5a0fea22200 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/config/shared_config.go @@ -125,6 +125,8 @@ const ( checksumWhenRequired = "when_required" authSchemePreferenceKey = "auth_scheme_preference" + + loginSessionKey = "login_session" ) // defaultSharedConfigProfile allows for swapping the default profile for testing @@ -362,6 +364,9 @@ type SharedConfig struct { // Priority list of preferred auth scheme names (e.g. sigv4a). AuthSchemePreference []string + + // Session ARN from an `aws login` session. + LoginSession string } func (c SharedConfig) getDefaultsMode(ctx context.Context) (value aws.DefaultsMode, ok bool, err error) { @@ -897,6 +902,8 @@ func mergeSections(dst *ini.Sections, src ini.Sections) error { ssoStartURLKey, authSchemePreferenceKey, + + loginSessionKey, } for i := range stringKeys { if err := mergeStringKey(&srcSection, &dstSection, sectionName, stringKeys[i]); err != nil { @@ -1175,6 +1182,8 @@ func (c *SharedConfig) setFromIniSection(profile string, section ini.Section) er c.AuthSchemePreference = toAuthSchemePreferenceList(section.String(authSchemePreferenceKey)) + updateString(&c.LoginSession, section, loginSessionKey) + return nil } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md index 015f24d3be7..bf3fa5a1f11 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/CHANGELOG.md @@ -1,3 +1,67 @@ +# v1.19.5 (2025-12-09) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.4 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.3 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.19.2 (2025-11-25) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.1 (2025-11-21) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.19.0 (2025-11-19.2) + +* **Feature**: Add support for AWS Login credentials (package credentials/logincreds) to the default credential chain. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.25 (2025-11-19) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.24 (2025-11-12) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.23 (2025-11-11) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.22 (2025-11-10) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.21 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.18.20 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.19 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.18 (2025-10-22) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.17 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.18.16 (2025-09-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go index 03357b7603e..f5397194143 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/go_module_metadata.go @@ -3,4 +3,4 @@ package credentials // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.16" +const goModuleVersion = "1.19.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/dpop.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/dpop.go new file mode 100644 index 00000000000..6dc0845fdfd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/dpop.go @@ -0,0 +1,150 @@ +package logincreds + +import ( + "context" + "crypto/ecdsa" + cryptorand "crypto/rand" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/json" + "encoding/pem" + "fmt" + + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/signin" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// AWS signin DPOP always uses the P256 curve +const curvelen = 256 / 8 // bytes + +// https://datatracker.ietf.org/doc/html/rfc9449 +func mkdpop(token *loginToken, htu string) (string, error) { + key, err := parseKey(token.DPOPKey) + if err != nil { + return "", fmt.Errorf("parse key: %w", err) + } + + header, err := jsonb64(&dpopHeader{ + Typ: "dpop+jwt", + Alg: "ES256", + Jwk: &dpopHeaderJwk{ + Kty: "EC", + X: base64.RawURLEncoding.EncodeToString(key.X.Bytes()), + Y: base64.RawURLEncoding.EncodeToString(key.Y.Bytes()), + Crv: "P-256", + }, + }) + if err != nil { + return "", fmt.Errorf("marshal header: %w", err) + } + + uuid, err := smithyrand.NewUUID(cryptorand.Reader).GetUUID() + if err != nil { + return "", fmt.Errorf("uuid: %w", err) + } + + payload, err := jsonb64(&dpopPayload{ + Jti: uuid, + Htm: "POST", + Htu: htu, + Iat: sdk.NowTime().Unix(), + }) + if err != nil { + return "", fmt.Errorf("marshal payload: %w", err) + } + + msg := fmt.Sprintf("%s.%s", header, payload) + + h := sha256.New() + h.Write([]byte(msg)) + + r, s, err := ecdsa.Sign(cryptorand.Reader, key, h.Sum(nil)) + if err != nil { + return "", fmt.Errorf("sign: %w", err) + } + + // DPOP signatures are formatted in RAW r || s form (with each value padded + // to fit in curve size which in our case is always the 256 bits) - rather + // than encoded in something like asn.1 + sig := make([]byte, curvelen*2) + r.FillBytes(sig[0:curvelen]) + s.FillBytes(sig[curvelen:]) + + dpop := fmt.Sprintf("%s.%s", msg, base64.RawURLEncoding.EncodeToString(sig)) + return dpop, nil +} + +func parseKey(pemBlock string) (*ecdsa.PrivateKey, error) { + block, _ := pem.Decode([]byte(pemBlock)) + priv, err := x509.ParseECPrivateKey(block.Bytes) + if err != nil { + return nil, fmt.Errorf("parse ec private key: %w", err) + } + + return priv, nil +} + +func jsonb64(v any) (string, error) { + j, err := json.MarshalIndent(v, "", " ") + if err != nil { + return "", err + } + + return base64.RawURLEncoding.EncodeToString(j), nil +} + +type dpopHeader struct { + Typ string `json:"typ"` + Alg string `json:"alg"` + Jwk *dpopHeaderJwk `json:"jwk"` +} + +type dpopHeaderJwk struct { + Kty string `json:"kty"` + X string `json:"x"` + Y string `json:"y"` + Crv string `json:"crv"` +} + +type dpopPayload struct { + Jti string `json:"jti"` + Htm string `json:"htm"` + Htu string `json:"htu"` + Iat int64 `json:"iat"` +} + +type signDPOP struct { + Token *loginToken +} + +func addSignDPOP(token *loginToken) func(o *signin.Options) { + return signin.WithAPIOptions(func(stack *middleware.Stack) error { + return stack.Finalize.Add(&signDPOP{token}, middleware.After) + }) +} + +func (*signDPOP) ID() string { + return "signDPOP" +} + +func (m *signDPOP) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, md middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, md, fmt.Errorf("unexpected transport type %T", req) + } + + dpop, err := mkdpop(m.Token, req.URL.String()) + if err != nil { + return out, md, fmt.Errorf("sign dpop: %w", err) + } + + req.Header.Set("DPoP", dpop) + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/file.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/file.go new file mode 100644 index 00000000000..6cd5281d49f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/file.go @@ -0,0 +1,14 @@ +package logincreds + +import ( + "io" + "os" +) + +var openFile func(string) (io.ReadCloser, error) = func(name string) (io.ReadCloser, error) { + return os.Open(name) +} + +var createFile func(string) (io.WriteCloser, error) = func(name string) (io.WriteCloser, error) { + return os.Create(name) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go new file mode 100644 index 00000000000..3e6357b87c7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/provider.go @@ -0,0 +1,172 @@ +// Package logincreds implements AWS credential provision for sessions created +// via an `aws login` command. +package logincreds + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "os" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/service/signin" + "github.com/aws/aws-sdk-go-v2/service/signin/types" +) + +// ProviderName identifies the login provider. +const ProviderName = "LoginProvider" + +// TokenAPIClient provides the interface for the login session's token +// retrieval operation. +type TokenAPIClient interface { + CreateOAuth2Token(context.Context, *signin.CreateOAuth2TokenInput, ...func(*signin.Options)) (*signin.CreateOAuth2TokenOutput, error) +} + +// Provider supplies credentials for an `aws login` session. +type Provider struct { + options Options +} + +var _ aws.CredentialsProvider = (*Provider)(nil) + +// Options configures the Provider. +type Options struct { + Client TokenAPIClient + + // APIOptions to pass to the underlying CreateOAuth2Token operation. + ClientOptions []func(*signin.Options) + + // The path to the cached login token. + CachedTokenFilepath string + + // The chain of providers that was used to create this provider. + // + // These values are for reporting purposes and are not meant to be set up + // directly. + CredentialSources []aws.CredentialSource +} + +// New returns a new login session credentials provider. +func New(client TokenAPIClient, path string, opts ...func(*Options)) *Provider { + options := Options{ + Client: client, + CachedTokenFilepath: path, + } + + for _, opt := range opts { + opt(&options) + } + + return &Provider{options} +} + +// Retrieve generates a new set of temporary credentials using an `aws login` +// session. +func (p *Provider) Retrieve(ctx context.Context) (aws.Credentials, error) { + token, err := p.loadToken() + if err != nil { + return aws.Credentials{}, fmt.Errorf("load login token: %w", err) + } + if err := token.Validate(); err != nil { + return aws.Credentials{}, fmt.Errorf("validate login token: %w", err) + } + + // the token may have been refreshed elsewhere or the login session might + // have just been created + if sdk.NowTime().Before(token.AccessToken.ExpiresAt) { + return token.Credentials(), nil + } + + opts := make([]func(*signin.Options), len(p.options.ClientOptions)+1) + opts[0] = addSignDPOP(token) + copy(opts[1:], p.options.ClientOptions) + + out, err := p.options.Client.CreateOAuth2Token(ctx, &signin.CreateOAuth2TokenInput{ + TokenInput: &types.CreateOAuth2TokenRequestBody{ + ClientId: aws.String(token.ClientID), + GrantType: aws.String("refresh_token"), + RefreshToken: aws.String(token.RefreshToken), + }, + }, opts...) + if err != nil { + var terr *types.AccessDeniedException + if errors.As(err, &terr) { + err = toAccessDeniedError(terr) + } + return aws.Credentials{}, fmt.Errorf("create oauth2 token: %w", err) + } + + token.Update(out) + if err := p.saveToken(token); err != nil { + return aws.Credentials{}, fmt.Errorf("save token: %w", err) + } + + return token.Credentials(), nil +} + +// ProviderSources returns the credential chain that was used to construct this +// provider. +func (p *Provider) ProviderSources() []aws.CredentialSource { + if p.options.CredentialSources == nil { + return []aws.CredentialSource{aws.CredentialSourceLogin} + } + return p.options.CredentialSources +} + +func (p *Provider) loadToken() (*loginToken, error) { + f, err := openFile(p.options.CachedTokenFilepath) + if err != nil && os.IsNotExist(err) { + return nil, fmt.Errorf("token file not found, please reauthenticate") + } + if err != nil { + return nil, err + } + defer f.Close() + + j, err := io.ReadAll(f) + if err != nil { + return nil, err + } + + var t *loginToken + if err := json.Unmarshal(j, &t); err != nil { + return nil, err + } + + return t, nil +} + +func (p *Provider) saveToken(token *loginToken) error { + j, err := json.Marshal(token) + if err != nil { + return err + } + + f, err := createFile(p.options.CachedTokenFilepath) + if err != nil { + return err + } + defer f.Close() + + if _, err := f.Write(j); err != nil { + return err + } + + return nil +} + +func toAccessDeniedError(err *types.AccessDeniedException) error { + switch err.Error_ { + case types.OAuth2ErrorCodeTokenExpired: + return fmt.Errorf("login session has expired, please reauthenticate") + case types.OAuth2ErrorCodeUserCredentialsChanged: + return fmt.Errorf("login session password has changed, please reauthenticate") + case types.OAuth2ErrorCodeInsufficientPermissions: + return fmt.Errorf("insufficient permissions, you may be missing permissions for the CreateOAuth2Token action") + default: + return err + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go new file mode 100644 index 00000000000..1a97b98cdc2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/credentials/logincreds/token.go @@ -0,0 +1,110 @@ +package logincreds + +import ( + "crypto/sha256" + "encoding/hex" + "errors" + "fmt" + "path/filepath" + "strings" + "time" + + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/sdk" + "github.com/aws/aws-sdk-go-v2/internal/shareddefaults" + "github.com/aws/aws-sdk-go-v2/service/signin" +) + +var userHomeDir = shareddefaults.UserHomeDir + +// StandardCachedTokenFilepath returns the filepath for the cached login token +// file. Key that will be used to compute a SHA256 value that is hex encoded. +// +// An overriden root dir can be provided, if not set the path defaults to +// ~/.aws/sso/cache. +func StandardCachedTokenFilepath(session, dir string) (string, error) { + session = strings.TrimSpace(session) + + if len(dir) == 0 { + dir = userHomeDir() + if len(dir) == 0 { + return "", errors.New("user home dir is blank") + } + dir = filepath.Join(dir, ".aws", "login", "cache") + } + + h := sha256.New() + h.Write([]byte(session)) + + filename := strings.ToLower(hex.EncodeToString(h.Sum(nil))) + ".json" + return filepath.Join(dir, filename), nil +} + +// contents of the token as they appear on disk +type loginToken struct { + AccessToken *loginTokenAccessToken `json:"accessToken"` + TokenType string `json:"tokenType"` + RefreshToken string `json:"refreshToken"` + IdentityToken string `json:"identityToken"` + ClientID string `json:"clientId"` + DPOPKey string `json:"dpopKey"` +} + +type loginTokenAccessToken struct { + AccessKeyID string `json:"accessKeyId"` + SecretAccessKey string `json:"secretAccessKey"` + SessionToken string `json:"sessionToken"` + AccountID string `json:"accountId"` + ExpiresAt time.Time `json:"expiresAt"` +} + +func (t *loginToken) Validate() error { + if t.AccessToken == nil { + return fmt.Errorf("missing accessToken") + } + if t.AccessToken.AccessKeyID == "" { + return fmt.Errorf("missing accessToken.accessKeyId") + } + if t.AccessToken.SecretAccessKey == "" { + return fmt.Errorf("missing accessToken.secretAccessKey") + } + if t.AccessToken.SessionToken == "" { + return fmt.Errorf("missing accessToken.sessionToken") + } + if t.AccessToken.AccountID == "" { + return fmt.Errorf("missing accessToken.accountId") + } + if t.AccessToken.ExpiresAt.IsZero() { + return fmt.Errorf("missing accessToken.expiresAt") + } + if t.ClientID == "" { + return fmt.Errorf("missing clientId") + } + if t.RefreshToken == "" { + return fmt.Errorf("missing refreshToken") + } + if t.DPOPKey == "" { + return fmt.Errorf("missing dpopKey") + } + return nil +} + +func (t *loginToken) Credentials() aws.Credentials { + return aws.Credentials{ + AccessKeyID: t.AccessToken.AccessKeyID, + SecretAccessKey: t.AccessToken.SecretAccessKey, + SessionToken: t.AccessToken.SessionToken, + Source: ProviderName, + CanExpire: true, + Expires: t.AccessToken.ExpiresAt, + AccountID: t.AccessToken.AccountID, + } +} + +func (t *loginToken) Update(out *signin.CreateOAuth2TokenOutput) { + t.AccessToken.AccessKeyID = *out.TokenOutput.AccessToken.AccessKeyId + t.AccessToken.SecretAccessKey = *out.TokenOutput.AccessToken.SecretAccessKey + t.AccessToken.SessionToken = *out.TokenOutput.AccessToken.SessionToken + t.AccessToken.ExpiresAt = sdk.NowTime().Add(time.Duration(*out.TokenOutput.ExpiresIn) * time.Second) + t.RefreshToken = *out.TokenOutput.RefreshToken +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md index 6b8c454739d..5b9f6cc16a7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/CHANGELOG.md @@ -1,3 +1,34 @@ +# v1.18.16 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.15 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.18.14 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.13 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.18.12 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.11 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.18.10 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.18.9 (2025-09-26) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go index ce89f5829de..630ccb34d15 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/feature/ec2/imds/go_module_metadata.go @@ -3,4 +3,4 @@ package imds // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.18.9" +const goModuleVersion = "1.18.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md index b34f47c9151..6ffdf061086 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md @@ -1,3 +1,34 @@ +# v1.4.16 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.15 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.4.14 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.13 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.4.12 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.11 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.4.10 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.4.9 (2025-09-26) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go index ebc2f6a7651..72df7b81bf0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go @@ -3,4 +3,4 @@ package configsources // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.4.9" +const goModuleVersion = "1.4.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go index 6ad5df64691..6ab4d9669fb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.go @@ -386,6 +386,13 @@ var partitions = []Partition{ SupportsFIPS: nil, SupportsDualStack: nil, }, + "us-isob-west-1": { + Name: nil, + DnsSuffix: nil, + DualStackDnsSuffix: nil, + SupportsFIPS: nil, + SupportsDualStack: nil, + }, }, }, { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json index b346b0be9b9..c789264d2b0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn/partitions.json @@ -194,6 +194,9 @@ }, "us-isob-east-1" : { "description" : "US ISOB East (Ohio)" + }, + "us-isob-west-1" : { + "description" : "US ISOB West" } } }, { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md index 8de3bfec8c7..b2d34779110 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md @@ -1,3 +1,34 @@ +# v2.7.16 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.15 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v2.7.14 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.13 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v2.7.12 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.11 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v2.7.10 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v2.7.9 (2025-09-26) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go index c5168da33a3..1a524ae2e57 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go @@ -3,4 +3,4 @@ package endpoints // goModuleVersion is the tagged release for this module -const goModuleVersion = "2.7.9" +const goModuleVersion = "2.7.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md index f729db535b7..4791d328c04 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/CHANGELOG.md @@ -1,3 +1,7 @@ +# v1.8.4 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. + # v1.8.3 (2025-02-18) * **Bug Fix**: Bump go version to 1.22 diff --git a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go index 00df0e3cb9b..f94970e7742 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/internal/ini/go_module_metadata.go @@ -3,4 +3,4 @@ package ini // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.8.3" +const goModuleVersion = "1.8.4" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md index 815e1331b7d..2575357533c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/CHANGELOG.md @@ -1,3 +1,84 @@ +# v1.53.5 (2025-12-09) + +* No change notes available for this release. + +# v1.53.4 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.53.3 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.53.2 (2025-11-25) + +* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 + +# v1.53.1 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.53.0 (2025-11-19) + +* **Feature**: Extended Global Secondary Index (GSI) composite keys to support up to 8 attributes. + +# v1.52.6 (2025-11-12) + +* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. +* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. +* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. + +# v1.52.5 (2025-11-11) + +* **Bug Fix**: Return validation error if input region is not a valid host label. + +# v1.52.4 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.52.3 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.52.2 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.52.1 (2025-10-22) + +* No change notes available for this release. + +# v1.52.0 (2025-10-21) + +* **Feature**: Add AccountID based endpoint metric to endpoint rules. + +# v1.51.1 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.51.0 (2025-10-02) + +* **Feature**: Add support for dual-stack account endpoint generation + +# v1.50.5 (2025-09-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.4 (2025-09-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.50.3 (2025-09-10) + +* No change notes available for this release. + +# v1.50.2 (2025-09-08) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.50.1 (2025-08-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_client.go index 487c8200a6a..8ddfebeaf5f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_client.go @@ -72,7 +72,12 @@ func timeOperationMetric[T any]( ctx context.Context, metric string, fn func() (T, error), opts ...metrics.RecordMetricOption, ) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return fn() + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) start := time.Now() @@ -85,7 +90,12 @@ func timeOperationMetric[T any]( } func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return func() {} + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) var ended bool @@ -113,6 +123,12 @@ func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { type operationMetricsKey struct{} func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + if _, ok := mp.(metrics.NopMeterProvider); ok { + // not using the metrics system - setting up the metrics context is a memory-intensive operation + // so we should skip it in this case + return parent, nil + } + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/dynamodb") om := &operationMetrics{} @@ -160,7 +176,10 @@ func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Hi } func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) + if v := ctx.Value(operationMetricsKey{}); v != nil { + return v.(*operationMetrics) + } + return nil } func operationTracer(p tracing.TracerProvider) tracing.Tracer { @@ -1038,138 +1057,49 @@ func addInterceptAttempt(stack *middleware.Stack, opts Options) error { }, "Retry", middleware.After) } -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} +func addInterceptors(stack *middleware.Stack, opts Options) error { + // middlewares are expensive, don't add all of these interceptor ones unless the caller + // actually has at least one interceptor configured + // + // at the moment it's all-or-nothing because some of the middlewares here are responsible for + // setting fields in the interceptor context for future ones + if len(opts.Interceptors.BeforeExecution) == 0 && + len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && + len(opts.Interceptors.BeforeRetryLoop) == 0 && + len(opts.Interceptors.BeforeAttempt) == 0 && + len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && + len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && + len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && + len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { + return nil + } -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) + return errors.Join( + stack.Initialize.Add(&smithyhttp.InterceptExecution{ + BeforeExecution: opts.Interceptors.BeforeExecution, + AfterExecution: opts.Interceptors.AfterExecution, + }, middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ + Interceptors: opts.Interceptors.BeforeSerialization, + }, "OperationSerializer", middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ + Interceptors: opts.Interceptors.AfterSerialization, + }, "OperationSerializer", middleware.After), + stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ + Interceptors: opts.Interceptors.BeforeSigning, + }, "Signing", middleware.Before), + stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ + Interceptors: opts.Interceptors.AfterSigning, + }, "Signing", middleware.After), + stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ + BeforeTransmit: opts.Interceptors.BeforeTransmit, + AfterTransmit: opts.Interceptors.AfterTransmit, + }, middleware.After), + stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ + Interceptors: opts.Interceptors.BeforeDeserialization, + }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) + stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ + Interceptors: opts.Interceptors.AfterDeserialization, + }, "OperationDeserializer", middleware.Before), + ) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchExecuteStatement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchExecuteStatement.go index 0b4d0edaf22..5afc969d373 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchExecuteStatement.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchExecuteStatement.go @@ -187,40 +187,7 @@ func (c *Client) addOperationBatchExecuteStatementMiddlewares(stack *middleware. if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchGetItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchGetItem.go index 5e2394a8521..11b0ea5a641 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchGetItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchGetItem.go @@ -337,40 +337,7 @@ func (c *Client) addOperationBatchGetItemMiddlewares(stack *middleware.Stack, op if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchWriteItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchWriteItem.go index 2056cdd927f..a21c3691588 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchWriteItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_BatchWriteItem.go @@ -357,40 +357,7 @@ func (c *Client) addOperationBatchWriteItemMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateBackup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateBackup.go index db7e0776102..fd8eefd66e9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateBackup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateBackup.go @@ -196,40 +196,7 @@ func (c *Client) addOperationCreateBackupMiddlewares(stack *middleware.Stack, op if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateGlobalTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateGlobalTable.go index 163348c8280..bd2a8829e1a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateGlobalTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateGlobalTable.go @@ -218,40 +218,7 @@ func (c *Client) addOperationCreateGlobalTableMiddlewares(stack *middleware.Stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go index 7d4510adb83..1d8a0254b73 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_CreateTable.go @@ -384,40 +384,7 @@ func (c *Client) addOperationCreateTableMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteBackup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteBackup.go index 799be66b63c..80f1a906013 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteBackup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteBackup.go @@ -163,40 +163,7 @@ func (c *Client) addOperationDeleteBackupMiddlewares(stack *middleware.Stack, op if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteItem.go index 386e2ecf1d6..b15f0f3edbb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteItem.go @@ -359,40 +359,7 @@ func (c *Client) addOperationDeleteItemMiddlewares(stack *middleware.Stack, opti if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteResourcePolicy.go index 768fb574dc7..6eb78bfabf1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteResourcePolicy.go @@ -190,40 +190,7 @@ func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.S if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteTable.go index a9dbd30779e..4768b497308 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DeleteTable.go @@ -184,40 +184,7 @@ func (c *Client) addOperationDeleteTableMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeBackup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeBackup.go index be01e640700..0ba89f0be26 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeBackup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeBackup.go @@ -163,40 +163,7 @@ func (c *Client) addOperationDescribeBackupMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContinuousBackups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContinuousBackups.go index b814e0517fb..f82ed62343f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContinuousBackups.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContinuousBackups.go @@ -179,40 +179,7 @@ func (c *Client) addOperationDescribeContinuousBackupsMiddlewares(stack *middlew if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go index 338ff4df13d..dc54c3dbdf5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeContributorInsights.go @@ -198,40 +198,7 @@ func (c *Client) addOperationDescribeContributorInsightsMiddlewares(stack *middl if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeEndpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeEndpoints.go index 0e7c17b82f4..0818369b911 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeEndpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeEndpoints.go @@ -147,40 +147,7 @@ func (c *Client) addOperationDescribeEndpointsMiddlewares(stack *middleware.Stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go index 22eba3e4abe..57fd40aaea1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeExport.go @@ -157,40 +157,7 @@ func (c *Client) addOperationDescribeExportMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTable.go index 95b1fb4e63a..4e4a9d1cbd5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTable.go @@ -173,40 +173,7 @@ func (c *Client) addOperationDescribeGlobalTableMiddlewares(stack *middleware.St if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTableSettings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTableSettings.go index 78378b4c88f..3408736f217 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTableSettings.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeGlobalTableSettings.go @@ -176,40 +176,7 @@ func (c *Client) addOperationDescribeGlobalTableSettingsMiddlewares(stack *middl if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go index a4c70e5d5bb..def30e72d9e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeImport.go @@ -161,40 +161,7 @@ func (c *Client) addOperationDescribeImportMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go index dd882cfe735..c68f3529fbf 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeKinesisStreamingDestination.go @@ -165,40 +165,7 @@ func (c *Client) addOperationDescribeKinesisStreamingDestinationMiddlewares(stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeLimits.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeLimits.go index 915a2a018ac..2d09b8b1d47 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeLimits.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeLimits.go @@ -221,40 +221,7 @@ func (c *Client) addOperationDescribeLimitsMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTable.go index 4a0cd9d29db..291062aa42e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTable.go @@ -175,40 +175,7 @@ func (c *Client) addOperationDescribeTableMiddlewares(stack *middleware.Stack, o if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTableReplicaAutoScaling.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTableReplicaAutoScaling.go index f8e2f77b78a..a5a888718bd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTableReplicaAutoScaling.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTableReplicaAutoScaling.go @@ -158,40 +158,7 @@ func (c *Client) addOperationDescribeTableReplicaAutoScalingMiddlewares(stack *m if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTimeToLive.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTimeToLive.go index 5ea9ab1eea7..834ba374970 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTimeToLive.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DescribeTimeToLive.go @@ -162,40 +162,7 @@ func (c *Client) addOperationDescribeTimeToLiveMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DisableKinesisStreamingDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DisableKinesisStreamingDestination.go index 5df8f9ea0df..2f5ea263fc3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DisableKinesisStreamingDestination.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_DisableKinesisStreamingDestination.go @@ -180,40 +180,7 @@ func (c *Client) addOperationDisableKinesisStreamingDestinationMiddlewares(stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_EnableKinesisStreamingDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_EnableKinesisStreamingDestination.go index c7b047c7f27..b7cbb83d3bc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_EnableKinesisStreamingDestination.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_EnableKinesisStreamingDestination.go @@ -182,40 +182,7 @@ func (c *Client) addOperationEnableKinesisStreamingDestinationMiddlewares(stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteStatement.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteStatement.go index 655372e1434..419cd10a616 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteStatement.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteStatement.go @@ -235,40 +235,7 @@ func (c *Client) addOperationExecuteStatementMiddlewares(stack *middleware.Stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteTransaction.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteTransaction.go index 85c587bc3b2..8d33b0c6940 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteTransaction.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExecuteTransaction.go @@ -177,40 +177,7 @@ func (c *Client) addOperationExecuteTransactionMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go index 491a4482329..65f7de7f0f9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ExportTableToPointInTime.go @@ -223,40 +223,7 @@ func (c *Client) addOperationExportTableToPointInTimeMiddlewares(stack *middlewa if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetItem.go index 5a8e1f6bedd..1186c3366a6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetItem.go @@ -269,40 +269,7 @@ func (c *Client) addOperationGetItemMiddlewares(stack *middleware.Stack, options if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetResourcePolicy.go index 31bae3f42ae..c4b6fb5c68f 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_GetResourcePolicy.go @@ -195,40 +195,7 @@ func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ImportTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ImportTable.go index ab97739f8bc..e3cbba2674a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ImportTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ImportTable.go @@ -201,40 +201,7 @@ func (c *Client) addOperationImportTableMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListBackups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListBackups.go index 4d594fa5b04..7161f605b25 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListBackups.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListBackups.go @@ -215,40 +215,7 @@ func (c *Client) addOperationListBackupsMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListContributorInsights.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListContributorInsights.go index d4870973e5f..dc98ea16573 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListContributorInsights.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListContributorInsights.go @@ -163,40 +163,7 @@ func (c *Client) addOperationListContributorInsightsMiddlewares(stack *middlewar if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go index 33c8aef4654..8bd9e56a037 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListExports.go @@ -164,40 +164,7 @@ func (c *Client) addOperationListExportsMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListGlobalTables.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListGlobalTables.go index dcf73cdadb6..ef80d1c6172 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListGlobalTables.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListGlobalTables.go @@ -177,40 +177,7 @@ func (c *Client) addOperationListGlobalTablesMiddlewares(stack *middleware.Stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListImports.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListImports.go index 5a02bf9c9cb..77b305d3da5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListImports.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListImports.go @@ -164,40 +164,7 @@ func (c *Client) addOperationListImportsMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTables.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTables.go index ec575e96791..9b5cc6707d0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTables.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTables.go @@ -172,40 +172,7 @@ func (c *Client) addOperationListTablesMiddlewares(stack *middleware.Stack, opti if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTagsOfResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTagsOfResource.go index 6d9ed73927a..0c6deb06341 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTagsOfResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_ListTagsOfResource.go @@ -177,40 +177,7 @@ func (c *Client) addOperationListTagsOfResourceMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go index 43bd113d2c0..2927b3e8f7a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutItem.go @@ -392,40 +392,7 @@ func (c *Client) addOperationPutItemMiddlewares(stack *middleware.Stack, options if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutResourcePolicy.go index d14c3e1f562..2ef9ef2757b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutResourcePolicy.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_PutResourcePolicy.go @@ -219,40 +219,7 @@ func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Query.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Query.go index d0e6f183624..37c934bf499 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Query.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Query.go @@ -561,40 +561,7 @@ func (c *Client) addOperationQueryMiddlewares(stack *middleware.Stack, options O if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableFromBackup.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableFromBackup.go index 250d963882f..5e3f0fb737a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableFromBackup.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableFromBackup.go @@ -207,40 +207,7 @@ func (c *Client) addOperationRestoreTableFromBackupMiddlewares(stack *middleware if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableToPointInTime.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableToPointInTime.go index 380fcb85e96..fef6374a519 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableToPointInTime.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_RestoreTableToPointInTime.go @@ -239,40 +239,7 @@ func (c *Client) addOperationRestoreTableToPointInTimeMiddlewares(stack *middlew if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Scan.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Scan.go index d3604bc75c2..cb16c2804f5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Scan.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_Scan.go @@ -492,40 +492,7 @@ func (c *Client) addOperationScanMiddlewares(stack *middleware.Stack, options Op if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TagResource.go index f80afd79e96..8d23115e446 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TagResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TagResource.go @@ -182,40 +182,7 @@ func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactGetItems.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactGetItems.go index ce6db313c87..4a796353b0c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactGetItems.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactGetItems.go @@ -212,40 +212,7 @@ func (c *Client) addOperationTransactGetItemsMiddlewares(stack *middleware.Stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactWriteItems.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactWriteItems.go index a345302a810..2ec6d35b745 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactWriteItems.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_TransactWriteItems.go @@ -317,40 +317,7 @@ func (c *Client) addOperationTransactWriteItemsMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UntagResource.go index c481bb262d4..f887ae2575a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UntagResource.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UntagResource.go @@ -180,40 +180,7 @@ func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, o if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContinuousBackups.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContinuousBackups.go index 4d9dcb86a7c..22112395ede 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContinuousBackups.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContinuousBackups.go @@ -180,40 +180,7 @@ func (c *Client) addOperationUpdateContinuousBackupsMiddlewares(stack *middlewar if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContributorInsights.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContributorInsights.go index edb045481ff..62a46fed045 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContributorInsights.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateContributorInsights.go @@ -187,40 +187,7 @@ func (c *Client) addOperationUpdateContributorInsightsMiddlewares(stack *middlew if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTable.go index 25878256fc5..20000167cbb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTable.go @@ -201,40 +201,7 @@ func (c *Client) addOperationUpdateGlobalTableMiddlewares(stack *middleware.Stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTableSettings.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTableSettings.go index 6505381e88e..60050aa8c7e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTableSettings.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateGlobalTableSettings.go @@ -204,40 +204,7 @@ func (c *Client) addOperationUpdateGlobalTableSettingsMiddlewares(stack *middlew if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go index 8416ad88e78..36c44dbc112 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateItem.go @@ -445,40 +445,7 @@ func (c *Client) addOperationUpdateItemMiddlewares(stack *middleware.Stack, opti if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go index 9a1b68ebd00..127c84a2b5b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateKinesisStreamingDestination.go @@ -179,40 +179,7 @@ func (c *Client) addOperationUpdateKinesisStreamingDestinationMiddlewares(stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go index 325db35c8d1..16bec163fc8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTable.go @@ -290,40 +290,7 @@ func (c *Client) addOperationUpdateTableMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTableReplicaAutoScaling.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTableReplicaAutoScaling.go index 26b33641df8..a76d1bd08a3 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTableReplicaAutoScaling.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTableReplicaAutoScaling.go @@ -170,40 +170,7 @@ func (c *Client) addOperationUpdateTableReplicaAutoScalingMiddlewares(stack *mid if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTimeToLive.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTimeToLive.go index 6c0fc24a13e..451070a5320 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTimeToLive.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/api_op_UpdateTimeToLive.go @@ -197,40 +197,7 @@ func (c *Client) addOperationUpdateTimeToLiveMiddlewares(stack *middleware.Stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/auth.go index b1d605c82de..1a80ea7f310 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/auth.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/auth.go @@ -16,8 +16,9 @@ import ( "strings" ) -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { params.Region = options.Region + return nil } type setLegacyContextSigningOptionsMiddleware struct { @@ -94,14 +95,16 @@ type AuthResolverParameters struct { Region string } -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { params := &AuthResolverParameters{ Operation: operation, } - bindAuthParamsRegion(ctx, params, input, options) + if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { + return nil, err + } - return params + return params, nil } // AuthSchemeResolver returns a set of possible authentication options for an @@ -152,7 +155,10 @@ func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in mid _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") defer span.End() - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) + } options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) if err != nil { return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go index a859c043f04..a504652be1a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/endpoints.go @@ -219,11 +219,15 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) { } } -func bindRegion(region string) *string { +func bindRegion(region string) (*string, error) { if region == "" { - return nil + return nil, nil + } + if !rulesfn.IsValidHostLabel(region, true) { + return nil, fmt.Errorf("invalid input region %s", region) } - return aws.String(endpoints.MapFIPSRegion(region)) + + return aws.String(endpoints.MapFIPSRegion(region)), nil } // EndpointParameters provides the parameters that influence how endpoints are @@ -356,8 +360,49 @@ func (r *resolver) ResolveEndpoint( return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) } _UseDualStack := *params.UseDualStack + _ = _UseDualStack _UseFIPS := *params.UseFIPS + _ = _UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + if _Endpoint == func() string { + var out strings.Builder + out.WriteString("https://dynamodb.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Endpoint override is not supported for dual-stack endpoints. Please enable dual-stack functionality by enabling the configuration. For more details, see: https://docs.aws.amazon.com/sdkref/latest/guide/feature-endpoints.html") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } if exprVal := params.Endpoint; exprVal != nil { _Endpoint := *exprVal _ = _Endpoint @@ -514,12 +559,169 @@ func (r *resolver) ResolveEndpoint( } if _UseDualStack == true { if _PartitionResult.SupportsDualStack == true { + if exprVal := params.AccountIdEndpointMode; exprVal != nil { + _AccountIdEndpointMode := *exprVal + _ = _AccountIdEndpointMode + if !(_AccountIdEndpointMode == "disabled") { + if _PartitionResult.Name == "aws" { + if !(_UseFIPS == true) { + if exprVal := params.ResourceArn; exprVal != nil { + _ResourceArn := *exprVal + _ = _ResourceArn + if exprVal := awsrulesfn.ParseARN(_ResourceArn); exprVal != nil { + _ParsedArn := *exprVal + _ = _ParsedArn + if _ParsedArn.Service == "dynamodb" { + if rulesfn.IsValidHostLabel(_ParsedArn.Region, false) { + if _ParsedArn.Region == _Region { + if rulesfn.IsValidHostLabel(_ParsedArn.AccountId, false) { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_ParsedArn.AccountId) + out.WriteString(".ddb.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("metricValues", []interface{}{ + "O", + }) + return out + }(), + }, nil + } + } + } + } + } + } + } + } + } + } + if exprVal := params.AccountIdEndpointMode; exprVal != nil { + _AccountIdEndpointMode := *exprVal + _ = _AccountIdEndpointMode + if !(_AccountIdEndpointMode == "disabled") { + if _PartitionResult.Name == "aws" { + if !(_UseFIPS == true) { + if exprVal := params.ResourceArnList; exprVal != nil { + _ResourceArnList := stringSlice(exprVal) + _ = _ResourceArnList + if exprVal := _ResourceArnList.Get(0); exprVal != nil { + _FirstArn := *exprVal + _ = _FirstArn + if exprVal := awsrulesfn.ParseARN(_FirstArn); exprVal != nil { + _ParsedArn := *exprVal + _ = _ParsedArn + if _ParsedArn.Service == "dynamodb" { + if rulesfn.IsValidHostLabel(_ParsedArn.Region, false) { + if _ParsedArn.Region == _Region { + if rulesfn.IsValidHostLabel(_ParsedArn.AccountId, false) { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_ParsedArn.AccountId) + out.WriteString(".ddb.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("metricValues", []interface{}{ + "O", + }) + return out + }(), + }, nil + } + } + } + } + } + } + } + } + } + } + } + if exprVal := params.AccountIdEndpointMode; exprVal != nil { + _AccountIdEndpointMode := *exprVal + _ = _AccountIdEndpointMode + if !(_AccountIdEndpointMode == "disabled") { + if _PartitionResult.Name == "aws" { + if !(_UseFIPS == true) { + if exprVal := params.AccountId; exprVal != nil { + _AccountId := *exprVal + _ = _AccountId + if rulesfn.IsValidHostLabel(_AccountId, false) { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_AccountId) + out.WriteString(".ddb.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("metricValues", []interface{}{ + "O", + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Credentials-sourced account ID parameter is invalid") + } + } + } + } + } if exprVal := params.AccountIdEndpointMode; exprVal != nil { _AccountIdEndpointMode := *exprVal _ = _AccountIdEndpointMode if _AccountIdEndpointMode == "required" { if !(_UseFIPS == true) { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required and DualStack is enabled, but DualStack account endpoints are not supported") + if _PartitionResult.Name == "aws" { + return endpoint, fmt.Errorf("endpoint rule error, %s", "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported") } @@ -551,11 +753,66 @@ func (r *resolver) ResolveEndpoint( if !(_AccountIdEndpointMode == "disabled") { if _PartitionResult.Name == "aws" { if !(_UseFIPS == true) { - if !(_UseDualStack == true) { - if exprVal := params.ResourceArn; exprVal != nil { - _ResourceArn := *exprVal - _ = _ResourceArn - if exprVal := awsrulesfn.ParseARN(_ResourceArn); exprVal != nil { + if exprVal := params.ResourceArn; exprVal != nil { + _ResourceArn := *exprVal + _ = _ResourceArn + if exprVal := awsrulesfn.ParseARN(_ResourceArn); exprVal != nil { + _ParsedArn := *exprVal + _ = _ParsedArn + if _ParsedArn.Service == "dynamodb" { + if rulesfn.IsValidHostLabel(_ParsedArn.Region, false) { + if _ParsedArn.Region == _Region { + if rulesfn.IsValidHostLabel(_ParsedArn.AccountId, false) { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_ParsedArn.AccountId) + out.WriteString(".ddb.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("metricValues", []interface{}{ + "O", + }) + return out + }(), + }, nil + } + } + } + } + } + } + } + } + } + } + if exprVal := params.AccountIdEndpointMode; exprVal != nil { + _AccountIdEndpointMode := *exprVal + _ = _AccountIdEndpointMode + if !(_AccountIdEndpointMode == "disabled") { + if _PartitionResult.Name == "aws" { + if !(_UseFIPS == true) { + if exprVal := params.ResourceArnList; exprVal != nil { + _ResourceArnList := stringSlice(exprVal) + _ = _ResourceArnList + if exprVal := _ResourceArnList.Get(0); exprVal != nil { + _FirstArn := *exprVal + _ = _FirstArn + if exprVal := awsrulesfn.ParseARN(_FirstArn); exprVal != nil { _ParsedArn := *exprVal _ = _ParsedArn if _ParsedArn.Service == "dynamodb" { @@ -581,6 +838,13 @@ func (r *resolver) ResolveEndpoint( return smithyendpoints.Endpoint{ URI: *uri, Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("metricValues", []interface{}{ + "O", + }) + return out + }(), }, nil } } @@ -599,86 +863,39 @@ func (r *resolver) ResolveEndpoint( if !(_AccountIdEndpointMode == "disabled") { if _PartitionResult.Name == "aws" { if !(_UseFIPS == true) { - if !(_UseDualStack == true) { - if exprVal := params.ResourceArnList; exprVal != nil { - _ResourceArnList := stringSlice(exprVal) - _ = _ResourceArnList - if exprVal := _ResourceArnList.Get(0); exprVal != nil { - _FirstArn := *exprVal - _ = _FirstArn - if exprVal := awsrulesfn.ParseARN(_FirstArn); exprVal != nil { - _ParsedArn := *exprVal - _ = _ParsedArn - if _ParsedArn.Service == "dynamodb" { - if rulesfn.IsValidHostLabel(_ParsedArn.Region, false) { - if _ParsedArn.Region == _Region { - if rulesfn.IsValidHostLabel(_ParsedArn.AccountId, false) { - uriString := func() string { - var out strings.Builder - out.WriteString("https://") - out.WriteString(_ParsedArn.AccountId) - out.WriteString(".ddb.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - } - } - } + if exprVal := params.AccountId; exprVal != nil { + _AccountId := *exprVal + _ = _AccountId + if rulesfn.IsValidHostLabel(_AccountId, false) { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_AccountId) + out.WriteString(".ddb.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) } - } - } - } - } - } - } - if exprVal := params.AccountIdEndpointMode; exprVal != nil { - _AccountIdEndpointMode := *exprVal - _ = _AccountIdEndpointMode - if !(_AccountIdEndpointMode == "disabled") { - if _PartitionResult.Name == "aws" { - if !(_UseFIPS == true) { - if !(_UseDualStack == true) { - if exprVal := params.AccountId; exprVal != nil { - _AccountId := *exprVal - _ = _AccountId - if rulesfn.IsValidHostLabel(_AccountId, false) { - uriString := func() string { - var out strings.Builder - out.WriteString("https://") - out.WriteString(_AccountId) - out.WriteString(".ddb.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Credentials-sourced account ID parameter is invalid") + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + out.Set("metricValues", []interface{}{ + "O", + }) + return out + }(), + }, nil } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Credentials-sourced account ID parameter is invalid") } } } @@ -689,13 +906,10 @@ func (r *resolver) ResolveEndpoint( _ = _AccountIdEndpointMode if _AccountIdEndpointMode == "required" { if !(_UseFIPS == true) { - if !(_UseDualStack == true) { - if _PartitionResult.Name == "aws" { - return endpoint, fmt.Errorf("endpoint rule error, %s", "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition") + if _PartitionResult.Name == "aws" { + return endpoint, fmt.Errorf("endpoint rule error, %s", "AccountIdEndpointMode is required but no AccountID was provided or able to be loaded") } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required and DualStack is enabled, but DualStack account endpoints are not supported") + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required but account endpoints are not supported in this partition") } return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: AccountIdEndpointMode is required and FIPS is enabled, but FIPS account endpoints are not supported") } @@ -728,10 +942,15 @@ type endpointParamsBinder interface { bindEndpointParams(*EndpointParameters) } -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { +func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { params := &EndpointParameters{} - params.Region = bindRegion(options.Region) + region, err := bindRegion(options.Region) + if err != nil { + return nil, err + } + params.Region = region + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) params.Endpoint = options.BaseEndpoint @@ -742,7 +961,7 @@ func bindEndpointParams(ctx context.Context, input interface{}, options Options) b.bindEndpointParams(params) } - return params + return params, nil } type resolveEndpointV2Middleware struct { @@ -776,7 +995,10 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) + } endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", func() (smithyendpoints.Endpoint, error) { return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json index b2746adbd16..5c4f744ee34 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/generated.json @@ -87,7 +87,7 @@ "types/types_exported_test.go", "validators.go" ], - "go": "1.22", + "go": "1.23", "module": "github.com/aws/aws-sdk-go-v2/service/dynamodb", "unstable": false } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go index 6e1c54415cf..a0095b032b6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/go_module_metadata.go @@ -3,4 +3,4 @@ package dynamodb // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.50.1" +const goModuleVersion = "1.53.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go index 09e2b0eed08..07d61e80260 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/dynamodb/internal/endpoints/endpoints.go @@ -390,6 +390,13 @@ var defaultPartitions = endpoints.Partitions{ { ID: "aws-eusc", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dynamodb.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: endpoints.FIPSVariant, }: { @@ -397,6 +404,13 @@ var defaultPartitions = endpoints.Partitions{ Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "dynamodb-fips.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: 0, }: { @@ -407,6 +421,11 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsEusc, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "eusc-de-east-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso", @@ -463,6 +482,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-west-1", + }: endpoints.Endpoint{}, }, }, { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md index 607fc092204..6ffbf3fe4ac 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md @@ -1,3 +1,15 @@ +# v1.13.4 (2025-12-02) + +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.13.3 (2025-11-04) + +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.13.2 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. + # v1.13.1 (2025-08-27) * **Dependency Update**: Update to smithy-go v1.23.0. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go index 7a0b6aae29a..970bb210ec9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go @@ -3,4 +3,4 @@ package acceptencoding // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.1" +const goModuleVersion = "1.13.4" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md index 6214ff2917a..b47d431475d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/CHANGELOG.md @@ -1,3 +1,46 @@ +# v1.11.16 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.15 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.11.14 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.13 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.11.12 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.11 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.10 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.9 (2025-09-26) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.8 (2025-09-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.11.7 (2025-09-08) + +* **Dependency Update**: Updated to the latest SDK module versions + # v1.11.6 (2025-08-29) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go index b83027a6e1d..5e82d122edc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/endpoint-discovery/go_module_metadata.go @@ -3,4 +3,4 @@ package endpointdiscovery // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.11.6" +const goModuleVersion = "1.11.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md index 6f143784e12..743183c8df6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md @@ -1,3 +1,34 @@ +# v1.13.16 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.15 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.13.14 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.13 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.13.12 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.11 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.13.10 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.13.9 (2025-09-26) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go index bc347369d8b..a8a2e692bfc 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/go_module_metadata.go @@ -3,4 +3,4 @@ package presignedurl // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.13.9" +const goModuleVersion = "1.13.16" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md new file mode 100644 index 00000000000..4d6c08996e5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/CHANGELOG.md @@ -0,0 +1,22 @@ +# v1.0.4 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.3 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.0.2 (2025-11-25) + +* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 + +# v1.0.1 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.0.0 (2025-11-19) + +* **Release**: New AWS service client module +* **Feature**: AWS Sign-In manages authentication for AWS services. This service provides secure authentication flows for accessing AWS resources from the console and developer tools. This release adds the CreateOAuth2Token API, which can be used to fetch OAuth2 access tokens and refresh tokens from Sign-In. + diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go new file mode 100644 index 00000000000..d2db11d2aa1 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_client.go @@ -0,0 +1,949 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Signin" +const ServiceAPIVersion = "2023-01-01" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return fn() + } + + instr := mm.histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return func() {} + } + + instr := mm.histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + if _, ok := mp.(metrics.NopMeterProvider); ok { + // not using the metrics system - setting up the metrics context is a memory-intensive operation + // so we should skip it in this case + return parent, nil + } + + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/signin") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + if v := ctx.Value(operationMetricsKey{}); v != nil { + return v.(*operationMetrics) + } + return nil +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/signin") +} + +// Client provides the API client to make operations call for AWS Sign-In Service. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/signin") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + AuthSchemePreference: cfg.AuthSchemePreference, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveInterceptors(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, func(o *Options) { + for _, opt := range cfg.ServiceOptions { + opt(ServiceID, o) + } + for _, opt := range optFns { + opt(o) + } + }) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func resolveInterceptors(cfg aws.Config, o *Options) { + o.Interceptors = cfg.Interceptors.Copy() +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "signin", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/signin") + }) + if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +type setCredentialSourceMiddleware struct { + ua *awsmiddleware.RequestUserAgent + options Options +} + +func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } + +func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( + out middleware.BuildOutput, metadata middleware.Metadata, err error, +) { + asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) + if !ok { + return next.HandleBuild(ctx, in) + } + providerSources := asProviderSource.ProviderSources() + for _, source := range providerSources { + m.ua.AddCredentialsSource(source) + } + return next.HandleBuild(ctx, in) +} + +func addCredentialSource(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + mw := setCredentialSourceMiddleware{ua: ua, options: options} + return stack.Build.Insert(&mw, "UserAgent", middleware.Before) +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { + return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ + Interceptors: opts.Interceptors.BeforeRetryLoop, + }, "Retry", middleware.Before) +} + +func addInterceptAttempt(stack *middleware.Stack, opts Options) error { + return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ + BeforeAttempt: opts.Interceptors.BeforeAttempt, + AfterAttempt: opts.Interceptors.AfterAttempt, + }, "Retry", middleware.After) +} + +func addInterceptors(stack *middleware.Stack, opts Options) error { + // middlewares are expensive, don't add all of these interceptor ones unless the caller + // actually has at least one interceptor configured + // + // at the moment it's all-or-nothing because some of the middlewares here are responsible for + // setting fields in the interceptor context for future ones + if len(opts.Interceptors.BeforeExecution) == 0 && + len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && + len(opts.Interceptors.BeforeRetryLoop) == 0 && + len(opts.Interceptors.BeforeAttempt) == 0 && + len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && + len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && + len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && + len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { + return nil + } + + return errors.Join( + stack.Initialize.Add(&smithyhttp.InterceptExecution{ + BeforeExecution: opts.Interceptors.BeforeExecution, + AfterExecution: opts.Interceptors.AfterExecution, + }, middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ + Interceptors: opts.Interceptors.BeforeSerialization, + }, "OperationSerializer", middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ + Interceptors: opts.Interceptors.AfterSerialization, + }, "OperationSerializer", middleware.After), + stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ + Interceptors: opts.Interceptors.BeforeSigning, + }, "Signing", middleware.Before), + stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ + Interceptors: opts.Interceptors.AfterSigning, + }, "Signing", middleware.After), + stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ + BeforeTransmit: opts.Interceptors.BeforeTransmit, + AfterTransmit: opts.Interceptors.AfterTransmit, + }, middleware.After), + stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ + Interceptors: opts.Interceptors.BeforeDeserialization, + }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) + stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ + Interceptors: opts.Interceptors.AfterDeserialization, + }, "OperationDeserializer", middleware.Before), + ) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go new file mode 100644 index 00000000000..54ba42422d0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/api_op_CreateOAuth2Token.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/signin/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// CreateOAuth2Token API +// +// Path: /v1/token Request Method: POST Content-Type: application/json or +// application/x-www-form-urlencoded +// +// This API implements OAuth 2.0 flows for AWS Sign-In CLI clients, supporting +// both: +// +// - Authorization code redemption (grant_type=authorization_code) - NOT +// idempotent +// - Token refresh (grant_type=refresh_token) - Idempotent within token validity +// window +// +// The operation behavior is determined by the grant_type parameter in the request +// body: +// +// Authorization Code Flow (NOT Idempotent): +// +// - JSON or form-encoded body with client_id, grant_type=authorization_code, +// code, redirect_uri, code_verifier +// - Returns access_token, token_type, expires_in, refresh_token, and id_token +// - Each authorization code can only be used ONCE for security (prevents replay +// attacks) +// +// Token Refresh Flow (Idempotent): +// +// - JSON or form-encoded body with client_id, grant_type=refresh_token, +// refresh_token +// - Returns access_token, token_type, expires_in, and refresh_token (no +// id_token) +// - Multiple calls with same refresh_token return consistent results within +// validity window +// +// Authentication and authorization: +// +// - Confidential clients: sigv4 signing required with signin:ExchangeToken +// permissions +// - CLI clients (public): authn/authz skipped based on client_id & grant_type +// +// Note: This operation cannot be marked as @idempotent because it handles both +// idempotent (token refresh) and non-idempotent (auth code redemption) flows in a +// single endpoint. +func (c *Client) CreateOAuth2Token(ctx context.Context, params *CreateOAuth2TokenInput, optFns ...func(*Options)) (*CreateOAuth2TokenOutput, error) { + if params == nil { + params = &CreateOAuth2TokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateOAuth2Token", params, optFns, c.addOperationCreateOAuth2TokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateOAuth2TokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input structure for CreateOAuth2Token operation +// +// Contains flattened token operation inputs for both authorization code and +// refresh token flows. The operation type is determined by the grant_type +// parameter in the request body. +type CreateOAuth2TokenInput struct { + + // Flattened token operation inputs The specific operation is determined by + // grant_type in the request body + // + // This member is required. + TokenInput *types.CreateOAuth2TokenRequestBody + + noSmithyDocumentSerde +} + +// Output structure for CreateOAuth2Token operation +// +// Contains flattened token operation outputs for both authorization code and +// refresh token flows. The response content depends on the grant_type from the +// original request. +type CreateOAuth2TokenOutput struct { + + // Flattened token operation outputs The specific response fields depend on the + // grant_type used in the request + // + // This member is required. + TokenOutput *types.CreateOAuth2TokenResponseBody + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateOAuth2TokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateOAuth2Token{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateOAuth2Token{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateOAuth2Token"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpCreateOAuth2TokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOAuth2Token(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptors(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateOAuth2Token(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateOAuth2Token", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go new file mode 100644 index 00000000000..cf6b3650410 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/auth.go @@ -0,0 +1,351 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "slices" + "strings" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { + params.Region = options.Region + return nil +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { + params := &AuthResolverParameters{ + Operation: operation, + } + + if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { + return nil, err + } + + return params, nil +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{ + "CreateOAuth2Token": func(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + {SchemeID: smithyauth.SchemeIDAnonymous}, + } + }, +} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "signin") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) + } + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + sorted := sortAuthOptions(options, m.options.AuthSchemePreference) + for _, option := range sorted { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { + byPriority := make([]*smithyauth.Option, 0, len(options)) + for _, prefName := range preferred { + for _, option := range options { + optName := option.SchemeID + if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { + optName = parts[1] + } + if prefName == optName { + byPriority = append(byPriority, option) + } + } + } + for _, option := range options { + if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { + return o.SchemeID == option.SchemeID + }) { + byPriority = append(byPriority, option) + } + } + return byPriority +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go new file mode 100644 index 00000000000..b74b612e6b0 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/deserializers.go @@ -0,0 +1,655 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpCreateOAuth2Token struct { +} + +func (*awsRestjson1_deserializeOpCreateOAuth2Token) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateOAuth2Token) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateOAuth2Token(response, &metadata) + } + output := &CreateOAuth2TokenOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeDocumentCreateOAuth2TokenResponseBody(&output.TokenOutput, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateOAuth2Token(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("TooManyRequestsError", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsError(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateOAuth2TokenOutput(v **CreateOAuth2TokenOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateOAuth2TokenOutput + if *v == nil { + sv = &CreateOAuth2TokenOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tokenOutput": + if err := awsRestjson1_deserializeDocumentCreateOAuth2TokenResponseBody(&sv.TokenOutput, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorTooManyRequestsError(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyRequestsError{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentTooManyRequestsError(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) + } + sv.Error_ = types.OAuth2ErrorCode(jtv) + } + + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAccessToken(v **types.AccessToken, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessToken + if *v == nil { + sv = &types.AccessToken{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccessKeyId = ptr.String(jtv) + } + + case "secretAccessKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretAccessKey = ptr.String(jtv) + } + + case "sessionToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SessionToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCreateOAuth2TokenResponseBody(v **types.CreateOAuth2TokenResponseBody, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CreateOAuth2TokenResponseBody + if *v == nil { + sv = &types.CreateOAuth2TokenResponseBody{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessToken": + if err := awsRestjson1_deserializeDocumentAccessToken(&sv.AccessToken, value); err != nil { + return err + } + + case "expiresIn": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpiresIn to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresIn = ptr.Int32(int32(i64)) + } + + case "idToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IdToken to be of type string, got %T instead", value) + } + sv.IdToken = ptr.String(jtv) + } + + case "refreshToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value) + } + sv.RefreshToken = ptr.String(jtv) + } + + case "tokenType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TokenType to be of type string, got %T instead", value) + } + sv.TokenType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) + } + sv.Error_ = types.OAuth2ErrorCode(jtv) + } + + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTooManyRequestsError(v **types.TooManyRequestsError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TooManyRequestsError + if *v == nil { + sv = &types.TooManyRequestsError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) + } + sv.Error_ = types.OAuth2ErrorCode(jtv) + } + + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OAuth2ErrorCode to be of type string, got %T instead", value) + } + sv.Error_ = types.OAuth2ErrorCode(jtv) + } + + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go new file mode 100644 index 00000000000..dc1a8b62f09 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/doc.go @@ -0,0 +1,9 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package signin provides the API client, operations, and parameter types for AWS +// Sign-In Service. +// +// AWS Sign-In manages authentication for AWS services. This service provides +// secure authentication flows for accessing AWS resources from the console and +// developer tools. +package signin diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/endpoints.go new file mode 100644 index 00000000000..db2e6a62a38 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/endpoints.go @@ -0,0 +1,624 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/endpoints/private/rulesfn" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "signin" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_SIGNIN") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Signin", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) (*string, error) { + if region == "" { + return nil, nil + } + if !rulesfn.IsValidHostLabel(region, true) { + return nil, fmt.Errorf("invalid input region %s", region) + } + + return aws.String(endpoints.MapFIPSRegion(region)), nil +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // When true, use the dual-stack endpoint. If the configured endpoint does not + // support dual-stack, dispatching the request MAY return an error. + // + // Defaults to + // false if no value is provided. + // + // AWS::UseDualStack + UseDualStack *bool + + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseDualStack == nil { + return fmt.Errorf("parameter UseDualStack is required") + } + + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseDualStack == nil { + p.UseDualStack = ptr.Bool(false) + } + + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseDualStack := *params.UseDualStack + _ = _UseDualStack + _UseFIPS := *params.UseFIPS + _ = _UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + if _UseDualStack == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _PartitionResult.Name == "aws" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Region) + out.WriteString(".signin.aws.amazon.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-cn" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Region) + out.WriteString(".signin.amazonaws.cn") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _PartitionResult.Name == "aws-us-gov" { + if _UseFIPS == false { + if _UseDualStack == false { + uriString := func() string { + var out strings.Builder + out.WriteString("https://") + out.WriteString(_Region) + out.WriteString(".signin.amazonaws-us-gov.com") + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + } + if _UseFIPS == true { + if _UseDualStack == true { + if true == _PartitionResult.SupportsFIPS { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://signin-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") + } + } + if _UseFIPS == true { + if _UseDualStack == false { + if _PartitionResult.SupportsFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://signin-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") + } + } + if _UseFIPS == false { + if _UseDualStack == true { + if true == _PartitionResult.SupportsDualStack { + uriString := func() string { + var out strings.Builder + out.WriteString("https://signin.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") + } + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://signin.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { + params := &EndpointParameters{} + + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + region, err := bindRegion(options.Region) + if err != nil { + return nil, err + } + params.Region = region + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params, nil +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) + } + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json new file mode 100644 index 00000000000..8014c56167c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/generated.json @@ -0,0 +1,34 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_CreateOAuth2Token.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "sra_operation_order_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.23", + "module": "github.com/aws/aws-sdk-go-v2/service/signin", + "unstable": false +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go new file mode 100644 index 00000000000..2424c057e8e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package signin + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "1.0.4" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..cfb2efea8a3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints/endpoints.go @@ -0,0 +1,333 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver Signin endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsEusc *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "signin.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "signin-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "signin.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "signin-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-eusc", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "signin.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.amazonaws.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "signin-fips.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.amazonaws.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsEusc, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "signin.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "signin-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "signin-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "signin.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go new file mode 100644 index 00000000000..3262aa58224 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/options.go @@ -0,0 +1,239 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // Client registry of operation interceptors. + Interceptors smithyhttp.InterceptorRegistry + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme + + // Priority list of preferred auth scheme names (e.g. sigv4a). + AuthSchemePreference []string +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + to.Interceptors = o.Interceptors.Copy() + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go new file mode 100644 index 00000000000..958240275e3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/serializers.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpCreateOAuth2Token struct { +} + +func (*awsRestjson1_serializeOpCreateOAuth2Token) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateOAuth2Token) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateOAuth2TokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/token") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/json") + } + + if input.TokenInput != nil { + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeDocumentCreateOAuth2TokenRequestBody(input.TokenInput, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + payload := bytes.NewReader(jsonEncoder.Bytes()) + if request, err = request.SetStream(payload); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + } else { + jsonEncoder := smithyjson.NewEncoder() + jsonEncoder.Value.Object().Close() + payload := bytes.NewReader(jsonEncoder.Bytes()) + if request, err = request.SetStream(payload); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateOAuth2TokenInput(v *CreateOAuth2TokenInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeDocumentCreateOAuth2TokenRequestBody(v *types.CreateOAuth2TokenRequestBody, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientId != nil { + ok := object.Key("clientId") + ok.String(*v.ClientId) + } + + if v.Code != nil { + ok := object.Key("code") + ok.String(*v.Code) + } + + if v.CodeVerifier != nil { + ok := object.Key("codeVerifier") + ok.String(*v.CodeVerifier) + } + + if v.GrantType != nil { + ok := object.Key("grantType") + ok.String(*v.GrantType) + } + + if v.RedirectUri != nil { + ok := object.Key("redirectUri") + ok.String(*v.RedirectUri) + } + + if v.RefreshToken != nil { + ok := object.Key("refreshToken") + ok.String(*v.RefreshToken) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go new file mode 100644 index 00000000000..ecfabb81f74 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/enums.go @@ -0,0 +1,37 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type OAuth2ErrorCode string + +// Enum values for OAuth2ErrorCode +const ( + // Token has expired and needs to be refreshed + OAuth2ErrorCodeTokenExpired OAuth2ErrorCode = "TOKEN_EXPIRED" + // User credentials have been changed + OAuth2ErrorCodeUserCredentialsChanged OAuth2ErrorCode = "USER_CREDENTIALS_CHANGED" + // Insufficient permissions to perform this operation + OAuth2ErrorCodeInsufficientPermissions OAuth2ErrorCode = "INSUFFICIENT_PERMISSIONS" + // Authorization code has expired + OAuth2ErrorCodeAuthcodeExpired OAuth2ErrorCode = "AUTHCODE_EXPIRED" + // Internal server error occurred + OAuth2ErrorCodeServerError OAuth2ErrorCode = "server_error" + // The request is missing a required parameter, includes an invalid parameter + // value, or is otherwise malformed + OAuth2ErrorCodeInvalidRequest OAuth2ErrorCode = "INVALID_REQUEST" +) + +// Values returns all known values for OAuth2ErrorCode. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (OAuth2ErrorCode) Values() []OAuth2ErrorCode { + return []OAuth2ErrorCode{ + "TOKEN_EXPIRED", + "USER_CREDENTIALS_CHANGED", + "INSUFFICIENT_PERMISSIONS", + "AUTHCODE_EXPIRED", + "server_error", + "INVALID_REQUEST", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go new file mode 100644 index 00000000000..ca4928a86c8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/errors.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Error thrown for access denied scenarios with flexible HTTP status mapping +// +// Runtime HTTP Status Code Mapping: +// +// - HTTP 401 (Unauthorized): TOKEN_EXPIRED, AUTHCODE_EXPIRED +// - HTTP 403 (Forbidden): USER_CREDENTIALS_CHANGED, INSUFFICIENT_PERMISSIONS +// +// The specific HTTP status code is determined at runtime based on the error enum +// value. Consumers should use the error field to determine the specific access +// denial reason. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Error thrown when an internal server error occurs +// +// HTTP Status Code: 500 Internal Server Error +// +// Used for unexpected server-side errors that prevent request processing. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Error thrown when rate limit is exceeded +// +// HTTP Status Code: 429 Too Many Requests +// +// Possible OAuth2ErrorCode values: +// +// - INVALID_REQUEST: Rate limiting, too many requests, abuse prevention +// +// Possible causes: +// +// - Too many token requests from the same client +// - Rate limiting based on client_id or IP address +// - Abuse prevention mechanisms triggered +// - Service protection against excessive token generation +type TooManyRequestsError struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *TooManyRequestsError) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyRequestsError) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyRequestsError) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyRequestsError" + } + return *e.ErrorCodeOverride +} +func (e *TooManyRequestsError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Error thrown when request validation fails +// +// HTTP Status Code: 400 Bad Request +// +// Used for request validation errors such as malformed parameters, missing +// required fields, or invalid parameter values. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Error_ OAuth2ErrorCode + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go new file mode 100644 index 00000000000..98afa20bfcb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/types/types.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +// AWS credentials structure containing temporary access credentials +// +// The scoped-down, 15 minute duration AWS credentials. Scoping down will be based +// on CLI policy (CLI team needs to create it). Similar to cloud shell +// implementation. +type AccessToken struct { + + // AWS access key ID for temporary credentials + // + // This member is required. + AccessKeyId *string + + // AWS secret access key for temporary credentials + // + // This member is required. + SecretAccessKey *string + + // AWS session token for temporary credentials + // + // This member is required. + SessionToken *string + + noSmithyDocumentSerde +} + +// Request body payload for CreateOAuth2Token operation +// +// The operation type is determined by the grant_type parameter: +// +// - grant_type=authorization_code: Requires code, redirect_uri, code_verifier +// - grant_type=refresh_token: Requires refresh_token +type CreateOAuth2TokenRequestBody struct { + + // The client identifier (ARN) used during Sign-In onboarding Required for both + // authorization code and refresh token flows + // + // This member is required. + ClientId *string + + // OAuth 2.0 grant type - determines which flow is used Must be + // "authorization_code" or "refresh_token" + // + // This member is required. + GrantType *string + + // The authorization code received from /v1/authorize Required only when + // grant_type=authorization_code + Code *string + + // PKCE code verifier to prove possession of the original code challenge Required + // only when grant_type=authorization_code + CodeVerifier *string + + // The redirect URI that must match the original authorization request Required + // only when grant_type=authorization_code + RedirectUri *string + + // The refresh token returned from auth_code redemption Required only when + // grant_type=refresh_token + RefreshToken *string + + noSmithyDocumentSerde +} + +// Response body payload for CreateOAuth2Token operation +// +// The response content depends on the grant_type from the request: +// +// - grant_type=authorization_code: Returns all fields including refresh_token +// and id_token +// - grant_type=refresh_token: Returns access_token, token_type, expires_in, +// refresh_token (no id_token) +type CreateOAuth2TokenResponseBody struct { + + // Scoped-down AWS credentials (15 minute duration) Present for both authorization + // code redemption and token refresh + // + // This member is required. + AccessToken *AccessToken + + // Time to expiry in seconds (maximum 900) Present for both authorization code + // redemption and token refresh + // + // This member is required. + ExpiresIn *int32 + + // Encrypted refresh token with cnf.jkt (SHA-256 thumbprint of presented jwk) + // Always present in responses (required for both flows) + // + // This member is required. + RefreshToken *string + + // Token type indicating this is AWS SigV4 credentials Value is "aws_sigv4" for + // both flows + // + // This member is required. + TokenType *string + + // ID token containing user identity information Present only in authorization + // code redemption response (grant_type=authorization_code) Not included in token + // refresh responses + IdToken *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go new file mode 100644 index 00000000000..f07252341ad --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/signin/validators.go @@ -0,0 +1,72 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package signin + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/signin/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateOAuth2Token struct { +} + +func (*validateOpCreateOAuth2Token) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateOAuth2Token) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateOAuth2TokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateOAuth2TokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateOAuth2TokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateOAuth2Token{}, middleware.After) +} + +func validateCreateOAuth2TokenRequestBody(v *types.CreateOAuth2TokenRequestBody) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateOAuth2TokenRequestBody"} + if v.ClientId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientId")) + } + if v.GrantType == nil { + invalidParams.Add(smithy.NewErrParamRequired("GrantType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateOAuth2TokenInput(v *CreateOAuth2TokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateOAuth2TokenInput"} + if v.TokenInput == nil { + invalidParams.Add(smithy.NewErrParamRequired("TokenInput")) + } else if v.TokenInput != nil { + if err := validateCreateOAuth2TokenRequestBody(v.TokenInput); err != nil { + invalidParams.AddNested("TokenInput", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md index 4c5e39d8739..4ef304c1f77 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md @@ -1,3 +1,49 @@ +# v1.30.7 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.6 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.30.5 (2025-11-25) + +* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 + +# v1.30.4 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.30.3 (2025-11-12) + +* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. +* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. +* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. + +# v1.30.2 (2025-11-11) + +* **Bug Fix**: Return validation error if input region is not a valid host label. + +# v1.30.1 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.30.0 (2025-10-30) + +* **Feature**: Update endpoint ruleset parameters casing +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.8 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.29.7 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.29.6 (2025-09-29) * No change notes available for this release. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go index 2c498e4689a..8e5a2e77f87 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go @@ -65,7 +65,12 @@ func timeOperationMetric[T any]( ctx context.Context, metric string, fn func() (T, error), opts ...metrics.RecordMetricOption, ) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return fn() + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) start := time.Now() @@ -78,7 +83,12 @@ func timeOperationMetric[T any]( } func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return func() {} + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) var ended bool @@ -106,6 +116,12 @@ func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { type operationMetricsKey struct{} func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + if _, ok := mp.(metrics.NopMeterProvider); ok { + // not using the metrics system - setting up the metrics context is a memory-intensive operation + // so we should skip it in this case + return parent, nil + } + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sso") om := &operationMetrics{} @@ -153,7 +169,10 @@ func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Hi } func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) + if v := ctx.Value(operationMetricsKey{}); v != nil { + return v.(*operationMetrics) + } + return nil } func operationTracer(p tracing.TracerProvider) tracing.Tracer { @@ -882,138 +901,49 @@ func addInterceptAttempt(stack *middleware.Stack, opts Options) error { }, "Retry", middleware.After) } -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} +func addInterceptors(stack *middleware.Stack, opts Options) error { + // middlewares are expensive, don't add all of these interceptor ones unless the caller + // actually has at least one interceptor configured + // + // at the moment it's all-or-nothing because some of the middlewares here are responsible for + // setting fields in the interceptor context for future ones + if len(opts.Interceptors.BeforeExecution) == 0 && + len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && + len(opts.Interceptors.BeforeRetryLoop) == 0 && + len(opts.Interceptors.BeforeAttempt) == 0 && + len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && + len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && + len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && + len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { + return nil + } -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) + return errors.Join( + stack.Initialize.Add(&smithyhttp.InterceptExecution{ + BeforeExecution: opts.Interceptors.BeforeExecution, + AfterExecution: opts.Interceptors.AfterExecution, + }, middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ + Interceptors: opts.Interceptors.BeforeSerialization, + }, "OperationSerializer", middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ + Interceptors: opts.Interceptors.AfterSerialization, + }, "OperationSerializer", middleware.After), + stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ + Interceptors: opts.Interceptors.BeforeSigning, + }, "Signing", middleware.Before), + stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ + Interceptors: opts.Interceptors.AfterSigning, + }, "Signing", middleware.After), + stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ + BeforeTransmit: opts.Interceptors.BeforeTransmit, + AfterTransmit: opts.Interceptors.AfterTransmit, + }, middleware.After), + stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ + Interceptors: opts.Interceptors.BeforeDeserialization, + }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) + stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ + Interceptors: opts.Interceptors.AfterDeserialization, + }, "OperationDeserializer", middleware.Before), + ) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go index df5dc1674f3..c0b961fcf18 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go @@ -153,40 +153,7 @@ func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go index 2a3b2ad9021..f5ca09ac7d8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go @@ -158,40 +158,7 @@ func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go index f6114a7c105..54511d34a6e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go @@ -157,40 +157,7 @@ func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, op if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go index 2c7f181c344..a21116e96c1 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go @@ -152,40 +152,7 @@ func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go index 708e53c5ad5..c658615fdec 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go @@ -16,8 +16,9 @@ import ( "strings" ) -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { params.Region = options.Region + return nil } type setLegacyContextSigningOptionsMiddleware struct { @@ -94,14 +95,16 @@ type AuthResolverParameters struct { Region string } -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { params := &AuthResolverParameters{ Operation: operation, } - bindAuthParamsRegion(ctx, params, input, options) + if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { + return nil, err + } - return params + return params, nil } // AuthSchemeResolver returns a set of possible authentication options for an @@ -176,7 +179,10 @@ func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in mid _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") defer span.End() - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) + } options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) if err != nil { return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go index 2b22ab779c2..551f05974e8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go @@ -14,6 +14,7 @@ import ( internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints" smithyauth "github.com/aws/smithy-go/auth" smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/endpoints/private/rulesfn" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" "github.com/aws/smithy-go/tracing" @@ -217,11 +218,15 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) { } } -func bindRegion(region string) *string { +func bindRegion(region string) (*string, error) { if region == "" { - return nil + return nil, nil + } + if !rulesfn.IsValidHostLabel(region, true) { + return nil, fmt.Errorf("invalid input region %s", region) } - return aws.String(endpoints.MapFIPSRegion(region)) + + return aws.String(endpoints.MapFIPSRegion(region)), nil } // EndpointParameters provides the parameters that influence how endpoints are @@ -479,10 +484,15 @@ type endpointParamsBinder interface { bindEndpointParams(*EndpointParameters) } -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { +func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { params := &EndpointParameters{} - params.Region = bindRegion(options.Region) + region, err := bindRegion(options.Region) + if err != nil { + return nil, err + } + params.Region = region + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) params.Endpoint = options.BaseEndpoint @@ -491,7 +501,7 @@ func bindEndpointParams(ctx context.Context, input interface{}, options Options) b.bindEndpointParams(params) } - return params + return params, nil } type resolveEndpointV2Middleware struct { @@ -521,7 +531,10 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) + } endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", func() (smithyendpoints.Endpoint, error) { return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json index 1a88fe4df8e..1499c0a9591 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json @@ -30,7 +30,7 @@ "types/types.go", "validators.go" ], - "go": "1.22", + "go": "1.23", "module": "github.com/aws/aws-sdk-go-v2/service/sso", "unstable": false } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go index 3628768ce40..7ad1390e8f4 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go @@ -3,4 +3,4 @@ package sso // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.29.6" +const goModuleVersion = "1.30.7" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go index 8bb8730be07..bbac359645d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go @@ -445,6 +445,13 @@ var defaultPartitions = endpoints.Partitions{ { ID: "aws-eusc", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "portal.sso.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: endpoints.FIPSVariant, }: { @@ -452,6 +459,13 @@ var defaultPartitions = endpoints.Partitions{ Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "portal.sso-fips.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: 0, }: { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md index dc5e399a88b..0ac3f8cc4c9 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md @@ -1,3 +1,52 @@ +# v1.35.12 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.11 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.35.10 (2025-11-25) + +* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 + +# v1.35.9 (2025-11-21) + +* No change notes available for this release. + +# v1.35.8 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.7 (2025-11-12) + +* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. +* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. +* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. + +# v1.35.6 (2025-11-11) + +* **Bug Fix**: Return validation error if input region is not a valid host label. + +# v1.35.5 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.35.4 (2025-10-30) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.3 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.35.2 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.35.1 (2025-09-26) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go index 12ad2f5d9d5..8e8508fa349 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go @@ -65,7 +65,12 @@ func timeOperationMetric[T any]( ctx context.Context, metric string, fn func() (T, error), opts ...metrics.RecordMetricOption, ) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return fn() + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) start := time.Now() @@ -78,7 +83,12 @@ func timeOperationMetric[T any]( } func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return func() {} + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) var ended bool @@ -106,6 +116,12 @@ func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { type operationMetricsKey struct{} func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + if _, ok := mp.(metrics.NopMeterProvider); ok { + // not using the metrics system - setting up the metrics context is a memory-intensive operation + // so we should skip it in this case + return parent, nil + } + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/ssooidc") om := &operationMetrics{} @@ -153,7 +169,10 @@ func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Hi } func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) + if v := ctx.Value(operationMetricsKey{}); v != nil { + return v.(*operationMetrics) + } + return nil } func operationTracer(p tracing.TracerProvider) tracing.Tracer { @@ -882,138 +901,49 @@ func addInterceptAttempt(stack *middleware.Stack, opts Options) error { }, "Retry", middleware.After) } -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} +func addInterceptors(stack *middleware.Stack, opts Options) error { + // middlewares are expensive, don't add all of these interceptor ones unless the caller + // actually has at least one interceptor configured + // + // at the moment it's all-or-nothing because some of the middlewares here are responsible for + // setting fields in the interceptor context for future ones + if len(opts.Interceptors.BeforeExecution) == 0 && + len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && + len(opts.Interceptors.BeforeRetryLoop) == 0 && + len(opts.Interceptors.BeforeAttempt) == 0 && + len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && + len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && + len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && + len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { + return nil + } -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) + return errors.Join( + stack.Initialize.Add(&smithyhttp.InterceptExecution{ + BeforeExecution: opts.Interceptors.BeforeExecution, + AfterExecution: opts.Interceptors.AfterExecution, + }, middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ + Interceptors: opts.Interceptors.BeforeSerialization, + }, "OperationSerializer", middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ + Interceptors: opts.Interceptors.AfterSerialization, + }, "OperationSerializer", middleware.After), + stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ + Interceptors: opts.Interceptors.BeforeSigning, + }, "Signing", middleware.Before), + stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ + Interceptors: opts.Interceptors.AfterSigning, + }, "Signing", middleware.After), + stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ + BeforeTransmit: opts.Interceptors.BeforeTransmit, + AfterTransmit: opts.Interceptors.AfterTransmit, + }, middleware.After), + stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ + Interceptors: opts.Interceptors.BeforeDeserialization, + }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) + stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ + Interceptors: opts.Interceptors.AfterDeserialization, + }, "OperationDeserializer", middleware.Before), + ) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go index 681eb4087c5..3f622dbcb95 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go @@ -223,40 +223,7 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go index d7a27da5953..24cb2fac8db 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go @@ -270,40 +270,7 @@ func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go index 8d50092fb15..14472ee3be6 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go @@ -194,40 +194,7 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go index 7242ac82b68..92a6854a776 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go @@ -176,40 +176,7 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go index 89b01c629dd..5f253df305e 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go @@ -16,8 +16,9 @@ import ( "strings" ) -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { params.Region = options.Region + return nil } type setLegacyContextSigningOptionsMiddleware struct { @@ -94,14 +95,16 @@ type AuthResolverParameters struct { Region string } -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { params := &AuthResolverParameters{ Operation: operation, } - bindAuthParamsRegion(ctx, params, input, options) + if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { + return nil, err + } - return params + return params, nil } // AuthSchemeResolver returns a set of possible authentication options for an @@ -170,7 +173,10 @@ func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in mid _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") defer span.End() - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) + } options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) if err != nil { return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go index 1e001f7a9e8..884983eb4d0 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go @@ -14,6 +14,7 @@ import ( internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints" smithyauth "github.com/aws/smithy-go/auth" smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/endpoints/private/rulesfn" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" "github.com/aws/smithy-go/tracing" @@ -217,11 +218,15 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) { } } -func bindRegion(region string) *string { +func bindRegion(region string) (*string, error) { if region == "" { - return nil + return nil, nil + } + if !rulesfn.IsValidHostLabel(region, true) { + return nil, fmt.Errorf("invalid input region %s", region) } - return aws.String(endpoints.MapFIPSRegion(region)) + + return aws.String(endpoints.MapFIPSRegion(region)), nil } // EndpointParameters provides the parameters that influence how endpoints are @@ -479,10 +484,15 @@ type endpointParamsBinder interface { bindEndpointParams(*EndpointParameters) } -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { +func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { params := &EndpointParameters{} - params.Region = bindRegion(options.Region) + region, err := bindRegion(options.Region) + if err != nil { + return nil, err + } + params.Region = region + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) params.Endpoint = options.BaseEndpoint @@ -491,7 +501,7 @@ func bindEndpointParams(ctx context.Context, input interface{}, options Options) b.bindEndpointParams(params) } - return params + return params, nil } type resolveEndpointV2Middleware struct { @@ -521,7 +531,10 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) + } endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", func() (smithyendpoints.Endpoint, error) { return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json index f3b0b242acc..ee79b48eaa5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json @@ -31,7 +31,7 @@ "types/types.go", "validators.go" ], - "go": "1.22", + "go": "1.23", "module": "github.com/aws/aws-sdk-go-v2/service/ssooidc", "unstable": false } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go index 765f6371dae..13996510020 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go @@ -3,4 +3,4 @@ package ssooidc // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.35.1" +const goModuleVersion = "1.35.12" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go index f15c1a3ff52..2088fc7fb22 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go @@ -157,6 +157,9 @@ var defaultPartitions = endpoints.Partitions{ Region: "ap-east-1", }, }, + endpoints.EndpointKey{ + Region: "ap-east-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{ @@ -445,6 +448,13 @@ var defaultPartitions = endpoints.Partitions{ { ID: "aws-eusc", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "oidc.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: endpoints.FIPSVariant, }: { @@ -452,6 +462,13 @@ var defaultPartitions = endpoints.Partitions{ Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "oidc-fips.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: 0, }: { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md index 77183922d3c..42c252ba1fa 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md @@ -1,3 +1,65 @@ +# v1.41.5 (2025-12-09) + +* No change notes available for this release. + +# v1.41.4 (2025-12-08) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.41.3 (2025-12-02) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. + +# v1.41.2 (2025-11-25) + +* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 + +# v1.41.1 (2025-11-19.2) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.41.0 (2025-11-19) + +* **Feature**: IAM now supports outbound identity federation via the STS GetWebIdentityToken API, enabling AWS workloads to securely authenticate with external services using short-lived JSON Web Tokens. + +# v1.40.2 (2025-11-12) + +* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. +* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. +* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. + +# v1.40.1 (2025-11-11) + +* **Bug Fix**: Return validation error if input region is not a valid host label. + +# v1.40.0 (2025-11-10) + +* **Feature**: Added GetDelegatedAccessToken API, which is not available for general use at this time. + +# v1.39.1 (2025-11-04) + +* **Dependency Update**: Updated to the latest SDK module versions +* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. + +# v1.39.0 (2025-10-30) + +* **Feature**: Update endpoint ruleset parameters casing +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.9 (2025-10-23) + +* **Dependency Update**: Updated to the latest SDK module versions + +# v1.38.8 (2025-10-22) + +* No change notes available for this release. + +# v1.38.7 (2025-10-16) + +* **Dependency Update**: Bump minimum Go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + # v1.38.6 (2025-09-26) * **Dependency Update**: Updated to the latest SDK module versions diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go index 6658babc95f..70228d0dfa7 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go @@ -68,7 +68,12 @@ func timeOperationMetric[T any]( ctx context.Context, metric string, fn func() (T, error), opts ...metrics.RecordMetricOption, ) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return fn() + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) start := time.Now() @@ -81,7 +86,12 @@ func timeOperationMetric[T any]( } func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) + mm := getOperationMetrics(ctx) + if mm == nil { // not using the metrics system + return func() {} + } + + instr := mm.histogramFor(metric) opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) var ended bool @@ -109,6 +119,12 @@ func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { type operationMetricsKey struct{} func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + if _, ok := mp.(metrics.NopMeterProvider); ok { + // not using the metrics system - setting up the metrics context is a memory-intensive operation + // so we should skip it in this case + return parent, nil + } + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sts") om := &operationMetrics{} @@ -156,7 +172,10 @@ func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Hi } func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) + if v := ctx.Value(operationMetricsKey{}); v != nil { + return v.(*operationMetrics) + } + return nil } func operationTracer(p tracing.TracerProvider) tracing.Tracer { @@ -1034,138 +1053,49 @@ func addInterceptAttempt(stack *middleware.Stack, opts Options) error { }, "Retry", middleware.After) } -func addInterceptExecution(stack *middleware.Stack, opts Options) error { - return stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before) -} - -func addInterceptBeforeSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before) -} - -func addInterceptAfterSerialization(stack *middleware.Stack, opts Options) error { - return stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After) -} - -func addInterceptBeforeSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before) -} - -func addInterceptAfterSigning(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After) -} - -func addInterceptTransmit(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After) -} - -func addInterceptBeforeDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After) // (deserialize stack is called in reverse) -} - -func addInterceptAfterDeserialization(stack *middleware.Stack, opts Options) error { - return stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} +func addInterceptors(stack *middleware.Stack, opts Options) error { + // middlewares are expensive, don't add all of these interceptor ones unless the caller + // actually has at least one interceptor configured + // + // at the moment it's all-or-nothing because some of the middlewares here are responsible for + // setting fields in the interceptor context for future ones + if len(opts.Interceptors.BeforeExecution) == 0 && + len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && + len(opts.Interceptors.BeforeRetryLoop) == 0 && + len(opts.Interceptors.BeforeAttempt) == 0 && + len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && + len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && + len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && + len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { + return nil + } -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) + return errors.Join( + stack.Initialize.Add(&smithyhttp.InterceptExecution{ + BeforeExecution: opts.Interceptors.BeforeExecution, + AfterExecution: opts.Interceptors.AfterExecution, + }, middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ + Interceptors: opts.Interceptors.BeforeSerialization, + }, "OperationSerializer", middleware.Before), + stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ + Interceptors: opts.Interceptors.AfterSerialization, + }, "OperationSerializer", middleware.After), + stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ + Interceptors: opts.Interceptors.BeforeSigning, + }, "Signing", middleware.Before), + stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ + Interceptors: opts.Interceptors.AfterSigning, + }, "Signing", middleware.After), + stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ + BeforeTransmit: opts.Interceptors.BeforeTransmit, + AfterTransmit: opts.Interceptors.AfterTransmit, + }, middleware.After), + stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ + Interceptors: opts.Interceptors.BeforeDeserialization, + }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) + stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ + Interceptors: opts.Interceptors.AfterDeserialization, + }, "OperationDeserializer", middleware.Before), + ) } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go index f3a93418fa0..0ddd3623ae5 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go @@ -147,7 +147,7 @@ type AssumeRoleInput struct { // // The regex used to validate this parameter is a string of characters consisting // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- + // include underscores or any of the following characters: +=,.@- // // [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds // [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname @@ -196,7 +196,7 @@ type AssumeRoleInput struct { // // The regex used to validate this parameter is a string of characters consisting // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@:/- + // include underscores or any of the following characters: +=,.@:\/- // // [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html ExternalId *string @@ -279,7 +279,7 @@ type AssumeRoleInput struct { // // The regex used to validate this parameter is a string of characters consisting // of upper- and lower-case alphanumeric characters with no spaces. You can also - // include underscores or any of the following characters: =,.@- + // include underscores or any of the following characters: +=/:,.@- SerialNumber *string // The source identity specified by the principal that is calling the AssumeRole @@ -508,40 +508,7 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go index 9dcceec12a2..15f1dd91d29 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go @@ -23,6 +23,9 @@ import ( // these temporary security credentials to sign calls to Amazon Web Services // services. // +// AssumeRoleWithSAML will not work on IAM Identity Center managed roles. These +// roles' names start with AWSReservedSSO_ . +// // # Session Duration // // By default, the temporary security credentials created by AssumeRoleWithSAML @@ -440,40 +443,7 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go index 5975a0cdee8..7006eb3b7fb 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go @@ -75,7 +75,7 @@ import ( // // (Optional) You can configure your IdP to pass attributes into your web identity // token as session tags. Each session tag consists of a key name and an associated -// value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User Guide. +// value. For more information about session tags, see [Passing session tags using AssumeRoleWithWebIdentity]in the IAM User Guide. // // You can pass up to 50 session tags. The plaintext session tag keys can’t exceed // 128 characters and the values can’t exceed 256 characters. For these and @@ -123,6 +123,7 @@ import ( // providers to get and use temporary security credentials. // // [Amazon Web Services SDK for iOS Developer Guide]: http://aws.amazon.com/sdkforios/ +// [Passing session tags using AssumeRoleWithWebIdentity]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_adding-assume-role-idp // [Amazon Web Services SDK for Android Developer Guide]: http://aws.amazon.com/sdkforandroid/ // [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length // [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session @@ -135,7 +136,6 @@ import ( // [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html // [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session // [Amazon Cognito federated identities]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html -// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html // [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining // [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration // [Using Web Identity Federation API Operations for Mobile Apps]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html @@ -460,40 +460,7 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go index 571f06728a5..009c4055838 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go @@ -12,7 +12,9 @@ import ( ) // Returns a set of short term credentials you can use to perform privileged tasks -// on a member account in your organization. +// on a member account in your organization. You must use credentials from an +// Organizations management account or a delegated administrator account for IAM to +// call AssumeRoot . You cannot use root user credentials to make this call. // // Before you can launch a privileged session, you must have centralized root // access in your organization. For steps to enable this feature, see [Centralize root access for member accounts]in the IAM @@ -24,8 +26,16 @@ import ( // You can track AssumeRoot in CloudTrail logs to determine what actions were // performed in a session. For more information, see [Track privileged tasks in CloudTrail]in the IAM User Guide. // +// When granting access to privileged tasks you should only grant the necessary +// permissions required to perform that task. For more information, see [Security best practices in IAM]. In +// addition, you can use [service control policies](SCPs) to manage and limit permissions in your +// organization. See [General examples]in the Organizations User Guide for more information on SCPs. +// // [Endpoints]: https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html#sts-endpoints +// [Security best practices in IAM]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html // [Track privileged tasks in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-track-privileged-tasks.html +// [General examples]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_examples_general.html +// [service control policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps.html // [Centralize root access for member accounts]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html func (c *Client) AssumeRoot(ctx context.Context, params *AssumeRootInput, optFns ...func(*Options)) (*AssumeRootOutput, error) { if params == nil { @@ -50,8 +60,10 @@ type AssumeRootInput struct { TargetPrincipal *string // The identity based policy that scopes the session to the privileged tasks that - // can be performed. You can use one of following Amazon Web Services managed - // policies to scope root session actions. + // can be performed. You must + // + // use one of following Amazon Web Services managed policies to scope root session + // actions: // // [IAMAuditRootUserCredentials] // @@ -205,40 +217,7 @@ func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, opti if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go index 786bac89b8a..b00b0c4096c 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go @@ -177,40 +177,7 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go index 6c1f878981c..887bb081f3b 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go @@ -168,40 +168,7 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go index 7d0653398b3..2c8d8867013 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go @@ -156,40 +156,7 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go new file mode 100644 index 00000000000..092ec13e3a3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetDelegatedAccessToken.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Exchanges a trade-in token for temporary Amazon Web Services credentials with +// the permissions associated with the assumed principal. This operation allows you +// to obtain credentials for a specific principal based on a trade-in token, +// enabling delegation of access to Amazon Web Services resources. +func (c *Client) GetDelegatedAccessToken(ctx context.Context, params *GetDelegatedAccessTokenInput, optFns ...func(*Options)) (*GetDelegatedAccessTokenOutput, error) { + if params == nil { + params = &GetDelegatedAccessTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDelegatedAccessToken", params, optFns, c.addOperationGetDelegatedAccessTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDelegatedAccessTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDelegatedAccessTokenInput struct { + + // The token to exchange for temporary Amazon Web Services credentials. This token + // must be valid and unexpired at the time of the request. + // + // This member is required. + TradeInToken *string + + noSmithyDocumentSerde +} + +type GetDelegatedAccessTokenOutput struct { + + // The Amazon Resource Name (ARN) of the principal that was assumed when obtaining + // the delegated access token. This ARN identifies the IAM entity whose permissions + // are granted by the temporary credentials. + AssumedPrincipal *string + + // Amazon Web Services credentials for API authentication. + Credentials *types.Credentials + + // The percentage of the maximum policy size that is used by the session policy. + // The policy size is calculated as the sum of all the session policies and + // permission boundaries attached to the session. If the packed size exceeds 100%, + // the request fails. + PackedPolicySize *int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDelegatedAccessTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetDelegatedAccessToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetDelegatedAccessToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDelegatedAccessToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpGetDelegatedAccessTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDelegatedAccessToken(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptors(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDelegatedAccessToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDelegatedAccessToken", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go index 1c2f28e519c..e0fc9a54848 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go @@ -381,40 +381,7 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go index 25604699009..2f931f4446d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go @@ -227,40 +227,7 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, if err = addInterceptAttempt(stack, options); err != nil { return err } - if err = addInterceptExecution(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSerialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterSerialization(stack, options); err != nil { - return err - } - if err = addInterceptBeforeSigning(stack, options); err != nil { - return err - } - if err = addInterceptAfterSigning(stack, options); err != nil { - return err - } - if err = addInterceptTransmit(stack, options); err != nil { - return err - } - if err = addInterceptBeforeDeserialization(stack, options); err != nil { - return err - } - if err = addInterceptAfterDeserialization(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { + if err = addInterceptors(stack, options); err != nil { return err } return nil diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go new file mode 100644 index 00000000000..306ee43b1e2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetWebIdentityToken.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package sts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/sts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a signed JSON Web Token (JWT) that represents the calling Amazon Web +// Services identity. The returned JWT can be used to authenticate with external +// services that support OIDC discovery. The token is signed by Amazon Web Services +// STS and can be publicly verified using the verification keys published at the +// issuer's JWKS endpoint. +func (c *Client) GetWebIdentityToken(ctx context.Context, params *GetWebIdentityTokenInput, optFns ...func(*Options)) (*GetWebIdentityTokenOutput, error) { + if params == nil { + params = &GetWebIdentityTokenInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWebIdentityToken", params, optFns, c.addOperationGetWebIdentityTokenMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWebIdentityTokenOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWebIdentityTokenInput struct { + + // The intended recipient of the web identity token. This value populates the aud + // claim in the JWT and should identify the service or application that will + // validate and use the token. The external service should verify this claim to + // ensure the token was intended for their use. + // + // This member is required. + Audience []string + + // The cryptographic algorithm to use for signing the JSON Web Token (JWT). Valid + // values are RS256 (RSA with SHA-256) and ES384 (ECDSA using P-384 curve with + // SHA-384). + // + // This member is required. + SigningAlgorithm *string + + // The duration, in seconds, for which the JSON Web Token (JWT) will remain valid. + // The value can range from 60 seconds (1 minute) to 3600 seconds (1 hour). If not + // specified, the default duration is 300 seconds (5 minutes). The token is + // designed to be short-lived and should be used for proof of identity, then + // exchanged for credentials or short-lived tokens in the external service. + DurationSeconds *int32 + + // An optional list of tags to include in the JSON Web Token (JWT). These tags are + // added as custom claims to the JWT and can be used by the downstream service for + // authorization decisions. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type GetWebIdentityTokenOutput struct { + + // The date and time when the web identity token expires, in UTC. The expiration + // is determined by adding the DurationSeconds value to the time the token was + // issued. After this time, the token should no longer be considered valid. + Expiration *time.Time + + // A signed JSON Web Token (JWT) that represents the caller's Amazon Web Services + // identity. The token contains standard JWT claims such as subject, audience, + // expiration time, and additional identity attributes added by STS as custom + // claims. You can also add your own custom claims to the token by passing tags as + // request parameters to the GetWebIdentityToken API. The token is signed using + // the specified signing algorithm and can be verified using the verification keys + // available at the issuer's JWKS endpoint. + WebIdentityToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetWebIdentityTokenMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsquery_serializeOpGetWebIdentityToken{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpGetWebIdentityToken{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetWebIdentityToken"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addCredentialSource(stack, options); err != nil { + return err + } + if err = addOpGetWebIdentityTokenValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWebIdentityToken(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addInterceptBeforeRetryLoop(stack, options); err != nil { + return err + } + if err = addInterceptAttempt(stack, options); err != nil { + return err + } + if err = addInterceptors(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetWebIdentityToken(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetWebIdentityToken", + } +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go index 2a81b3fb19d..4db5a51f938 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go @@ -16,8 +16,9 @@ import ( "strings" ) -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { params.Region = options.Region + return nil } type setLegacyContextSigningOptionsMiddleware struct { @@ -94,14 +95,16 @@ type AuthResolverParameters struct { Region string } -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { params := &AuthResolverParameters{ Operation: operation, } - bindAuthParamsRegion(ctx, params, input, options) + if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { + return nil, err + } - return params + return params, nil } // AuthSchemeResolver returns a set of possible authentication options for an @@ -164,7 +167,10 @@ func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in mid _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") defer span.End() - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) + } options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) if err != nil { return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go index a1ac917ec6a..8c1ce351616 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go @@ -846,6 +846,124 @@ func awsAwsquery_deserializeOpErrorGetCallerIdentity(response *smithyhttp.Respon } } +type awsAwsquery_deserializeOpGetDelegatedAccessToken struct { +} + +func (*awsAwsquery_deserializeOpGetDelegatedAccessToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetDelegatedAccessToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetDelegatedAccessToken(response, &metadata) + } + output := &GetDelegatedAccessTokenOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetDelegatedAccessTokenResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetDelegatedAccessTokenOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetDelegatedAccessToken(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ExpiredTradeInTokenException", errorCode): + return awsAwsquery_deserializeErrorExpiredTradeInTokenException(response, errorBody) + + case strings.EqualFold("PackedPolicyTooLarge", errorCode): + return awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response, errorBody) + + case strings.EqualFold("RegionDisabledException", errorCode): + return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsquery_deserializeOpGetFederationToken struct { } @@ -1076,6 +1194,124 @@ func awsAwsquery_deserializeOpErrorGetSessionToken(response *smithyhttp.Response } } +type awsAwsquery_deserializeOpGetWebIdentityToken struct { +} + +func (*awsAwsquery_deserializeOpGetWebIdentityToken) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpGetWebIdentityToken) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorGetWebIdentityToken(response, &metadata) + } + output := &GetWebIdentityTokenOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("GetWebIdentityTokenResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentGetWebIdentityTokenOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorGetWebIdentityToken(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("JWTPayloadSizeExceededException", errorCode): + return awsAwsquery_deserializeErrorJWTPayloadSizeExceededException(response, errorBody) + + case strings.EqualFold("OutboundWebIdentityFederationDisabledException", errorCode): + return awsAwsquery_deserializeErrorOutboundWebIdentityFederationDisabledException(response, errorBody) + + case strings.EqualFold("SessionDurationEscalationException", errorCode): + return awsAwsquery_deserializeErrorSessionDurationEscalationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsAwsquery_deserializeErrorExpiredTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ExpiredTokenException{} var buff [1024]byte @@ -1120,8 +1356,8 @@ func awsAwsquery_deserializeErrorExpiredTokenException(response *smithyhttp.Resp return output } -func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IDPCommunicationErrorException{} +func awsAwsquery_deserializeErrorExpiredTradeInTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ExpiredTradeInTokenException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1151,7 +1387,7 @@ func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithy } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentIDPCommunicationErrorException(&output, decoder) + err = awsAwsquery_deserializeDocumentExpiredTradeInTokenException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1164,8 +1400,8 @@ func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithy return output } -func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IDPRejectedClaimException{} +func awsAwsquery_deserializeErrorIDPCommunicationErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IDPCommunicationErrorException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1195,7 +1431,7 @@ func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentIDPRejectedClaimException(&output, decoder) + err = awsAwsquery_deserializeDocumentIDPCommunicationErrorException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1208,8 +1444,8 @@ func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp. return output } -func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidAuthorizationMessageException{} +func awsAwsquery_deserializeErrorIDPRejectedClaimException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IDPRejectedClaimException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1239,7 +1475,7 @@ func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response * } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(&output, decoder) + err = awsAwsquery_deserializeDocumentIDPRejectedClaimException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1252,8 +1488,8 @@ func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response * return output } -func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidIdentityTokenException{} +func awsAwsquery_deserializeErrorInvalidAuthorizationMessageException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidAuthorizationMessageException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1283,7 +1519,7 @@ func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyh } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentInvalidIdentityTokenException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1296,8 +1532,8 @@ func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyh return output } -func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.MalformedPolicyDocumentException{} +func awsAwsquery_deserializeErrorInvalidIdentityTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidIdentityTokenException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1327,7 +1563,7 @@ func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smit } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(&output, decoder) + err = awsAwsquery_deserializeDocumentInvalidIdentityTokenException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1340,8 +1576,8 @@ func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smit return output } -func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PackedPolicyTooLargeException{} +func awsAwsquery_deserializeErrorJWTPayloadSizeExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.JWTPayloadSizeExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1371,7 +1607,7 @@ func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyh } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(&output, decoder) + err = awsAwsquery_deserializeDocumentJWTPayloadSizeExceededException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1384,8 +1620,8 @@ func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyh return output } -func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.RegionDisabledException{} +func awsAwsquery_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.MalformedPolicyDocumentException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -1415,7 +1651,7 @@ func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsAwsquery_deserializeDocumentRegionDisabledException(&output, decoder) + err = awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1428,13 +1664,441 @@ func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Re return output } -func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeErrorOutboundWebIdentityFederationDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.OutboundWebIdentityFederationDisabledException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentOutboundWebIdentityFederationDisabledException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorPackedPolicyTooLargeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PackedPolicyTooLargeException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorRegionDisabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.RegionDisabledException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentRegionDisabledException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeErrorSessionDurationEscalationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.SessionDurationEscalationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeDocumentSessionDurationEscalationException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AssumedRoleUser + if *v == nil { + sv = &types.AssumedRoleUser{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Arn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Arn = ptr.String(xtv) + } + + case strings.EqualFold("AssumedRoleId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AssumedRoleId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.Credentials + if *v == nil { + sv = &types.Credentials{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AccessKeyId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AccessKeyId = ptr.String(xtv) + } + + case strings.EqualFold("Expiration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.Expiration = ptr.Time(t) + } + + case strings.EqualFold("SecretAccessKey", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SecretAccessKey = ptr.String(xtv) + } + + case strings.EqualFold("SessionToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SessionToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExpiredTokenException + if *v == nil { + sv = &types.ExpiredTokenException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentExpiredTradeInTokenException(v **types.ExpiredTradeInTokenException, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ExpiredTradeInTokenException + if *v == nil { + sv = &types.ExpiredTradeInTokenException{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AssumedRoleUser + var sv *types.FederatedUser if *v == nil { - sv = &types.AssumedRoleUser{} + sv = &types.FederatedUser{} } else { sv = *v } @@ -1463,7 +2127,7 @@ func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, d sv.Arn = ptr.String(xtv) } - case strings.EqualFold("AssumedRoleId", t.Name.Local): + case strings.EqualFold("FederatedUserId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -1473,7 +2137,7 @@ func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, d } { xtv := string(val) - sv.AssumedRoleId = ptr.String(xtv) + sv.FederatedUserId = ptr.String(xtv) } default: @@ -1490,13 +2154,13 @@ func awsAwsquery_deserializeDocumentAssumedRoleUser(v **types.AssumedRoleUser, d return nil } -func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDPCommunicationErrorException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.Credentials + var sv *types.IDPCommunicationErrorException if *v == nil { - sv = &types.Credentials{} + sv = &types.IDPCommunicationErrorException{} } else { sv = *v } @@ -1512,50 +2176,7 @@ func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder s originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("AccessKeyId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.AccessKeyId = ptr.String(xtv) - } - - case strings.EqualFold("Expiration", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.Expiration = ptr.Time(t) - } - - case strings.EqualFold("SecretAccessKey", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SecretAccessKey = ptr.String(xtv) - } - - case strings.EqualFold("SessionToken", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -1565,7 +2186,7 @@ func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder s } { xtv := string(val) - sv.SessionToken = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -1582,13 +2203,13 @@ func awsAwsquery_deserializeDocumentCredentials(v **types.Credentials, decoder s return nil } -func awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejectedClaimException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ExpiredTokenException + var sv *types.IDPRejectedClaimException if *v == nil { - sv = &types.ExpiredTokenException{} + sv = &types.IDPRejectedClaimException{} } else { sv = *v } @@ -1631,13 +2252,13 @@ func awsAwsquery_deserializeDocumentExpiredTokenException(v **types.ExpiredToken return nil } -func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **types.InvalidAuthorizationMessageException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.FederatedUser + var sv *types.InvalidAuthorizationMessageException if *v == nil { - sv = &types.FederatedUser{} + sv = &types.InvalidAuthorizationMessageException{} } else { sv = *v } @@ -1653,20 +2274,7 @@ func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decod originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Arn", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Arn = ptr.String(xtv) - } - - case strings.EqualFold("FederatedUserId", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -1676,7 +2284,7 @@ func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decod } { xtv := string(val) - sv.FederatedUserId = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -1693,13 +2301,13 @@ func awsAwsquery_deserializeDocumentFederatedUser(v **types.FederatedUser, decod return nil } -func awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDPCommunicationErrorException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.InvalidIdentityTokenException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IDPCommunicationErrorException + var sv *types.InvalidIdentityTokenException if *v == nil { - sv = &types.IDPCommunicationErrorException{} + sv = &types.InvalidIdentityTokenException{} } else { sv = *v } @@ -1742,13 +2350,13 @@ func awsAwsquery_deserializeDocumentIDPCommunicationErrorException(v **types.IDP return nil } -func awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejectedClaimException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentJWTPayloadSizeExceededException(v **types.JWTPayloadSizeExceededException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IDPRejectedClaimException + var sv *types.JWTPayloadSizeExceededException if *v == nil { - sv = &types.IDPRejectedClaimException{} + sv = &types.JWTPayloadSizeExceededException{} } else { sv = *v } @@ -1791,13 +2399,13 @@ func awsAwsquery_deserializeDocumentIDPRejectedClaimException(v **types.IDPRejec return nil } -func awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **types.InvalidAuthorizationMessageException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidAuthorizationMessageException + var sv *types.MalformedPolicyDocumentException if *v == nil { - sv = &types.InvalidAuthorizationMessageException{} + sv = &types.MalformedPolicyDocumentException{} } else { sv = *v } @@ -1840,13 +2448,13 @@ func awsAwsquery_deserializeDocumentInvalidAuthorizationMessageException(v **typ return nil } -func awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.InvalidIdentityTokenException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentOutboundWebIdentityFederationDisabledException(v **types.OutboundWebIdentityFederationDisabledException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidIdentityTokenException + var sv *types.OutboundWebIdentityFederationDisabledException if *v == nil { - sv = &types.InvalidIdentityTokenException{} + sv = &types.OutboundWebIdentityFederationDisabledException{} } else { sv = *v } @@ -1889,13 +2497,13 @@ func awsAwsquery_deserializeDocumentInvalidIdentityTokenException(v **types.Inva return nil } -func awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.PackedPolicyTooLargeException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.MalformedPolicyDocumentException + var sv *types.PackedPolicyTooLargeException if *v == nil { - sv = &types.MalformedPolicyDocumentException{} + sv = &types.PackedPolicyTooLargeException{} } else { sv = *v } @@ -1938,13 +2546,13 @@ func awsAwsquery_deserializeDocumentMalformedPolicyDocumentException(v **types.M return nil } -func awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.PackedPolicyTooLargeException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentRegionDisabledException(v **types.RegionDisabledException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.PackedPolicyTooLargeException + var sv *types.RegionDisabledException if *v == nil { - sv = &types.PackedPolicyTooLargeException{} + sv = &types.RegionDisabledException{} } else { sv = *v } @@ -1987,13 +2595,13 @@ func awsAwsquery_deserializeDocumentPackedPolicyTooLargeException(v **types.Pack return nil } -func awsAwsquery_deserializeDocumentRegionDisabledException(v **types.RegionDisabledException, decoder smithyxml.NodeDecoder) error { +func awsAwsquery_deserializeDocumentSessionDurationEscalationException(v **types.SessionDurationEscalationException, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.RegionDisabledException + var sv *types.SessionDurationEscalationException if *v == nil { - sv = &types.RegionDisabledException{} + sv = &types.SessionDurationEscalationException{} } else { sv = *v } @@ -2602,6 +3210,78 @@ func awsAwsquery_deserializeOpDocumentGetCallerIdentityOutput(v **GetCallerIdent return nil } +func awsAwsquery_deserializeOpDocumentGetDelegatedAccessTokenOutput(v **GetDelegatedAccessTokenOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetDelegatedAccessTokenOutput + if *v == nil { + sv = &GetDelegatedAccessTokenOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("AssumedPrincipal", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AssumedPrincipal = ptr.String(xtv) + } + + case strings.EqualFold("Credentials", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("PackedPolicySize", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.PackedPolicySize = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeOpDocumentGetFederationTokenOutput(v **GetFederationTokenOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2708,3 +3388,69 @@ func awsAwsquery_deserializeOpDocumentGetSessionTokenOutput(v **GetSessionTokenO *v = sv return nil } + +func awsAwsquery_deserializeOpDocumentGetWebIdentityTokenOutput(v **GetWebIdentityTokenOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetWebIdentityTokenOutput + if *v == nil { + sv = &GetWebIdentityTokenOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Expiration", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.Expiration = ptr.Time(t) + } + + case strings.EqualFold("WebIdentityToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.WebIdentityToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go index 945682e1a50..c8f9526c78a 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go @@ -15,6 +15,7 @@ import ( smithy "github.com/aws/smithy-go" smithyauth "github.com/aws/smithy-go/auth" smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/endpoints/private/rulesfn" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/ptr" "github.com/aws/smithy-go/tracing" @@ -218,11 +219,15 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) { } } -func bindRegion(region string) *string { +func bindRegion(region string) (*string, error) { if region == "" { - return nil + return nil, nil + } + if !rulesfn.IsValidHostLabel(region, true) { + return nil, fmt.Errorf("invalid input region %s", region) } - return aws.String(endpoints.MapFIPSRegion(region)) + + return aws.String(endpoints.MapFIPSRegion(region)), nil } // EndpointParameters provides the parameters that influence how endpoints are @@ -1060,10 +1065,15 @@ type endpointParamsBinder interface { bindEndpointParams(*EndpointParameters) } -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { +func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { params := &EndpointParameters{} - params.Region = bindRegion(options.Region) + region, err := bindRegion(options.Region) + if err != nil { + return nil, err + } + params.Region = region + params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) params.Endpoint = options.BaseEndpoint @@ -1072,7 +1082,7 @@ func bindEndpointParams(ctx context.Context, input interface{}, options Options) b.bindEndpointParams(params) } - return params + return params, nil } type resolveEndpointV2Middleware struct { @@ -1102,7 +1112,10 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") } - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + if err != nil { + return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) + } endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", func() (smithyendpoints.Endpoint, error) { return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json index 86bb3b79be4..e61823ea016 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json @@ -17,8 +17,10 @@ "api_op_DecodeAuthorizationMessage.go", "api_op_GetAccessKeyInfo.go", "api_op_GetCallerIdentity.go", + "api_op_GetDelegatedAccessToken.go", "api_op_GetFederationToken.go", "api_op_GetSessionToken.go", + "api_op_GetWebIdentityToken.go", "auth.go", "deserializers.go", "doc.go", @@ -37,7 +39,7 @@ "types/types.go", "validators.go" ], - "go": "1.22", + "go": "1.23", "module": "github.com/aws/aws-sdk-go-v2/service/sts", "unstable": false } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go index dd0eacf56c2..c081cdeb307 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go @@ -3,4 +3,4 @@ package sts // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.38.6" +const goModuleVersion = "1.41.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go index 1dc87dd6bf1..be72d93dccd 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go @@ -359,6 +359,13 @@ var defaultPartitions = endpoints.Partitions{ { ID: "aws-eusc", Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "sts.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: endpoints.FIPSVariant, }: { @@ -366,6 +373,13 @@ var defaultPartitions = endpoints.Partitions{ Protocols: []string{"https"}, SignatureVersions: []string{"v4"}, }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "sts-fips.{region}.api.amazonwebservices.eu", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, { Variant: 0, }: { @@ -376,6 +390,11 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsEusc, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "eusc-de-east-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-iso", @@ -430,6 +449,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-isob-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-isob-west-1", + }: endpoints.Endpoint{}, }, }, { diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go index 96b222136bf..5e227387827 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go @@ -502,6 +502,76 @@ func (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsquery_serializeOpGetDelegatedAccessToken struct { +} + +func (*awsAwsquery_serializeOpGetDelegatedAccessToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetDelegatedAccessToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDelegatedAccessTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetDelegatedAccessToken") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentGetDelegatedAccessTokenInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsquery_serializeOpGetFederationToken struct { } @@ -641,6 +711,76 @@ func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Con span.End() return next.HandleSerialize(ctx, in) } + +type awsAwsquery_serializeOpGetWebIdentityToken struct { +} + +func (*awsAwsquery_serializeOpGetWebIdentityToken) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpGetWebIdentityToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWebIdentityTokenInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetWebIdentityToken") + body.Key("Version").String("2011-06-15") + + if err := awsAwsquery_serializeOpDocumentGetWebIdentityTokenInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} func awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error { array := value.Array("member") @@ -733,6 +873,16 @@ func awsAwsquery_serializeDocumentTagListType(v []types.Tag, value query.Value) return nil } +func awsAwsquery_serializeDocumentWebIdentityTokenAudienceListType(v []string, value query.Value) error { + array := value.Array("member") + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value query.Value) error { object := value.Object() _ = object @@ -946,6 +1096,18 @@ func awsAwsquery_serializeOpDocumentGetCallerIdentityInput(v *GetCallerIdentityI return nil } +func awsAwsquery_serializeOpDocumentGetDelegatedAccessTokenInput(v *GetDelegatedAccessTokenInput, value query.Value) error { + object := value.Object() + _ = object + + if v.TradeInToken != nil { + objectKey := object.Key("TradeInToken") + objectKey.String(*v.TradeInToken) + } + + return nil +} + func awsAwsquery_serializeOpDocumentGetFederationTokenInput(v *GetFederationTokenInput, value query.Value) error { object := value.Object() _ = object @@ -1003,3 +1165,34 @@ func awsAwsquery_serializeOpDocumentGetSessionTokenInput(v *GetSessionTokenInput return nil } + +func awsAwsquery_serializeOpDocumentGetWebIdentityTokenInput(v *GetWebIdentityTokenInput, value query.Value) error { + object := value.Object() + _ = object + + if v.Audience != nil { + objectKey := object.Key("Audience") + if err := awsAwsquery_serializeDocumentWebIdentityTokenAudienceListType(v.Audience, objectKey); err != nil { + return err + } + } + + if v.DurationSeconds != nil { + objectKey := object.Key("DurationSeconds") + objectKey.Integer(*v.DurationSeconds) + } + + if v.SigningAlgorithm != nil { + objectKey := object.Key("SigningAlgorithm") + objectKey.String(*v.SigningAlgorithm) + } + + if v.Tags != nil { + objectKey := object.Key("Tags") + if err := awsAwsquery_serializeDocumentTagListType(v.Tags, objectKey); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go index 041629bba2c..70d99a220b8 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go @@ -34,6 +34,33 @@ func (e *ExpiredTokenException) ErrorCode() string { } func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The trade-in token provided in the request has expired and can no longer be +// exchanged for credentials. Request a new token and retry the operation. +type ExpiredTradeInTokenException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ExpiredTradeInTokenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ExpiredTradeInTokenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ExpiredTradeInTokenException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ExpiredTradeInTokenException" + } + return *e.ErrorCodeOverride +} +func (e *ExpiredTradeInTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request could not be fulfilled because the identity provider (IDP) that was // asked to verify the incoming identity token could not be reached. This is often // a transient error caused by network conditions. Retry the request a limited @@ -152,6 +179,34 @@ func (e *InvalidIdentityTokenException) ErrorCode() string { } func (e *InvalidIdentityTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The requested token payload size exceeds the maximum allowed size. Reduce the +// number of request tags included in the GetWebIdentityToken API call to reduce +// the token payload size. +type JWTPayloadSizeExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *JWTPayloadSizeExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *JWTPayloadSizeExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *JWTPayloadSizeExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "JWTPayloadSizeExceededException" + } + return *e.ErrorCodeOverride +} +func (e *JWTPayloadSizeExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request was rejected because the policy document was malformed. The error // message describes the specific error. type MalformedPolicyDocumentException struct { @@ -179,6 +234,36 @@ func (e *MalformedPolicyDocumentException) ErrorCode() string { } func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The outbound web identity federation feature is not enabled for this account. +// To use this feature, you must first enable it through the Amazon Web Services +// Management Console or API. +type OutboundWebIdentityFederationDisabledException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *OutboundWebIdentityFederationDisabledException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *OutboundWebIdentityFederationDisabledException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *OutboundWebIdentityFederationDisabledException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "OutboundWebIdentityFederationDisabledException" + } + return *e.ErrorCodeOverride +} +func (e *OutboundWebIdentityFederationDisabledException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // The request was rejected because the total packed size of the session policies // and session tags combined was too large. An Amazon Web Services conversion // compresses the session policy document, session policy ARNs, and session tags @@ -221,7 +306,7 @@ func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return // console to activate STS in that region. For more information, see [Activating and Deactivating STS in an Amazon Web Services Region]in the IAM // User Guide. // -// [Activating and Deactivating STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html +// [Activating and Deactivating STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html#sts-regions-activate-deactivate type RegionDisabledException struct { Message *string @@ -246,3 +331,33 @@ func (e *RegionDisabledException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *RegionDisabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The requested token duration would extend the session beyond its original +// expiration time. You cannot use this operation to extend the lifetime of a +// session beyond what was granted when the session was originally created. +type SessionDurationEscalationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *SessionDurationEscalationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *SessionDurationEscalationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *SessionDurationEscalationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "SessionDurationEscalationException" + } + return *e.ErrorCodeOverride +} +func (e *SessionDurationEscalationException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go index 1026e22118d..4d37dd22a1d 100644 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go +++ b/vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go @@ -130,6 +130,26 @@ func (m *validateOpGetAccessKeyInfo) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetDelegatedAccessToken struct { +} + +func (*validateOpGetDelegatedAccessToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDelegatedAccessToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDelegatedAccessTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDelegatedAccessTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetFederationToken struct { } @@ -150,6 +170,26 @@ func (m *validateOpGetFederationToken) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetWebIdentityToken struct { +} + +func (*validateOpGetWebIdentityToken) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWebIdentityToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWebIdentityTokenInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWebIdentityTokenInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAssumeRoleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssumeRole{}, middleware.After) } @@ -174,10 +214,18 @@ func addOpGetAccessKeyInfoValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAccessKeyInfo{}, middleware.After) } +func addOpGetDelegatedAccessTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDelegatedAccessToken{}, middleware.After) +} + func addOpGetFederationTokenValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetFederationToken{}, middleware.After) } +func addOpGetWebIdentityTokenValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWebIdentityToken{}, middleware.After) +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -326,6 +374,21 @@ func validateOpGetAccessKeyInfoInput(v *GetAccessKeyInfoInput) error { } } +func validateOpGetDelegatedAccessTokenInput(v *GetDelegatedAccessTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDelegatedAccessTokenInput"} + if v.TradeInToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("TradeInToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetFederationTokenInput(v *GetFederationTokenInput) error { if v == nil { return nil @@ -345,3 +408,26 @@ func validateOpGetFederationTokenInput(v *GetFederationTokenInput) error { return nil } } + +func validateOpGetWebIdentityTokenInput(v *GetWebIdentityTokenInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWebIdentityTokenInput"} + if v.Audience == nil { + invalidParams.Add(smithy.NewErrParamRequired("Audience")) + } + if v.SigningAlgorithm == nil { + invalidParams.Add(smithy.NewErrParamRequired("SigningAlgorithm")) + } + if v.Tags != nil { + if err := validateTagListType(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/vendor/github.com/aws/smithy-go/CHANGELOG.md b/vendor/github.com/aws/smithy-go/CHANGELOG.md index 8b6ab295004..80af245f087 100644 --- a/vendor/github.com/aws/smithy-go/CHANGELOG.md +++ b/vendor/github.com/aws/smithy-go/CHANGELOG.md @@ -1,3 +1,34 @@ +# Release (2025-12-01) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.24.0 + * **Feature**: Improve allocation footprint of the middleware stack. This should convey a ~10% reduction in allocations per SDK request. + +# Release (2025-11-03) + +## General Highlights +* **Dependency Update**: Updated to the latest SDK module versions + +## Module Highlights +* `github.com/aws/smithy-go`: v1.23.2 + * **Bug Fix**: Adjust the initial sizes of each middleware phase to avoid some unnecessary reallocation. + * **Bug Fix**: Avoid unnecessary allocation overhead from the metrics system when not in use. + +# Release (2025-10-15) + +## General Highlights +* **Dependency Update**: Bump minimum go version to 1.23. +* **Dependency Update**: Updated to the latest SDK module versions + +# Release (2025-09-18) + +## Module Highlights +* `github.com/aws/smithy-go/aws-http-auth`: [v1.1.0](aws-http-auth/CHANGELOG.md#v110-2025-09-18) + * **Feature**: Added support for SIG4/SIGV4A querystring authentication. + # Release (2025-08-27) ## General Highlights diff --git a/vendor/github.com/aws/smithy-go/Makefile b/vendor/github.com/aws/smithy-go/Makefile index 34b17ab2fe0..a12b124d505 100644 --- a/vendor/github.com/aws/smithy-go/Makefile +++ b/vendor/github.com/aws/smithy-go/Makefile @@ -13,6 +13,7 @@ REPOTOOLS_CMD_GENERATE_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/generatechangelog@${R REPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} REPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION} REPOTOOLS_CMD_MODULE_VERSION = ${REPOTOOLS_MODULE}/cmd/moduleversion@${REPOTOOLS_VERSION} +REPOTOOLS_CMD_EACHMODULE = ${REPOTOOLS_MODULE}/cmd/eachmodule@${REPOTOOLS_VERSION} UNIT_TEST_TAGS= BUILD_TAGS= @@ -55,8 +56,11 @@ ensure-gradle-up: verify: vet -vet: - go vet ${BUILD_TAGS} --all ./... +vet: vet-modules-. + +vet-modules-%: + go run ${REPOTOOLS_CMD_EACHMODULE} -p $(subst vet-modules-,,$@) \ + "go vet ${BUILD_TAGS} --all ./..." cover: go test ${BUILD_TAGS} -coverprofile c.out ./... @@ -66,21 +70,22 @@ cover: ################ # Unit Testing # ################ -.PHONY: unit unit-race unit-test unit-race-test +.PHONY: test unit unit-race + +test: unit-race + +unit: verify unit-modules-. -unit: verify - go test ${BUILD_TAGS} ${RUN_NONE} ./... && \ - go test -timeout=1m ${UNIT_TEST_TAGS} ./... +unit-modules-%: + go run ${REPOTOOLS_CMD_EACHMODULE} -p $(subst unit-modules-,,$@) \ + "go test -timeout=1m ${UNIT_TEST_TAGS} ./..." -unit-race: verify - go test ${BUILD_TAGS} ${RUN_NONE} ./... && \ - go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./... +unit-race: verify unit-race-modules-. -unit-test: verify - go test -timeout=1m ${UNIT_TEST_TAGS} ./... +unit-race-modules-%: + go run ${REPOTOOLS_CMD_EACHMODULE} -p $(subst unit-race-modules-,,$@) \ + "go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./..." -unit-race-test: verify - go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./... ##################### # Release Process # diff --git a/vendor/github.com/aws/smithy-go/README.md b/vendor/github.com/aws/smithy-go/README.md index 77a74ae0c2c..ddce37b99ef 100644 --- a/vendor/github.com/aws/smithy-go/README.md +++ b/vendor/github.com/aws/smithy-go/README.md @@ -4,7 +4,7 @@ [Smithy](https://smithy.io/) code generators for Go and the accompanying smithy-go runtime. -The smithy-go runtime requires a minimum version of Go 1.22. +The smithy-go runtime requires a minimum version of Go 1.23. **WARNING: All interfaces are subject to change.** @@ -80,7 +80,7 @@ example created from `smithy init`: "service": "example.weather#Weather", "module": "github.com/example/weather", "generateGoMod": true, - "goDirective": "1.22" + "goDirective": "1.23" } } } diff --git a/vendor/github.com/aws/smithy-go/go_module_metadata.go b/vendor/github.com/aws/smithy-go/go_module_metadata.go index 945db0af309..b6c4c2f51cf 100644 --- a/vendor/github.com/aws/smithy-go/go_module_metadata.go +++ b/vendor/github.com/aws/smithy-go/go_module_metadata.go @@ -3,4 +3,4 @@ package smithy // goModuleVersion is the tagged release for this module -const goModuleVersion = "1.23.0" +const goModuleVersion = "1.24.0" diff --git a/vendor/github.com/aws/smithy-go/metrics/nop.go b/vendor/github.com/aws/smithy-go/metrics/nop.go index fb374e1fb85..444126df5a0 100644 --- a/vendor/github.com/aws/smithy-go/metrics/nop.go +++ b/vendor/github.com/aws/smithy-go/metrics/nop.go @@ -9,54 +9,82 @@ var _ MeterProvider = (*NopMeterProvider)(nil) // Meter returns a meter which creates no-op instruments. func (NopMeterProvider) Meter(string, ...MeterOption) Meter { - return nopMeter{} + return NopMeter{} } -type nopMeter struct{} +// NopMeter creates no-op instruments. +type NopMeter struct{} -var _ Meter = (*nopMeter)(nil) +var _ Meter = (*NopMeter)(nil) -func (nopMeter) Int64Counter(string, ...InstrumentOption) (Int64Counter, error) { - return nopInstrument[int64]{}, nil +// Int64Counter creates a no-op instrument. +func (NopMeter) Int64Counter(string, ...InstrumentOption) (Int64Counter, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Int64UpDownCounter(string, ...InstrumentOption) (Int64UpDownCounter, error) { - return nopInstrument[int64]{}, nil + +// Int64UpDownCounter creates a no-op instrument. +func (NopMeter) Int64UpDownCounter(string, ...InstrumentOption) (Int64UpDownCounter, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Int64Gauge(string, ...InstrumentOption) (Int64Gauge, error) { - return nopInstrument[int64]{}, nil + +// Int64Gauge creates a no-op instrument. +func (NopMeter) Int64Gauge(string, ...InstrumentOption) (Int64Gauge, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Int64Histogram(string, ...InstrumentOption) (Int64Histogram, error) { - return nopInstrument[int64]{}, nil + +// Int64Histogram creates a no-op instrument. +func (NopMeter) Int64Histogram(string, ...InstrumentOption) (Int64Histogram, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Int64AsyncCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[int64]{}, nil + +// Int64AsyncCounter creates a no-op instrument. +func (NopMeter) Int64AsyncCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Int64AsyncUpDownCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[int64]{}, nil + +// Int64AsyncUpDownCounter creates a no-op instrument. +func (NopMeter) Int64AsyncUpDownCounter(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Int64AsyncGauge(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[int64]{}, nil + +// Int64AsyncGauge creates a no-op instrument. +func (NopMeter) Int64AsyncGauge(string, Int64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrumentInt64, nil } -func (nopMeter) Float64Counter(string, ...InstrumentOption) (Float64Counter, error) { - return nopInstrument[float64]{}, nil + +// Float64Counter creates a no-op instrument. +func (NopMeter) Float64Counter(string, ...InstrumentOption) (Float64Counter, error) { + return nopInstrumentFloat64, nil } -func (nopMeter) Float64UpDownCounter(string, ...InstrumentOption) (Float64UpDownCounter, error) { - return nopInstrument[float64]{}, nil + +// Float64UpDownCounter creates a no-op instrument. +func (NopMeter) Float64UpDownCounter(string, ...InstrumentOption) (Float64UpDownCounter, error) { + return nopInstrumentFloat64, nil } -func (nopMeter) Float64Gauge(string, ...InstrumentOption) (Float64Gauge, error) { - return nopInstrument[float64]{}, nil + +// Float64Gauge creates a no-op instrument. +func (NopMeter) Float64Gauge(string, ...InstrumentOption) (Float64Gauge, error) { + return nopInstrumentFloat64, nil } -func (nopMeter) Float64Histogram(string, ...InstrumentOption) (Float64Histogram, error) { - return nopInstrument[float64]{}, nil + +// Float64Histogram creates a no-op instrument. +func (NopMeter) Float64Histogram(string, ...InstrumentOption) (Float64Histogram, error) { + return nopInstrumentFloat64, nil } -func (nopMeter) Float64AsyncCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[float64]{}, nil + +// Float64AsyncCounter creates a no-op instrument. +func (NopMeter) Float64AsyncCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrumentFloat64, nil } -func (nopMeter) Float64AsyncUpDownCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[float64]{}, nil + +// Float64AsyncUpDownCounter creates a no-op instrument. +func (NopMeter) Float64AsyncUpDownCounter(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrumentFloat64, nil } -func (nopMeter) Float64AsyncGauge(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { - return nopInstrument[float64]{}, nil + +// Float64AsyncGauge creates a no-op instrument. +func (NopMeter) Float64AsyncGauge(string, Float64Callback, ...InstrumentOption) (AsyncInstrument, error) { + return nopInstrumentFloat64, nil } type nopInstrument[N any] struct{} @@ -65,3 +93,6 @@ func (nopInstrument[N]) Add(context.Context, N, ...RecordMetricOption) {} func (nopInstrument[N]) Sample(context.Context, N, ...RecordMetricOption) {} func (nopInstrument[N]) Record(context.Context, N, ...RecordMetricOption) {} func (nopInstrument[_]) Stop() {} + +var nopInstrumentInt64 = nopInstrument[int64]{} +var nopInstrumentFloat64 = nopInstrument[float64]{} diff --git a/vendor/github.com/aws/smithy-go/middleware/ordered_group.go b/vendor/github.com/aws/smithy-go/middleware/ordered_group.go index 4b195308c59..daf90136e96 100644 --- a/vendor/github.com/aws/smithy-go/middleware/ordered_group.go +++ b/vendor/github.com/aws/smithy-go/middleware/ordered_group.go @@ -23,12 +23,14 @@ type orderedIDs struct { items map[string]ider } -const baseOrderedItems = 5 +// selected based on the general upper bound of # of middlewares in each step +// in the downstream aws-sdk-go-v2 +const baseOrderedItems = 8 -func newOrderedIDs() *orderedIDs { +func newOrderedIDs(cap int) *orderedIDs { return &orderedIDs{ - order: newRelativeOrder(), - items: make(map[string]ider, baseOrderedItems), + order: newRelativeOrder(cap), + items: make(map[string]ider, cap), } } @@ -141,9 +143,9 @@ type relativeOrder struct { order []string } -func newRelativeOrder() *relativeOrder { +func newRelativeOrder(cap int) *relativeOrder { return &relativeOrder{ - order: make([]string, 0, baseOrderedItems), + order: make([]string, 0, cap), } } diff --git a/vendor/github.com/aws/smithy-go/middleware/step_build.go b/vendor/github.com/aws/smithy-go/middleware/step_build.go index 7e1d94caeef..db8c26715cb 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_build.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_build.go @@ -1,7 +1,9 @@ +// Code generated by smithy-go/middleware/generate.go DO NOT EDIT. package middleware import ( "context" + "fmt" ) // BuildInput provides the input parameters for the BuildMiddleware to consume. @@ -25,14 +27,14 @@ type BuildHandler interface { } // BuildMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next BuildHandler for further +// build step. Delegates to the next BuildHandler for further // processing. type BuildMiddleware interface { - // Unique ID for the middleware in theBuildStep. The step does not allow - // duplicate IDs. + // ID returns a unique ID for the middleware in the BuildStep. The step does not + // allow duplicate IDs. ID() string - // Invokes the middleware behavior which must delegate to the next handler + // HandleBuild invokes the middleware behavior which must delegate to the next handler // for the middleware chain to continue. The method must return a result or // error to its caller. HandleBuild(ctx context.Context, in BuildInput, next BuildHandler) ( @@ -54,7 +56,9 @@ type buildMiddlewareFunc struct { id string // Middleware function to be called. - fn func(context.Context, BuildInput, BuildHandler) (BuildOutput, Metadata, error) + fn func(context.Context, BuildInput, BuildHandler) ( + BuildOutput, Metadata, error, + ) } // ID returns the unique ID for the middleware. @@ -69,23 +73,22 @@ func (s buildMiddlewareFunc) HandleBuild(ctx context.Context, in BuildInput, nex var _ BuildMiddleware = (buildMiddlewareFunc{}) -// BuildStep provides the ordered grouping of BuildMiddleware to be invoked on -// a handler. +// BuildStep provides the ordered grouping of BuildMiddleware to be +// invoked on a handler. type BuildStep struct { - ids *orderedIDs + head *decoratedBuildHandler + tail *decoratedBuildHandler } -// NewBuildStep returns a BuildStep ready to have middleware for -// initialization added to it. +// NewBuildStep returns an BuildStep ready to have middleware for +// build added to it. func NewBuildStep() *BuildStep { - return &BuildStep{ - ids: newOrderedIDs(), - } + return &BuildStep{} } var _ Middleware = (*BuildStep)(nil) -// ID returns the unique name of the step as a middleware. +// ID returns the unique ID of the step as a middleware. func (s *BuildStep) ID() string { return "Build stack step" } @@ -97,77 +100,161 @@ func (s *BuildStep) ID() string { func (s *BuildStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( out interface{}, metadata Metadata, err error, ) { - order := s.ids.GetOrder() - - var h BuildHandler = buildWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedBuildHandler{ - Next: h, - With: order[i].(BuildMiddleware), - } - } - sIn := BuildInput{ Request: in, } - res, metadata, err := h.HandleBuild(ctx, sIn) + wh := &buildWrapHandler{next} + if s.head == nil { + res, metadata, err := wh.HandleBuild(ctx, sIn) + return res.Result, metadata, err + } + + s.tail.Next = wh + res, metadata, err := s.head.HandleBuild(ctx, sIn) return res.Result, metadata, err } // Get retrieves the middleware identified by id. If the middleware is not present, returns false. func (s *BuildStep) Get(id string) (BuildMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { + found, _ := s.get(id) + if found == nil { return nil, false } - return get.(BuildMiddleware), ok + + return found.With, true } // Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. +// +// Add never returns an error. It used to for duplicate phases but this +// behavior has since been removed as part of a performance optimization. The +// return value from Add can be ignored. func (s *BuildStep) Add(m BuildMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) + if s.head == nil { + s.head = &decoratedBuildHandler{nil, m} + s.tail = s.head + return nil + } + + if pos == Before { + s.head = &decoratedBuildHandler{s.head, m} + } else { + tail := &decoratedBuildHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } + + return nil } -// Insert injects the middleware relative to an existing middleware id. -// Returns an error if the original middleware does not exist, or the middleware +// Insert injects the middleware relative to an existing middleware ID. +// Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *BuildStep) Insert(m BuildMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) + found, prev := s.get(relativeTo) + if found == nil { + return fmt.Errorf("not found: %s", m.ID()) + } + + if pos == Before { + if prev == nil { // at the front + s.head = &decoratedBuildHandler{s.head, m} + } else { // somewhere in the middle + prev.Next = &decoratedBuildHandler{found, m} + } + } else { + if found.Next == nil { // at the end + tail := &decoratedBuildHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } else { // somewhere in the middle + found.Next = &decoratedBuildHandler{found.Next, m} + } + } + + return nil } // Swap removes the middleware by id, replacing it with the new middleware. -// Returns the middleware removed, or an error if the middleware to be removed +// Returns the middleware removed, or error if the middleware to be removed // doesn't exist. func (s *BuildStep) Swap(id string, m BuildMiddleware) (BuildMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err + found, _ := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", m.ID()) } - return removed.(BuildMiddleware), nil + swapped := found.With + found.With = m + return swapped, nil } // Remove removes the middleware by id. Returns error if the middleware // doesn't exist. func (s *BuildStep) Remove(id string) (BuildMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err + found, prev := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", id) } - return removed.(BuildMiddleware), nil + if s.head == s.tail { // it's the only one + s.head = nil + s.tail = nil + } else if found == s.head { // at the front + s.head = s.head.Next.(*decoratedBuildHandler) + } else if found == s.tail { // at the end + prev.Next = nil + s.tail = prev + } else { + prev.Next = found.Next // somewhere in the middle + } + + return found.With, nil } // List returns a list of the middleware in the step. func (s *BuildStep) List() []string { - return s.ids.List() + var ids []string + for h := s.head; h != nil; { + ids = append(ids, h.With.ID()) + if h.Next == nil { + break + } + + // once executed, tail.Next of the list will be set to an + // *buildWrapHandler, make sure to check for that + if hnext, ok := h.Next.(*decoratedBuildHandler); ok { + h = hnext + } else { + break + } + } + return ids } // Clear removes all middleware in the step. func (s *BuildStep) Clear() { - s.ids.Clear() + s.head = nil + s.tail = nil +} + +func (s *BuildStep) get(id string) (found, prev *decoratedBuildHandler) { + for h := s.head; h != nil; { + if h.With.ID() == id { + found = h + return + } + prev = h + if h.Next == nil { + return + } + + // once executed, tail.Next of the list will be set to an + // *buildWrapHandler + h, _ = h.Next.(*decoratedBuildHandler) + } + return } type buildWrapHandler struct { @@ -176,7 +263,7 @@ type buildWrapHandler struct { var _ BuildHandler = (*buildWrapHandler)(nil) -// Implements BuildHandler, converts types and delegates to underlying +// HandleBuild implements BuildHandler, converts types and delegates to underlying // generic handler. func (w buildWrapHandler) HandleBuild(ctx context.Context, in BuildInput) ( out BuildOutput, metadata Metadata, err error, @@ -200,12 +287,12 @@ func (h decoratedBuildHandler) HandleBuild(ctx context.Context, in BuildInput) ( return h.With.HandleBuild(ctx, in, h.Next) } -// BuildHandlerFunc provides a wrapper around a function to be used as a build middleware handler. +// BuildHandlerFunc provides a wrapper around a function to be used as buildMiddleware. type BuildHandlerFunc func(context.Context, BuildInput) (BuildOutput, Metadata, error) -// HandleBuild invokes the wrapped function with the provided arguments. -func (b BuildHandlerFunc) HandleBuild(ctx context.Context, in BuildInput) (BuildOutput, Metadata, error) { - return b(ctx, in) +// HandleBuild calls the wrapped function with the provided arguments. +func (f BuildHandlerFunc) HandleBuild(ctx context.Context, in BuildInput) (BuildOutput, Metadata, error) { + return f(ctx, in) } var _ BuildHandler = BuildHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go b/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go index 44860721571..1f337f2dbc9 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_deserialize.go @@ -1,7 +1,9 @@ +// Code generated by smithy-go/middleware/generate.go DO NOT EDIT. package middleware import ( "context" + "fmt" ) // DeserializeInput provides the input parameters for the DeserializeInput to @@ -11,10 +13,7 @@ type DeserializeInput struct { Request interface{} } -// DeserializeOutput provides the result returned by the next -// DeserializeHandler. The DeserializeMiddleware should deserialize the -// RawResponse into a Result that can be consumed by middleware higher up in -// the stack. +// DeserializeOutput provides the result returned by the next DeserializeHandler. type DeserializeOutput struct { RawResponse interface{} Result interface{} @@ -29,7 +28,7 @@ type DeserializeHandler interface { } // DeserializeMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next DeserializeHandler for further +// deserialize step. Delegates to the next DeserializeHandler for further // processing. type DeserializeMiddleware interface { // ID returns a unique ID for the middleware in the DeserializeStep. The step does not @@ -44,8 +43,8 @@ type DeserializeMiddleware interface { ) } -// DeserializeMiddlewareFunc returns a DeserializeMiddleware with the unique ID -// provided, and the func to be invoked. +// DeserializeMiddlewareFunc returns a DeserializeMiddleware with the unique ID provided, +// and the func to be invoked. func DeserializeMiddlewareFunc(id string, fn func(context.Context, DeserializeInput, DeserializeHandler) (DeserializeOutput, Metadata, error)) DeserializeMiddleware { return deserializeMiddlewareFunc{ id: id, @@ -78,15 +77,14 @@ var _ DeserializeMiddleware = (deserializeMiddlewareFunc{}) // DeserializeStep provides the ordered grouping of DeserializeMiddleware to be // invoked on a handler. type DeserializeStep struct { - ids *orderedIDs + head *decoratedDeserializeHandler + tail *decoratedDeserializeHandler } -// NewDeserializeStep returns a DeserializeStep ready to have middleware for -// initialization added to it. +// NewDeserializeStep returns an DeserializeStep ready to have middleware for +// deserialize added to it. func NewDeserializeStep() *DeserializeStep { - return &DeserializeStep{ - ids: newOrderedIDs(), - } + return &DeserializeStep{} } var _ Middleware = (*DeserializeStep)(nil) @@ -103,77 +101,161 @@ func (s *DeserializeStep) ID() string { func (s *DeserializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( out interface{}, metadata Metadata, err error, ) { - order := s.ids.GetOrder() - - var h DeserializeHandler = deserializeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedDeserializeHandler{ - Next: h, - With: order[i].(DeserializeMiddleware), - } - } - sIn := DeserializeInput{ Request: in, } - res, metadata, err := h.HandleDeserialize(ctx, sIn) + wh := &deserializeWrapHandler{next} + if s.head == nil { + res, metadata, err := wh.HandleDeserialize(ctx, sIn) + return res.Result, metadata, err + } + + s.tail.Next = wh + res, metadata, err := s.head.HandleDeserialize(ctx, sIn) return res.Result, metadata, err } // Get retrieves the middleware identified by id. If the middleware is not present, returns false. func (s *DeserializeStep) Get(id string) (DeserializeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { + found, _ := s.get(id) + if found == nil { return nil, false } - return get.(DeserializeMiddleware), ok + + return found.With, true } // Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. +// +// Add never returns an error. It used to for duplicate phases but this +// behavior has since been removed as part of a performance optimization. The +// return value from Add can be ignored. func (s *DeserializeStep) Add(m DeserializeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) + if s.head == nil { + s.head = &decoratedDeserializeHandler{nil, m} + s.tail = s.head + return nil + } + + if pos == Before { + s.head = &decoratedDeserializeHandler{s.head, m} + } else { + tail := &decoratedDeserializeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } + + return nil } // Insert injects the middleware relative to an existing middleware ID. // Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *DeserializeStep) Insert(m DeserializeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) + found, prev := s.get(relativeTo) + if found == nil { + return fmt.Errorf("not found: %s", m.ID()) + } + + if pos == Before { + if prev == nil { // at the front + s.head = &decoratedDeserializeHandler{s.head, m} + } else { // somewhere in the middle + prev.Next = &decoratedDeserializeHandler{found, m} + } + } else { + if found.Next == nil { // at the end + tail := &decoratedDeserializeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } else { // somewhere in the middle + found.Next = &decoratedDeserializeHandler{found.Next, m} + } + } + + return nil } // Swap removes the middleware by id, replacing it with the new middleware. // Returns the middleware removed, or error if the middleware to be removed // doesn't exist. func (s *DeserializeStep) Swap(id string, m DeserializeMiddleware) (DeserializeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err + found, _ := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", m.ID()) } - return removed.(DeserializeMiddleware), nil + swapped := found.With + found.With = m + return swapped, nil } // Remove removes the middleware by id. Returns error if the middleware // doesn't exist. func (s *DeserializeStep) Remove(id string) (DeserializeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err + found, prev := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", id) + } + + if s.head == s.tail { // it's the only one + s.head = nil + s.tail = nil + } else if found == s.head { // at the front + s.head = s.head.Next.(*decoratedDeserializeHandler) + } else if found == s.tail { // at the end + prev.Next = nil + s.tail = prev + } else { + prev.Next = found.Next // somewhere in the middle } - return removed.(DeserializeMiddleware), nil + return found.With, nil } // List returns a list of the middleware in the step. func (s *DeserializeStep) List() []string { - return s.ids.List() + var ids []string + for h := s.head; h != nil; { + ids = append(ids, h.With.ID()) + if h.Next == nil { + break + } + + // once executed, tail.Next of the list will be set to an + // *deserializeWrapHandler, make sure to check for that + if hnext, ok := h.Next.(*decoratedDeserializeHandler); ok { + h = hnext + } else { + break + } + } + return ids } // Clear removes all middleware in the step. func (s *DeserializeStep) Clear() { - s.ids.Clear() + s.head = nil + s.tail = nil +} + +func (s *DeserializeStep) get(id string) (found, prev *decoratedDeserializeHandler) { + for h := s.head; h != nil; { + if h.With.ID() == id { + found = h + return + } + prev = h + if h.Next == nil { + return + } + + // once executed, tail.Next of the list will be set to an + // *deserializeWrapHandler + h, _ = h.Next.(*decoratedDeserializeHandler) + } + return } type deserializeWrapHandler struct { @@ -187,9 +269,10 @@ var _ DeserializeHandler = (*deserializeWrapHandler)(nil) func (w deserializeWrapHandler) HandleDeserialize(ctx context.Context, in DeserializeInput) ( out DeserializeOutput, metadata Metadata, err error, ) { - resp, metadata, err := w.Next.Handle(ctx, in.Request) + res, metadata, err := w.Next.Handle(ctx, in.Request) return DeserializeOutput{ - RawResponse: resp, + RawResponse: res, + Result: nil, }, metadata, err } @@ -206,12 +289,12 @@ func (h decoratedDeserializeHandler) HandleDeserialize(ctx context.Context, in D return h.With.HandleDeserialize(ctx, in, h.Next) } -// DeserializeHandlerFunc provides a wrapper around a function to be used as a deserialize middleware handler. +// DeserializeHandlerFunc provides a wrapper around a function to be used as deserializeMiddleware. type DeserializeHandlerFunc func(context.Context, DeserializeInput) (DeserializeOutput, Metadata, error) -// HandleDeserialize invokes the wrapped function with the given arguments. -func (d DeserializeHandlerFunc) HandleDeserialize(ctx context.Context, in DeserializeInput) (DeserializeOutput, Metadata, error) { - return d(ctx, in) +// HandleDeserialize calls the wrapped function with the provided arguments. +func (f DeserializeHandlerFunc) HandleDeserialize(ctx context.Context, in DeserializeInput) (DeserializeOutput, Metadata, error) { + return f(ctx, in) } var _ DeserializeHandler = DeserializeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_finalize.go b/vendor/github.com/aws/smithy-go/middleware/step_finalize.go index 065e3885de9..1a0ad9fb88b 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_finalize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_finalize.go @@ -1,6 +1,10 @@ +// Code generated by smithy-go/middleware/generate.go DO NOT EDIT. package middleware -import "context" +import ( + "context" + "fmt" +) // FinalizeInput provides the input parameters for the FinalizeMiddleware to // consume. FinalizeMiddleware may modify the Request value before forwarding @@ -23,7 +27,7 @@ type FinalizeHandler interface { } // FinalizeMiddleware provides the interface for middleware specific to the -// serialize step. Delegates to the next FinalizeHandler for further +// finalize step. Delegates to the next FinalizeHandler for further // processing. type FinalizeMiddleware interface { // ID returns a unique ID for the middleware in the FinalizeStep. The step does not @@ -38,8 +42,8 @@ type FinalizeMiddleware interface { ) } -// FinalizeMiddlewareFunc returns a FinalizeMiddleware with the unique ID -// provided, and the func to be invoked. +// FinalizeMiddlewareFunc returns a FinalizeMiddleware with the unique ID provided, +// and the func to be invoked. func FinalizeMiddlewareFunc(id string, fn func(context.Context, FinalizeInput, FinalizeHandler) (FinalizeOutput, Metadata, error)) FinalizeMiddleware { return finalizeMiddlewareFunc{ id: id, @@ -72,20 +76,19 @@ var _ FinalizeMiddleware = (finalizeMiddlewareFunc{}) // FinalizeStep provides the ordered grouping of FinalizeMiddleware to be // invoked on a handler. type FinalizeStep struct { - ids *orderedIDs + head *decoratedFinalizeHandler + tail *decoratedFinalizeHandler } -// NewFinalizeStep returns a FinalizeStep ready to have middleware for -// initialization added to it. +// NewFinalizeStep returns an FinalizeStep ready to have middleware for +// finalize added to it. func NewFinalizeStep() *FinalizeStep { - return &FinalizeStep{ - ids: newOrderedIDs(), - } + return &FinalizeStep{} } var _ Middleware = (*FinalizeStep)(nil) -// ID returns the unique id of the step as a middleware. +// ID returns the unique ID of the step as a middleware. func (s *FinalizeStep) ID() string { return "Finalize stack step" } @@ -97,77 +100,161 @@ func (s *FinalizeStep) ID() string { func (s *FinalizeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( out interface{}, metadata Metadata, err error, ) { - order := s.ids.GetOrder() - - var h FinalizeHandler = finalizeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedFinalizeHandler{ - Next: h, - With: order[i].(FinalizeMiddleware), - } - } - sIn := FinalizeInput{ Request: in, } - res, metadata, err := h.HandleFinalize(ctx, sIn) + wh := &finalizeWrapHandler{next} + if s.head == nil { + res, metadata, err := wh.HandleFinalize(ctx, sIn) + return res.Result, metadata, err + } + + s.tail.Next = wh + res, metadata, err := s.head.HandleFinalize(ctx, sIn) return res.Result, metadata, err } // Get retrieves the middleware identified by id. If the middleware is not present, returns false. func (s *FinalizeStep) Get(id string) (FinalizeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { + found, _ := s.get(id) + if found == nil { return nil, false } - return get.(FinalizeMiddleware), ok + + return found.With, true } // Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. +// +// Add never returns an error. It used to for duplicate phases but this +// behavior has since been removed as part of a performance optimization. The +// return value from Add can be ignored. func (s *FinalizeStep) Add(m FinalizeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) + if s.head == nil { + s.head = &decoratedFinalizeHandler{nil, m} + s.tail = s.head + return nil + } + + if pos == Before { + s.head = &decoratedFinalizeHandler{s.head, m} + } else { + tail := &decoratedFinalizeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } + + return nil } // Insert injects the middleware relative to an existing middleware ID. // Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *FinalizeStep) Insert(m FinalizeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) + found, prev := s.get(relativeTo) + if found == nil { + return fmt.Errorf("not found: %s", m.ID()) + } + + if pos == Before { + if prev == nil { // at the front + s.head = &decoratedFinalizeHandler{s.head, m} + } else { // somewhere in the middle + prev.Next = &decoratedFinalizeHandler{found, m} + } + } else { + if found.Next == nil { // at the end + tail := &decoratedFinalizeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } else { // somewhere in the middle + found.Next = &decoratedFinalizeHandler{found.Next, m} + } + } + + return nil } // Swap removes the middleware by id, replacing it with the new middleware. // Returns the middleware removed, or error if the middleware to be removed // doesn't exist. func (s *FinalizeStep) Swap(id string, m FinalizeMiddleware) (FinalizeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err + found, _ := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", m.ID()) } - return removed.(FinalizeMiddleware), nil + swapped := found.With + found.With = m + return swapped, nil } // Remove removes the middleware by id. Returns error if the middleware // doesn't exist. func (s *FinalizeStep) Remove(id string) (FinalizeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err + found, prev := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", id) + } + + if s.head == s.tail { // it's the only one + s.head = nil + s.tail = nil + } else if found == s.head { // at the front + s.head = s.head.Next.(*decoratedFinalizeHandler) + } else if found == s.tail { // at the end + prev.Next = nil + s.tail = prev + } else { + prev.Next = found.Next // somewhere in the middle } - return removed.(FinalizeMiddleware), nil + return found.With, nil } // List returns a list of the middleware in the step. func (s *FinalizeStep) List() []string { - return s.ids.List() + var ids []string + for h := s.head; h != nil; { + ids = append(ids, h.With.ID()) + if h.Next == nil { + break + } + + // once executed, tail.Next of the list will be set to an + // *finalizeWrapHandler, make sure to check for that + if hnext, ok := h.Next.(*decoratedFinalizeHandler); ok { + h = hnext + } else { + break + } + } + return ids } // Clear removes all middleware in the step. func (s *FinalizeStep) Clear() { - s.ids.Clear() + s.head = nil + s.tail = nil +} + +func (s *FinalizeStep) get(id string) (found, prev *decoratedFinalizeHandler) { + for h := s.head; h != nil; { + if h.With.ID() == id { + found = h + return + } + prev = h + if h.Next == nil { + return + } + + // once executed, tail.Next of the list will be set to an + // *finalizeWrapHandler + h, _ = h.Next.(*decoratedFinalizeHandler) + } + return } type finalizeWrapHandler struct { @@ -200,10 +287,10 @@ func (h decoratedFinalizeHandler) HandleFinalize(ctx context.Context, in Finaliz return h.With.HandleFinalize(ctx, in, h.Next) } -// FinalizeHandlerFunc provides a wrapper around a function to be used as a finalize middleware handler. +// FinalizeHandlerFunc provides a wrapper around a function to be used as finalizeMiddleware. type FinalizeHandlerFunc func(context.Context, FinalizeInput) (FinalizeOutput, Metadata, error) -// HandleFinalize invokes the wrapped function with the given arguments. +// HandleFinalize calls the wrapped function with the provided arguments. func (f FinalizeHandlerFunc) HandleFinalize(ctx context.Context, in FinalizeInput) (FinalizeOutput, Metadata, error) { return f(ctx, in) } diff --git a/vendor/github.com/aws/smithy-go/middleware/step_initialize.go b/vendor/github.com/aws/smithy-go/middleware/step_initialize.go index fe359144d24..446f3b7bb9c 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_initialize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_initialize.go @@ -1,10 +1,15 @@ +// Code generated by smithy-go/middleware/generate.go DO NOT EDIT. package middleware -import "context" +import ( + "context" + "fmt" +) // InitializeInput wraps the input parameters for the InitializeMiddlewares to // consume. InitializeMiddleware may modify the parameter value before // forwarding it along to the next InitializeHandler. + type InitializeInput struct { Parameters interface{} } @@ -72,15 +77,14 @@ var _ InitializeMiddleware = (initializeMiddlewareFunc{}) // InitializeStep provides the ordered grouping of InitializeMiddleware to be // invoked on a handler. type InitializeStep struct { - ids *orderedIDs + head *decoratedInitializeHandler + tail *decoratedInitializeHandler } // NewInitializeStep returns an InitializeStep ready to have middleware for -// initialization added to it. +// initialize added to it. func NewInitializeStep() *InitializeStep { - return &InitializeStep{ - ids: newOrderedIDs(), - } + return &InitializeStep{} } var _ Middleware = (*InitializeStep)(nil) @@ -97,77 +101,161 @@ func (s *InitializeStep) ID() string { func (s *InitializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( out interface{}, metadata Metadata, err error, ) { - order := s.ids.GetOrder() - - var h InitializeHandler = initializeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedInitializeHandler{ - Next: h, - With: order[i].(InitializeMiddleware), - } - } - sIn := InitializeInput{ Parameters: in, } - res, metadata, err := h.HandleInitialize(ctx, sIn) + wh := &initializeWrapHandler{next} + if s.head == nil { + res, metadata, err := wh.HandleInitialize(ctx, sIn) + return res.Result, metadata, err + } + + s.tail.Next = wh + res, metadata, err := s.head.HandleInitialize(ctx, sIn) return res.Result, metadata, err } // Get retrieves the middleware identified by id. If the middleware is not present, returns false. func (s *InitializeStep) Get(id string) (InitializeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { + found, _ := s.get(id) + if found == nil { return nil, false } - return get.(InitializeMiddleware), ok + + return found.With, true } // Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. +// +// Add never returns an error. It used to for duplicate phases but this +// behavior has since been removed as part of a performance optimization. The +// return value from Add can be ignored. func (s *InitializeStep) Add(m InitializeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) + if s.head == nil { + s.head = &decoratedInitializeHandler{nil, m} + s.tail = s.head + return nil + } + + if pos == Before { + s.head = &decoratedInitializeHandler{s.head, m} + } else { + tail := &decoratedInitializeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } + + return nil } // Insert injects the middleware relative to an existing middleware ID. // Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *InitializeStep) Insert(m InitializeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) + found, prev := s.get(relativeTo) + if found == nil { + return fmt.Errorf("not found: %s", m.ID()) + } + + if pos == Before { + if prev == nil { // at the front + s.head = &decoratedInitializeHandler{s.head, m} + } else { // somewhere in the middle + prev.Next = &decoratedInitializeHandler{found, m} + } + } else { + if found.Next == nil { // at the end + tail := &decoratedInitializeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } else { // somewhere in the middle + found.Next = &decoratedInitializeHandler{found.Next, m} + } + } + + return nil } // Swap removes the middleware by id, replacing it with the new middleware. // Returns the middleware removed, or error if the middleware to be removed // doesn't exist. func (s *InitializeStep) Swap(id string, m InitializeMiddleware) (InitializeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err + found, _ := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", m.ID()) } - return removed.(InitializeMiddleware), nil + swapped := found.With + found.With = m + return swapped, nil } // Remove removes the middleware by id. Returns error if the middleware // doesn't exist. func (s *InitializeStep) Remove(id string) (InitializeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err + found, prev := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", id) } - return removed.(InitializeMiddleware), nil + if s.head == s.tail { // it's the only one + s.head = nil + s.tail = nil + } else if found == s.head { // at the front + s.head = s.head.Next.(*decoratedInitializeHandler) + } else if found == s.tail { // at the end + prev.Next = nil + s.tail = prev + } else { + prev.Next = found.Next // somewhere in the middle + } + + return found.With, nil } // List returns a list of the middleware in the step. func (s *InitializeStep) List() []string { - return s.ids.List() + var ids []string + for h := s.head; h != nil; { + ids = append(ids, h.With.ID()) + if h.Next == nil { + break + } + + // once executed, tail.Next of the list will be set to an + // *initializeWrapHandler, make sure to check for that + if hnext, ok := h.Next.(*decoratedInitializeHandler); ok { + h = hnext + } else { + break + } + } + return ids } // Clear removes all middleware in the step. func (s *InitializeStep) Clear() { - s.ids.Clear() + s.head = nil + s.tail = nil +} + +func (s *InitializeStep) get(id string) (found, prev *decoratedInitializeHandler) { + for h := s.head; h != nil; { + if h.With.ID() == id { + found = h + return + } + prev = h + if h.Next == nil { + return + } + + // once executed, tail.Next of the list will be set to an + // *initializeWrapHandler + h, _ = h.Next.(*decoratedInitializeHandler) + } + return } type initializeWrapHandler struct { @@ -200,12 +288,12 @@ func (h decoratedInitializeHandler) HandleInitialize(ctx context.Context, in Ini return h.With.HandleInitialize(ctx, in, h.Next) } -// InitializeHandlerFunc provides a wrapper around a function to be used as an initialize middleware handler. +// InitializeHandlerFunc provides a wrapper around a function to be used as initializeMiddleware. type InitializeHandlerFunc func(context.Context, InitializeInput) (InitializeOutput, Metadata, error) // HandleInitialize calls the wrapped function with the provided arguments. -func (i InitializeHandlerFunc) HandleInitialize(ctx context.Context, in InitializeInput) (InitializeOutput, Metadata, error) { - return i(ctx, in) +func (f InitializeHandlerFunc) HandleInitialize(ctx context.Context, in InitializeInput) (InitializeOutput, Metadata, error) { + return f(ctx, in) } var _ InitializeHandler = InitializeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/middleware/step_serialize.go b/vendor/github.com/aws/smithy-go/middleware/step_serialize.go index 114bafcedea..942ebb4f3e7 100644 --- a/vendor/github.com/aws/smithy-go/middleware/step_serialize.go +++ b/vendor/github.com/aws/smithy-go/middleware/step_serialize.go @@ -1,6 +1,10 @@ +// Code generated by smithy-go/middleware/generate.go DO NOT EDIT. package middleware -import "context" +import ( + "context" + "fmt" +) // SerializeInput provides the input parameters for the SerializeMiddleware to // consume. SerializeMiddleware may modify the Request value before forwarding @@ -41,8 +45,8 @@ type SerializeMiddleware interface { ) } -// SerializeMiddlewareFunc returns a SerializeMiddleware with the unique ID -// provided, and the func to be invoked. +// SerializeMiddlewareFunc returns a SerializeMiddleware with the unique ID provided, +// and the func to be invoked. func SerializeMiddlewareFunc(id string, fn func(context.Context, SerializeInput, SerializeHandler) (SerializeOutput, Metadata, error)) SerializeMiddleware { return serializeMiddlewareFunc{ id: id, @@ -75,17 +79,15 @@ var _ SerializeMiddleware = (serializeMiddlewareFunc{}) // SerializeStep provides the ordered grouping of SerializeMiddleware to be // invoked on a handler. type SerializeStep struct { + head *decoratedSerializeHandler + tail *decoratedSerializeHandler newRequest func() interface{} - ids *orderedIDs } -// NewSerializeStep returns a SerializeStep ready to have middleware for -// initialization added to it. The newRequest func parameter is used to -// initialize the transport specific request for the stack SerializeStep to -// serialize the input parameters into. +// NewSerializeStep returns an SerializeStep ready to have middleware for +// serialize added to it. func NewSerializeStep(newRequest func() interface{}) *SerializeStep { return &SerializeStep{ - ids: newOrderedIDs(), newRequest: newRequest, } } @@ -104,78 +106,162 @@ func (s *SerializeStep) ID() string { func (s *SerializeStep) HandleMiddleware(ctx context.Context, in interface{}, next Handler) ( out interface{}, metadata Metadata, err error, ) { - order := s.ids.GetOrder() - - var h SerializeHandler = serializeWrapHandler{Next: next} - for i := len(order) - 1; i >= 0; i-- { - h = decoratedSerializeHandler{ - Next: h, - With: order[i].(SerializeMiddleware), - } - } - sIn := SerializeInput{ Parameters: in, Request: s.newRequest(), } - res, metadata, err := h.HandleSerialize(ctx, sIn) + wh := &serializeWrapHandler{next} + if s.head == nil { + res, metadata, err := wh.HandleSerialize(ctx, sIn) + return res.Result, metadata, err + } + + s.tail.Next = wh + res, metadata, err := s.head.HandleSerialize(ctx, sIn) return res.Result, metadata, err } // Get retrieves the middleware identified by id. If the middleware is not present, returns false. func (s *SerializeStep) Get(id string) (SerializeMiddleware, bool) { - get, ok := s.ids.Get(id) - if !ok { + found, _ := s.get(id) + if found == nil { return nil, false } - return get.(SerializeMiddleware), ok + + return found.With, true } // Add injects the middleware to the relative position of the middleware group. -// Returns an error if the middleware already exists. +// +// Add never returns an error. It used to for duplicate phases but this +// behavior has since been removed as part of a performance optimization. The +// return value from Add can be ignored. func (s *SerializeStep) Add(m SerializeMiddleware, pos RelativePosition) error { - return s.ids.Add(m, pos) + if s.head == nil { + s.head = &decoratedSerializeHandler{nil, m} + s.tail = s.head + return nil + } + + if pos == Before { + s.head = &decoratedSerializeHandler{s.head, m} + } else { + tail := &decoratedSerializeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } + + return nil } // Insert injects the middleware relative to an existing middleware ID. // Returns error if the original middleware does not exist, or the middleware // being added already exists. func (s *SerializeStep) Insert(m SerializeMiddleware, relativeTo string, pos RelativePosition) error { - return s.ids.Insert(m, relativeTo, pos) + found, prev := s.get(relativeTo) + if found == nil { + return fmt.Errorf("not found: %s", m.ID()) + } + + if pos == Before { + if prev == nil { // at the front + s.head = &decoratedSerializeHandler{s.head, m} + } else { // somewhere in the middle + prev.Next = &decoratedSerializeHandler{found, m} + } + } else { + if found.Next == nil { // at the end + tail := &decoratedSerializeHandler{nil, m} + s.tail.Next = tail + s.tail = tail + } else { // somewhere in the middle + found.Next = &decoratedSerializeHandler{found.Next, m} + } + } + + return nil } // Swap removes the middleware by id, replacing it with the new middleware. // Returns the middleware removed, or error if the middleware to be removed // doesn't exist. func (s *SerializeStep) Swap(id string, m SerializeMiddleware) (SerializeMiddleware, error) { - removed, err := s.ids.Swap(id, m) - if err != nil { - return nil, err + found, _ := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", m.ID()) } - return removed.(SerializeMiddleware), nil + swapped := found.With + found.With = m + return swapped, nil } // Remove removes the middleware by id. Returns error if the middleware // doesn't exist. func (s *SerializeStep) Remove(id string) (SerializeMiddleware, error) { - removed, err := s.ids.Remove(id) - if err != nil { - return nil, err + found, prev := s.get(id) + if found == nil { + return nil, fmt.Errorf("not found: %s", id) + } + + if s.head == s.tail { // it's the only one + s.head = nil + s.tail = nil + } else if found == s.head { // at the front + s.head = s.head.Next.(*decoratedSerializeHandler) + } else if found == s.tail { // at the end + prev.Next = nil + s.tail = prev + } else { + prev.Next = found.Next // somewhere in the middle } - return removed.(SerializeMiddleware), nil + return found.With, nil } // List returns a list of the middleware in the step. func (s *SerializeStep) List() []string { - return s.ids.List() + var ids []string + for h := s.head; h != nil; { + ids = append(ids, h.With.ID()) + if h.Next == nil { + break + } + + // once executed, tail.Next of the list will be set to an + // *serializeWrapHandler, make sure to check for that + if hnext, ok := h.Next.(*decoratedSerializeHandler); ok { + h = hnext + } else { + break + } + } + return ids } // Clear removes all middleware in the step. func (s *SerializeStep) Clear() { - s.ids.Clear() + s.head = nil + s.tail = nil +} + +func (s *SerializeStep) get(id string) (found, prev *decoratedSerializeHandler) { + for h := s.head; h != nil; { + if h.With.ID() == id { + found = h + return + } + prev = h + if h.Next == nil { + return + } + + // once executed, tail.Next of the list will be set to an + // *serializeWrapHandler + h, _ = h.Next.(*decoratedSerializeHandler) + } + return } type serializeWrapHandler struct { @@ -184,7 +270,7 @@ type serializeWrapHandler struct { var _ SerializeHandler = (*serializeWrapHandler)(nil) -// Implements SerializeHandler, converts types and delegates to underlying +// HandleSerialize implements SerializeHandler, converts types and delegates to underlying // generic handler. func (w serializeWrapHandler) HandleSerialize(ctx context.Context, in SerializeInput) ( out SerializeOutput, metadata Metadata, err error, @@ -208,12 +294,12 @@ func (h decoratedSerializeHandler) HandleSerialize(ctx context.Context, in Seria return h.With.HandleSerialize(ctx, in, h.Next) } -// SerializeHandlerFunc provides a wrapper around a function to be used as a serialize middleware handler. +// SerializeHandlerFunc provides a wrapper around a function to be used as serializeMiddleware. type SerializeHandlerFunc func(context.Context, SerializeInput) (SerializeOutput, Metadata, error) // HandleSerialize calls the wrapped function with the provided arguments. -func (s SerializeHandlerFunc) HandleSerialize(ctx context.Context, in SerializeInput) (SerializeOutput, Metadata, error) { - return s(ctx, in) +func (f SerializeHandlerFunc) HandleSerialize(ctx context.Context, in SerializeInput) (SerializeOutput, Metadata, error) { + return f(ctx, in) } var _ SerializeHandler = SerializeHandlerFunc(nil) diff --git a/vendor/github.com/aws/smithy-go/transport/http/metrics.go b/vendor/github.com/aws/smithy-go/transport/http/metrics.go index d1beaa595d9..b4cd4a47e36 100644 --- a/vendor/github.com/aws/smithy-go/transport/http/metrics.go +++ b/vendor/github.com/aws/smithy-go/transport/http/metrics.go @@ -17,6 +17,12 @@ var now = time.Now func withMetrics(parent context.Context, client ClientDo, meter metrics.Meter) ( context.Context, ClientDo, error, ) { + // WithClientTrace is an expensive operation - avoid calling it if we're + // not actually using a metrics sink. + if _, ok := meter.(metrics.NopMeter); ok { + return parent, client, nil + } + hm, err := newHTTPMetrics(meter) if err != nil { return nil, nil, err diff --git a/vendor/github.com/cenkalti/backoff/v5/exponential.go b/vendor/github.com/cenkalti/backoff/v5/exponential.go index c1f3e442d36..79d425e8746 100644 --- a/vendor/github.com/cenkalti/backoff/v5/exponential.go +++ b/vendor/github.com/cenkalti/backoff/v5/exponential.go @@ -1,7 +1,7 @@ package backoff import ( - "math/rand" + "math/rand/v2" "time" ) @@ -28,13 +28,7 @@ multiplied by the exponential, that is, between 2 and 6 seconds. Note: MaxInterval caps the RetryInterval and not the randomized interval. -If the time elapsed since an ExponentialBackOff instance is created goes past the -MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop. - -The elapsed time can be reset by calling Reset(). - -Example: Given the following default arguments, for 10 tries the sequence will be, -and assuming we go over the MaxElapsedTime on the 10th try: +Example: Given the following default arguments, for 9 tries the sequence will be: Request # RetryInterval (seconds) Randomized Interval (seconds) @@ -47,7 +41,6 @@ and assuming we go over the MaxElapsedTime on the 10th try: 7 5.692 [2.846, 8.538] 8 8.538 [4.269, 12.807] 9 12.807 [6.403, 19.210] - 10 19.210 backoff.Stop Note: Implementation is not thread-safe. */ diff --git a/vendor/github.com/cenkalti/backoff/v5/retry.go b/vendor/github.com/cenkalti/backoff/v5/retry.go index e43f47fb8a5..32a7f988347 100644 --- a/vendor/github.com/cenkalti/backoff/v5/retry.go +++ b/vendor/github.com/cenkalti/backoff/v5/retry.go @@ -47,7 +47,7 @@ func WithNotify(n Notify) RetryOption { } } -// WithMaxTries limits the number of retry attempts. +// WithMaxTries limits the number of all attempts. func WithMaxTries(n uint) RetryOption { return func(args *retryOptions) { args.MaxTries = n @@ -97,7 +97,7 @@ func Retry[T any](ctx context.Context, operation Operation[T], opts ...RetryOpti // Handle permanent errors without retrying. var permanent *PermanentError if errors.As(err, &permanent) { - return res, err + return res, permanent.Unwrap() } // Stop retrying if context is cancelled. diff --git a/vendor/github.com/coreos/go-semver/semver/semver.go b/vendor/github.com/coreos/go-semver/semver/semver.go index 76cf4852c76..eb9fb7ff2d8 100644 --- a/vendor/github.com/coreos/go-semver/semver/semver.go +++ b/vendor/github.com/coreos/go-semver/semver/semver.go @@ -85,7 +85,7 @@ func (v *Version) Set(version string) error { return fmt.Errorf("failed to validate metadata: %v", err) } - parsed := make([]int64, 3, 3) + parsed := make([]int64, 3) for i, v := range dotParts[:3] { val, err := strconv.ParseInt(v, 10, 64) diff --git a/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md b/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md index 8f349c4b8f5..9a7c0ca730e 100644 --- a/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md +++ b/vendor/github.com/go-logfmt/logfmt/CHANGELOG.md @@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.1] - 2025-10-05 + +### Fixed + +- Encode DEL (0x7f) control character by [@spaceone] +- Modernize code through Go 1.21 by [@ChrisHines] + +[0.6.1]: https://github.com/go-logfmt/logfmt/compare/v0.6.0...v0.6.1 + ## [0.6.0] - 2023-01-30 [0.6.0]: https://github.com/go-logfmt/logfmt/compare/v0.5.1...v0.6.0 @@ -80,3 +89,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [@judwhite]: https://github.com/judwhite [@nussjustin]: https://github.com/nussjustin [@alexanderjophus]: https://github.com/alexanderjophus +[@spaceone]: https://github.com/spaceone diff --git a/vendor/github.com/go-logfmt/logfmt/encode.go b/vendor/github.com/go-logfmt/logfmt/encode.go index 4ea9d23998c..d8f69351a72 100644 --- a/vendor/github.com/go-logfmt/logfmt/encode.go +++ b/vendor/github.com/go-logfmt/logfmt/encode.go @@ -13,7 +13,7 @@ import ( // MarshalKeyvals returns the logfmt encoding of keyvals, a variadic sequence // of alternating keys and values. -func MarshalKeyvals(keyvals ...interface{}) ([]byte, error) { +func MarshalKeyvals(keyvals ...any) ([]byte, error) { buf := &bytes.Buffer{} if err := NewEncoder(buf).EncodeKeyvals(keyvals...); err != nil { return nil, err @@ -45,7 +45,7 @@ var ( // EncodeKeyval writes the logfmt encoding of key and value to the stream. A // single space is written before the second and subsequent keys in a record. // Nothing is written if a non-nil error is returned. -func (enc *Encoder) EncodeKeyval(key, value interface{}) error { +func (enc *Encoder) EncodeKeyval(key, value any) error { enc.scratch.Reset() if enc.needSep { if _, err := enc.scratch.Write(space); err != nil { @@ -72,7 +72,7 @@ func (enc *Encoder) EncodeKeyval(key, value interface{}) error { // unsupported type or that cause a MarshalerError are replaced by their error // but do not cause EncodeKeyvals to return an error. If a non-nil error is // returned some key/value pairs may not have be written. -func (enc *Encoder) EncodeKeyvals(keyvals ...interface{}) error { +func (enc *Encoder) EncodeKeyvals(keyvals ...any) error { if len(keyvals) == 0 { return nil } @@ -122,7 +122,7 @@ var ErrUnsupportedKeyType = errors.New("unsupported key type") // unsupported type. var ErrUnsupportedValueType = errors.New("unsupported value type") -func writeKey(w io.Writer, key interface{}) error { +func writeKey(w io.Writer, key any) error { if key == nil { return ErrNilKey } @@ -155,7 +155,7 @@ func writeKey(w io.Writer, key interface{}) error { switch rkey.Kind() { case reflect.Array, reflect.Chan, reflect.Func, reflect.Map, reflect.Slice, reflect.Struct: return ErrUnsupportedKeyType - case reflect.Ptr: + case reflect.Pointer: if rkey.IsNil() { return ErrNilKey } @@ -170,7 +170,7 @@ func writeKey(w io.Writer, key interface{}) error { // functions it causes them to remove invalid key runes from strings or byte // slices respectively. func keyRuneFilter(r rune) rune { - if r <= ' ' || r == '=' || r == '"' || r == utf8.RuneError { + if r <= ' ' || r == '=' || r == '"' || r == 0x7f || r == utf8.RuneError { return -1 } return r @@ -194,7 +194,7 @@ func writeBytesKey(w io.Writer, key []byte) error { return err } -func writeValue(w io.Writer, value interface{}) error { +func writeValue(w io.Writer, value any) error { switch v := value.(type) { case nil: return writeBytesValue(w, null) @@ -222,7 +222,7 @@ func writeValue(w io.Writer, value interface{}) error { switch rvalue.Kind() { case reflect.Array, reflect.Chan, reflect.Func, reflect.Map, reflect.Slice, reflect.Struct: return ErrUnsupportedValueType - case reflect.Ptr: + case reflect.Pointer: if rvalue.IsNil() { return writeBytesValue(w, null) } @@ -233,7 +233,7 @@ func writeValue(w io.Writer, value interface{}) error { } func needsQuotedValueRune(r rune) bool { - return r <= ' ' || r == '=' || r == '"' || r == utf8.RuneError + return r <= ' ' || r == '=' || r == '"' || r == 0x7f || r == utf8.RuneError } func writeStringValue(w io.Writer, value string, ok bool) error { @@ -276,7 +276,7 @@ func (enc *Encoder) Reset() { func safeError(err error) (s string, ok bool) { defer func() { if panicVal := recover(); panicVal != nil { - if v := reflect.ValueOf(err); v.Kind() == reflect.Ptr && v.IsNil() { + if v := reflect.ValueOf(err); v.Kind() == reflect.Pointer && v.IsNil() { s, ok = "null", false } else { s, ok = fmt.Sprintf("PANIC:%v", panicVal), false @@ -290,7 +290,7 @@ func safeError(err error) (s string, ok bool) { func safeString(str fmt.Stringer) (s string, ok bool) { defer func() { if panicVal := recover(); panicVal != nil { - if v := reflect.ValueOf(str); v.Kind() == reflect.Ptr && v.IsNil() { + if v := reflect.ValueOf(str); v.Kind() == reflect.Pointer && v.IsNil() { s, ok = "null", false } else { s, ok = fmt.Sprintf("PANIC:%v", panicVal), true @@ -304,7 +304,7 @@ func safeString(str fmt.Stringer) (s string, ok bool) { func safeMarshal(tm encoding.TextMarshaler) (b []byte, err error) { defer func() { if panicVal := recover(); panicVal != nil { - if v := reflect.ValueOf(tm); v.Kind() == reflect.Ptr && v.IsNil() { + if v := reflect.ValueOf(tm); v.Kind() == reflect.Pointer && v.IsNil() { b, err = nil, nil } else { b, err = nil, fmt.Errorf("panic when marshalling: %s", panicVal) diff --git a/vendor/github.com/go-logfmt/logfmt/jsonstring.go b/vendor/github.com/go-logfmt/logfmt/jsonstring.go index 030ac85fcc2..26e1b1c137c 100644 --- a/vendor/github.com/go-logfmt/logfmt/jsonstring.go +++ b/vendor/github.com/go-logfmt/logfmt/jsonstring.go @@ -19,7 +19,7 @@ import ( var hex = "0123456789abcdef" var bufferPool = sync.Pool{ - New: func() interface{} { + New: func() any { return &bytes.Buffer{} }, } @@ -40,7 +40,7 @@ func writeQuotedString(w io.Writer, s string) (int, error) { start := 0 for i := 0; i < len(s); { if b := s[i]; b < utf8.RuneSelf { - if 0x20 <= b && b != '\\' && b != '"' { + if 0x20 <= b && b != '\\' && b != '"' && b != 0x7f { i++ continue } @@ -91,14 +91,14 @@ func writeQuotedString(w io.Writer, s string) (int, error) { return n, err } -// NOTE: keep in sync with writeQuoteString above. +// NOTE: keep in sync with writeQuotedString above. func writeQuotedBytes(w io.Writer, s []byte) (int, error) { buf := getBuffer() buf.WriteByte('"') start := 0 for i := 0; i < len(s); { if b := s[i]; b < utf8.RuneSelf { - if 0x20 <= b && b != '\\' && b != '"' { + if 0x20 <= b && b != '\\' && b != '"' && b != 0x7f { i++ continue } diff --git a/vendor/github.com/go-openapi/errors/README.md b/vendor/github.com/go-openapi/errors/README.md index 6d57ea55c7c..d7e3a18bcf5 100644 --- a/vendor/github.com/go-openapi/errors/README.md +++ b/vendor/github.com/go-openapi/errors/README.md @@ -6,3 +6,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/go-openapi/errors)](https://goreportcard.com/report/github.com/go-openapi/errors) Shared errors and error interface used throughout the various libraries found in the go-openapi toolkit. + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). diff --git a/vendor/github.com/go-openapi/errors/api.go b/vendor/github.com/go-openapi/errors/api.go index 52d45777280..d39233bafe4 100644 --- a/vendor/github.com/go-openapi/errors/api.go +++ b/vendor/github.com/go-openapi/errors/api.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -46,14 +35,14 @@ func (a *apiError) Code() int32 { // MarshalJSON implements the JSON encoding interface func (a apiError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": a.code, "message": a.message, }) } // New creates a new API error with a code and a message -func New(code int32, message string, args ...interface{}) Error { +func New(code int32, message string, args ...any) Error { if len(args) > 0 { return &apiError{ code: code, @@ -67,7 +56,7 @@ func New(code int32, message string, args ...interface{}) Error { } // NotFound creates a new not found error -func NotFound(message string, args ...interface{}) Error { +func NotFound(message string, args ...any) Error { if message == "" { message = "Not found" } @@ -97,7 +86,7 @@ func (m *MethodNotAllowedError) Code() int32 { // MarshalJSON implements the JSON encoding interface func (m MethodNotAllowedError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": m.code, "message": m.message, "allowed": m.Allowed, diff --git a/vendor/github.com/go-openapi/errors/auth.go b/vendor/github.com/go-openapi/errors/auth.go index 0545b501bd7..08de582e5db 100644 --- a/vendor/github.com/go-openapi/errors/auth.go +++ b/vendor/github.com/go-openapi/errors/auth.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors diff --git a/vendor/github.com/go-openapi/errors/doc.go b/vendor/github.com/go-openapi/errors/doc.go index af01190ce61..b4627f30f4c 100644 --- a/vendor/github.com/go-openapi/errors/doc.go +++ b/vendor/github.com/go-openapi/errors/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 /* Package errors provides an Error interface and several concrete types diff --git a/vendor/github.com/go-openapi/errors/headers.go b/vendor/github.com/go-openapi/errors/headers.go index 6ea1151f415..2d837c34ac4 100644 --- a/vendor/github.com/go-openapi/errors/headers.go +++ b/vendor/github.com/go-openapi/errors/headers.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -25,9 +14,9 @@ type Validation struct { //nolint: errname code int32 Name string In string - Value interface{} + Value any message string - Values []interface{} + Values []any } func (e *Validation) Error() string { @@ -41,7 +30,7 @@ func (e *Validation) Code() int32 { // MarshalJSON implements the JSON encoding interface func (e Validation) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": e.code, "message": e.message, "in": e.In, @@ -72,7 +61,7 @@ const ( // InvalidContentType error for an invalid content type func InvalidContentType(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) + values := make([]any, 0, len(allowed)) for _, v := range allowed { values = append(values, v) } @@ -88,7 +77,7 @@ func InvalidContentType(value string, allowed []string) *Validation { // InvalidResponseFormat error for an unacceptable response format request func InvalidResponseFormat(value string, allowed []string) *Validation { - values := make([]interface{}, 0, len(allowed)) + values := make([]any, 0, len(allowed)) for _, v := range allowed { values = append(values, v) } diff --git a/vendor/github.com/go-openapi/errors/middleware.go b/vendor/github.com/go-openapi/errors/middleware.go index 1b9f3a93016..c434e59a6fa 100644 --- a/vendor/github.com/go-openapi/errors/middleware.go +++ b/vendor/github.com/go-openapi/errors/middleware.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors diff --git a/vendor/github.com/go-openapi/errors/parsing.go b/vendor/github.com/go-openapi/errors/parsing.go index 34930c087a7..ea2a7c60377 100644 --- a/vendor/github.com/go-openapi/errors/parsing.go +++ b/vendor/github.com/go-openapi/errors/parsing.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -63,7 +52,7 @@ func (e ParseError) MarshalJSON() ([]byte, error) { if e.Reason != nil { reason = e.Reason.Error() } - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": e.code, "message": e.message, "in": e.In, diff --git a/vendor/github.com/go-openapi/errors/schema.go b/vendor/github.com/go-openapi/errors/schema.go index 8f3239dfd9b..e59ca4f863f 100644 --- a/vendor/github.com/go-openapi/errors/schema.go +++ b/vendor/github.com/go-openapi/errors/schema.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package errors @@ -130,7 +119,7 @@ func (c *CompositeError) Unwrap() []error { // MarshalJSON implements the JSON encoding interface func (c CompositeError) MarshalJSON() ([]byte, error) { - return json.Marshal(map[string]interface{}{ + return json.Marshal(map[string]any{ "code": c.code, "message": c.message, "errors": c.Errors, @@ -254,7 +243,7 @@ func InvalidTypeName(typeName string) *Validation { } // InvalidType creates an error for when the type is invalid -func InvalidType(name, in, typeName string, value interface{}) *Validation { +func InvalidType(name, in, typeName string, value any) *Validation { var message string if in != "" { @@ -302,7 +291,7 @@ func DuplicateItems(name, in string) *Validation { } // TooManyItems error for when an array contains too many items -func TooManyItems(name, in string, maximum int64, value interface{}) *Validation { +func TooManyItems(name, in string, maximum int64, value any) *Validation { msg := fmt.Sprintf(maximumItemsFail, name, in, maximum) if in == "" { msg = fmt.Sprintf(maximumItemsFailNoIn, name, maximum) @@ -318,7 +307,7 @@ func TooManyItems(name, in string, maximum int64, value interface{}) *Validation } // TooFewItems error for when an array contains too few items -func TooFewItems(name, in string, minimum int64, value interface{}) *Validation { +func TooFewItems(name, in string, minimum int64, value any) *Validation { msg := fmt.Sprintf(minItemsFail, name, in, minimum) if in == "" { msg = fmt.Sprintf(minItemsFailNoIn, name, minimum) @@ -333,7 +322,7 @@ func TooFewItems(name, in string, minimum int64, value interface{}) *Validation } // ExceedsMaximumInt error for when maximumimum validation fails -func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -358,7 +347,7 @@ func ExceedsMaximumInt(name, in string, maximum int64, exclusive bool, value int } // ExceedsMaximumUint error for when maximumimum validation fails -func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -383,7 +372,7 @@ func ExceedsMaximumUint(name, in string, maximum uint64, exclusive bool, value i } // ExceedsMaximum error for when maximumimum validation fails -func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value interface{}) *Validation { +func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value any) *Validation { var message string if in == "" { m := maximumIncFailNoIn @@ -408,7 +397,7 @@ func ExceedsMaximum(name, in string, maximum float64, exclusive bool, value inte } // ExceedsMinimumInt error for when minimum validation fails -func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -433,7 +422,7 @@ func ExceedsMinimumInt(name, in string, minimum int64, exclusive bool, value int } // ExceedsMinimumUint error for when minimum validation fails -func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -458,7 +447,7 @@ func ExceedsMinimumUint(name, in string, minimum uint64, exclusive bool, value i } // ExceedsMinimum error for when minimum validation fails -func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value interface{}) *Validation { +func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value any) *Validation { var message string if in == "" { m := minIncFailNoIn @@ -483,7 +472,7 @@ func ExceedsMinimum(name, in string, minimum float64, exclusive bool, value inte } // NotMultipleOf error for when multiple of validation fails -func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { +func NotMultipleOf(name, in string, multiple, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(multipleOfFailNoIn, name, multiple) @@ -500,7 +489,7 @@ func NotMultipleOf(name, in string, multiple, value interface{}) *Validation { } // EnumFail error for when an enum validation fails -func EnumFail(name, in string, value interface{}, values []interface{}) *Validation { +func EnumFail(name, in string, value any, values []any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(enumFailNoIn, name, values) @@ -519,7 +508,7 @@ func EnumFail(name, in string, value interface{}, values []interface{}) *Validat } // Required error for when a value is missing -func Required(name, in string, value interface{}) *Validation { +func Required(name, in string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(requiredFailNoIn, name) @@ -536,7 +525,7 @@ func Required(name, in string, value interface{}) *Validation { } // ReadOnly error for when a value is present in request -func ReadOnly(name, in string, value interface{}) *Validation { +func ReadOnly(name, in string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(readOnlyFailNoIn, name) @@ -553,7 +542,7 @@ func ReadOnly(name, in string, value interface{}) *Validation { } // TooLong error for when a string is too long -func TooLong(name, in string, maximum int64, value interface{}) *Validation { +func TooLong(name, in string, maximum int64, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(tooLongMessageNoIn, name, maximum) @@ -570,7 +559,7 @@ func TooLong(name, in string, maximum int64, value interface{}) *Validation { } // TooShort error for when a string is too short -func TooShort(name, in string, minimum int64, value interface{}) *Validation { +func TooShort(name, in string, minimum int64, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(tooShortMessageNoIn, name, minimum) @@ -589,7 +578,7 @@ func TooShort(name, in string, minimum int64, value interface{}) *Validation { // FailedPattern error for when a string fails a regex pattern match // the pattern that is returned is the ECMA syntax version of the pattern not the golang version. -func FailedPattern(name, in, pattern string, value interface{}) *Validation { +func FailedPattern(name, in, pattern string, value any) *Validation { var msg string if in == "" { msg = fmt.Sprintf(patternFailNoIn, name, pattern) @@ -608,7 +597,7 @@ func FailedPattern(name, in, pattern string, value interface{}) *Validation { // MultipleOfMustBePositive error for when a // multipleOf factor is negative -func MultipleOfMustBePositive(name, in string, factor interface{}) *Validation { +func MultipleOfMustBePositive(name, in string, factor any) *Validation { return &Validation{ code: MultipleOfMustBePositiveCode, Name: name, diff --git a/vendor/github.com/go-openapi/strfmt/.golangci.yml b/vendor/github.com/go-openapi/strfmt/.golangci.yml index 7cea1af8b52..1ad5adf47e6 100644 --- a/vendor/github.com/go-openapi/strfmt/.golangci.yml +++ b/vendor/github.com/go-openapi/strfmt/.golangci.yml @@ -16,7 +16,7 @@ linters: - godox - gosmopolitan - inamedparam - #- intrange # disabled while < go1.22 + - intrange - ireturn - lll - musttag diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md index f6b39c6c56c..de5afe13760 100644 --- a/vendor/github.com/go-openapi/strfmt/README.md +++ b/vendor/github.com/go-openapi/strfmt/README.md @@ -35,7 +35,7 @@ It also provides convenient extensions to go-openapi users. - mac (e.g "01:02:03:04:05:06") - rgbcolor (e.g. "rgb(100,100,100)") - ssn - - uuid, uuid3, uuid4, uuid5 + - uuid, uuid3, uuid4, uuid5, uuid7 - cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32") - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec)) @@ -81,7 +81,12 @@ List of defined types: - SSN - URI - UUID -- UUID3 -- UUID4 -- UUID5 +- [UUID3](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-3) +- [UUID4](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-4) +- [UUID5](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-5) +- [UUID7](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7) - [ULID](https://github.com/ulid/spec) + +## Licensing + +This library ships under the [SPDX-License-Identifier: Apache-2.0](./LICENSE). diff --git a/vendor/github.com/go-openapi/strfmt/bson.go b/vendor/github.com/go-openapi/strfmt/bson.go index 78d6e073587..0eec8f6432c 100644 --- a/vendor/github.com/go-openapi/strfmt/bson.go +++ b/vendor/github.com/go-openapi/strfmt/bson.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -18,9 +7,6 @@ import ( "database/sql/driver" "fmt" - "go.mongodb.org/mongo-driver/bson" - - "go.mongodb.org/mongo-driver/bson/bsontype" bsonprim "go.mongodb.org/mongo-driver/bson/primitive" ) @@ -75,7 +61,7 @@ func (id *ObjectId) UnmarshalText(data []byte) error { // validation is performe } // Scan read a value from a database driver -func (id *ObjectId) Scan(raw interface{}) error { +func (id *ObjectId) Scan(raw any) error { var data []byte switch v := raw.(type) { case []byte: @@ -113,42 +99,6 @@ func (id *ObjectId) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON renders the object id as a BSON document -func (id ObjectId) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)}) -} - -// UnmarshalBSON reads the objectId from a BSON document -func (id *ObjectId) UnmarshalBSON(data []byte) error { - var obj struct { - Data bsonprim.ObjectID - } - if err := bson.Unmarshal(data, &obj); err != nil { - return err - } - *id = ObjectId(obj.Data) - return nil -} - -// MarshalBSONValue is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. -func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { - oid := bsonprim.ObjectID(id) - return bson.TypeObjectID, oid[:], nil -} - -// UnmarshalBSONValue is an interface implemented by types that can unmarshal a -// BSON value representation of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. -func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error { - var oid bsonprim.ObjectID - copy(oid[:], data) - *id = ObjectId(oid) - return nil -} - // DeepCopyInto copies the receiver and writes its value into out. func (id *ObjectId) DeepCopyInto(out *ObjectId) { *out = *id diff --git a/vendor/github.com/go-openapi/strfmt/date.go b/vendor/github.com/go-openapi/strfmt/date.go index a8f52ff354d..8aa17b8ea55 100644 --- a/vendor/github.com/go-openapi/strfmt/date.go +++ b/vendor/github.com/go-openapi/strfmt/date.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -19,8 +8,6 @@ import ( "encoding/json" "fmt" "time" - - "go.mongodb.org/mongo-driver/bson" ) func init() { @@ -70,7 +57,7 @@ func (d Date) MarshalText() ([]byte, error) { } // Scan scans a Date value from database driver type. -func (d *Date) Scan(raw interface{}) error { +func (d *Date) Scan(raw any) error { switch v := raw.(type) { case []byte: return d.UnmarshalText(v) @@ -114,28 +101,6 @@ func (d *Date) UnmarshalJSON(data []byte) error { return nil } -func (d Date) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": d.String()}) -} - -func (d *Date) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if data, ok := m["data"].(string); ok { - rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) - if err != nil { - return err - } - *d = Date(rd) - return nil - } - - return fmt.Errorf("couldn't unmarshal bson bytes value as Date: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (d *Date) DeepCopyInto(out *Date) { *out = *d diff --git a/vendor/github.com/go-openapi/strfmt/default.go b/vendor/github.com/go-openapi/strfmt/default.go index 02e11122937..8a80cfbdb8a 100644 --- a/vendor/github.com/go-openapi/strfmt/default.go +++ b/vendor/github.com/go-openapi/strfmt/default.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -19,14 +8,15 @@ import ( "encoding/base64" "encoding/json" "fmt" + "net" "net/mail" "net/netip" + "net/url" + "regexp" "strconv" "strings" - "github.com/asaskevich/govalidator" "github.com/google/uuid" - "go.mongodb.org/mongo-driver/bson" "golang.org/x/net/idna" ) @@ -60,10 +50,33 @@ const ( // // Deprecated: strfmt no longer uses regular expressions to validate UUIDs. UUID5Pattern = `(?i)(^[0-9a-f]{8}-[0-9a-f]{4}-5[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$)|(^[0-9a-f]{12}5[0-9a-f]{3}[89ab][0-9a-f]{15}$)` + + isbn10Pattern string = "^(?:[0-9]{9}X|[0-9]{10})$" + isbn13Pattern string = "^(?:[0-9]{13})$" + usCardPattern string = "^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11}|6[27][0-9]{14})$" + ssnPattern string = `^\d{3}[- ]?\d{2}[- ]?\d{4}$` + hexColorPattern string = "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$" + rgbColorPattern string = "^rgb\\(\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*,\\s*(0|[1-9]\\d?|1\\d\\d?|2[0-4]\\d|25[0-5])\\s*\\)$" +) + +const ( + isbnVersion10 = 10 + isbnVersion13 = 13 + decimalBase = 10 ) -var idnaHostChecker = idna.New( - idna.ValidateForRegistration(), // shorthand for [idna.StrictDomainName], [idna.ValidateLabels], [idna.VerifyDNSLength], [idna.BidiRule] +var ( + idnaHostChecker = idna.New( + idna.ValidateForRegistration(), // shorthand for [idna.StrictDomainName], [idna.ValidateLabels], [idna.VerifyDNSLength], [idna.BidiRule] + ) + + whiteSpacesAndMinus = regexp.MustCompile(`[\s-]+`) + rxISBN10 = regexp.MustCompile(isbn10Pattern) + rxISBN13 = regexp.MustCompile(isbn13Pattern) + rxCreditCard = regexp.MustCompile(usCardPattern) + rxSSN = regexp.MustCompile(ssnPattern) + rxHexcolor = regexp.MustCompile(hexColorPattern) + rxRGBcolor = regexp.MustCompile(rgbColorPattern) ) // IsHostname returns true when the string is a valid hostname. @@ -322,6 +335,7 @@ const ( uuidV3 = 3 uuidV4 = 4 uuidV5 = 5 + uuidV7 = 7 ) // IsUUID3 returns true is the string matches a UUID v3, upper case is allowed @@ -342,6 +356,12 @@ func IsUUID5(str string) bool { return err == nil && id.Version() == uuid.Version(uuidV5) } +// IsUUID7 returns true is the string matches a UUID v7, upper case is allowed +func IsUUID7(str string) bool { + id, err := uuid.Parse(str) + return err == nil && id.Version() == uuid.Version(uuidV7) +} + // IsEmail validates an email address. func IsEmail(str string) bool { addr, e := mail.ParseAddress(str) @@ -370,8 +390,9 @@ func init() { // - uuid3 // - uuid4 // - uuid5 + // - uuid7 u := URI("") - Default.Add("uri", &u, govalidator.IsRequestURI) + Default.Add("uri", &u, isRequestURI) eml := Email("") Default.Add("email", &eml, IsEmail) @@ -380,16 +401,16 @@ func init() { Default.Add("hostname", &hn, IsHostname) ip4 := IPv4("") - Default.Add("ipv4", &ip4, govalidator.IsIPv4) + Default.Add("ipv4", &ip4, isIPv4) ip6 := IPv6("") - Default.Add("ipv6", &ip6, govalidator.IsIPv6) + Default.Add("ipv6", &ip6, isIPv6) cidr := CIDR("") - Default.Add("cidr", &cidr, govalidator.IsCIDR) + Default.Add("cidr", &cidr, isCIDR) mac := MAC("") - Default.Add("mac", &mac, govalidator.IsMAC) + Default.Add("mac", &mac, isMAC) uid := UUID("") Default.Add("uuid", &uid, IsUUID) @@ -403,29 +424,32 @@ func init() { uid5 := UUID5("") Default.Add("uuid5", &uid5, IsUUID5) + uid7 := UUID7("") + Default.Add("uuid7", &uid7, IsUUID7) + isbn := ISBN("") - Default.Add("isbn", &isbn, func(str string) bool { return govalidator.IsISBN10(str) || govalidator.IsISBN13(str) }) + Default.Add("isbn", &isbn, func(str string) bool { return isISBN10(str) || isISBN13(str) }) isbn10 := ISBN10("") - Default.Add("isbn10", &isbn10, govalidator.IsISBN10) + Default.Add("isbn10", &isbn10, isISBN10) isbn13 := ISBN13("") - Default.Add("isbn13", &isbn13, govalidator.IsISBN13) + Default.Add("isbn13", &isbn13, isISBN13) cc := CreditCard("") - Default.Add("creditcard", &cc, govalidator.IsCreditCard) + Default.Add("creditcard", &cc, isCreditCard) ssn := SSN("") - Default.Add("ssn", &ssn, govalidator.IsSSN) + Default.Add("ssn", &ssn, isSSN) hc := HexColor("") - Default.Add("hexcolor", &hc, govalidator.IsHexcolor) + Default.Add("hexcolor", &hc, isHexcolor) rc := RGBColor("") - Default.Add("rgbcolor", &rc, govalidator.IsRGBcolor) + Default.Add("rgbcolor", &rc, isRGBcolor) b64 := Base64([]byte(nil)) - Default.Add("byte", &b64, govalidator.IsBase64) + Default.Add("byte", &b64, isBase64) pw := Password("") Default.Add("password", &pw, func(_ string) bool { return true }) @@ -460,7 +484,7 @@ func (b *Base64) UnmarshalText(data []byte) error { // validation is performed l } // Scan read a value from a database driver -func (b *Base64) Scan(raw interface{}) error { +func (b *Base64) Scan(raw any) error { switch v := raw.(type) { case []byte: dbuf := make([]byte, base64.StdEncoding.DecodedLen(len(v))) @@ -510,29 +534,6 @@ func (b *Base64) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (b Base64) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": b.String()}) -} - -// UnmarshalBSON document into this value -func (b *Base64) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if bd, ok := m["data"].(string); ok { - vb, err := base64.StdEncoding.DecodeString(bd) - if err != nil { - return err - } - *b = Base64(vb) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as base64: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (b *Base64) DeepCopyInto(out *Base64) { *out = *b @@ -565,7 +566,7 @@ func (u *URI) UnmarshalText(data []byte) error { // validation is performed late } // Scan read a value from a database driver -func (u *URI) Scan(raw interface{}) error { +func (u *URI) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = URI(string(v)) @@ -602,25 +603,6 @@ func (u *URI) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u URI) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *URI) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = URI(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as uri: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *URI) DeepCopyInto(out *URI) { *out = *u @@ -653,7 +635,7 @@ func (e *Email) UnmarshalText(data []byte) error { // validation is performed la } // Scan read a value from a database driver -func (e *Email) Scan(raw interface{}) error { +func (e *Email) Scan(raw any) error { switch v := raw.(type) { case []byte: *e = Email(string(v)) @@ -690,25 +672,6 @@ func (e *Email) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (e Email) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": e.String()}) -} - -// UnmarshalBSON document into this value -func (e *Email) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *e = Email(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as email: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (e *Email) DeepCopyInto(out *Email) { *out = *e @@ -741,7 +704,7 @@ func (h *Hostname) UnmarshalText(data []byte) error { // validation is performed } // Scan read a value from a database driver -func (h *Hostname) Scan(raw interface{}) error { +func (h *Hostname) Scan(raw any) error { switch v := raw.(type) { case []byte: *h = Hostname(string(v)) @@ -778,25 +741,6 @@ func (h *Hostname) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (h Hostname) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": h.String()}) -} - -// UnmarshalBSON document into this value -func (h *Hostname) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *h = Hostname(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as hostname: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (h *Hostname) DeepCopyInto(out *Hostname) { *out = *h @@ -829,7 +773,7 @@ func (u *IPv4) UnmarshalText(data []byte) error { // validation is performed lat } // Scan read a value from a database driver -func (u *IPv4) Scan(raw interface{}) error { +func (u *IPv4) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = IPv4(string(v)) @@ -866,25 +810,6 @@ func (u *IPv4) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u IPv4) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *IPv4) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = IPv4(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as ipv4: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *IPv4) DeepCopyInto(out *IPv4) { *out = *u @@ -917,7 +842,7 @@ func (u *IPv6) UnmarshalText(data []byte) error { // validation is performed lat } // Scan read a value from a database driver -func (u *IPv6) Scan(raw interface{}) error { +func (u *IPv6) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = IPv6(string(v)) @@ -954,25 +879,6 @@ func (u *IPv6) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u IPv6) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *IPv6) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = IPv6(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as ipv6: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *IPv6) DeepCopyInto(out *IPv6) { *out = *u @@ -1005,7 +911,7 @@ func (u *CIDR) UnmarshalText(data []byte) error { // validation is performed lat } // Scan read a value from a database driver -func (u *CIDR) Scan(raw interface{}) error { +func (u *CIDR) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = CIDR(string(v)) @@ -1042,25 +948,6 @@ func (u *CIDR) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u CIDR) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *CIDR) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = CIDR(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as CIDR: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *CIDR) DeepCopyInto(out *CIDR) { *out = *u @@ -1093,7 +980,7 @@ func (u *MAC) UnmarshalText(data []byte) error { // validation is performed late } // Scan read a value from a database driver -func (u *MAC) Scan(raw interface{}) error { +func (u *MAC) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = MAC(string(v)) @@ -1130,25 +1017,6 @@ func (u *MAC) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u MAC) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *MAC) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = MAC(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as MAC: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *MAC) DeepCopyInto(out *MAC) { *out = *u @@ -1181,7 +1049,7 @@ func (u *UUID) UnmarshalText(data []byte) error { // validation is performed lat } // Scan read a value from a database driver -func (u *UUID) Scan(raw interface{}) error { +func (u *UUID) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = UUID(string(v)) @@ -1221,25 +1089,6 @@ func (u *UUID) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u UUID) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *UUID) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = UUID(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as UUID: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *UUID) DeepCopyInto(out *UUID) { *out = *u @@ -1272,7 +1121,7 @@ func (u *UUID3) UnmarshalText(data []byte) error { // validation is performed la } // Scan read a value from a database driver -func (u *UUID3) Scan(raw interface{}) error { +func (u *UUID3) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = UUID3(string(v)) @@ -1312,25 +1161,6 @@ func (u *UUID3) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u UUID3) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *UUID3) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = UUID3(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as UUID3: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *UUID3) DeepCopyInto(out *UUID3) { *out = *u @@ -1363,7 +1193,7 @@ func (u *UUID4) UnmarshalText(data []byte) error { // validation is performed la } // Scan read a value from a database driver -func (u *UUID4) Scan(raw interface{}) error { +func (u *UUID4) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = UUID4(string(v)) @@ -1403,25 +1233,6 @@ func (u *UUID4) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u UUID4) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *UUID4) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = UUID4(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as UUID4: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *UUID4) DeepCopyInto(out *UUID4) { *out = *u @@ -1454,7 +1265,7 @@ func (u *UUID5) UnmarshalText(data []byte) error { // validation is performed la } // Scan read a value from a database driver -func (u *UUID5) Scan(raw interface{}) error { +func (u *UUID5) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = UUID5(string(v)) @@ -1494,36 +1305,89 @@ func (u *UUID5) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u UUID5) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) +// DeepCopyInto copies the receiver and writes its value into out. +func (u *UUID5) DeepCopyInto(out *UUID5) { + *out = *u } -// UnmarshalBSON document into this value -func (u *UUID5) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err +// DeepCopy copies the receiver into a new UUID5. +func (u *UUID5) DeepCopy() *UUID5 { + if u == nil { + return nil } + out := new(UUID5) + u.DeepCopyInto(out) + return out +} - if ud, ok := m["data"].(string); ok { - *u = UUID5(ud) +// UUID7 represents a uuid7 string format +// +// swagger:strfmt uuid7 +type UUID7 string + +// MarshalText turns this instance into text +func (u UUID7) MarshalText() ([]byte, error) { + return []byte(string(u)), nil +} + +// UnmarshalText hydrates this instance from text +func (u *UUID7) UnmarshalText(data []byte) error { // validation is performed later on + *u = UUID7(string(data)) + return nil +} + +// Scan read a value from a database driver +func (u *UUID7) Scan(raw any) error { + switch v := raw.(type) { + case []byte: + *u = UUID7(string(v)) + case string: + *u = UUID7(v) + default: + return fmt.Errorf("cannot sql.Scan() strfmt.UUID7 from: %#v: %w", v, ErrFormat) + } + + return nil +} + +// Value converts a value to a database driver value +func (u UUID7) Value() (driver.Value, error) { + return driver.Value(string(u)), nil +} + +func (u UUID7) String() string { + return string(u) +} + +// MarshalJSON returns the UUID as JSON +func (u UUID7) MarshalJSON() ([]byte, error) { + return json.Marshal(string(u)) +} + +// UnmarshalJSON sets the UUID from JSON +func (u *UUID7) UnmarshalJSON(data []byte) error { + if string(data) == jsonNull { return nil } - return fmt.Errorf("couldn't unmarshal bson bytes as UUID5: %w", ErrFormat) + var ustr string + if err := json.Unmarshal(data, &ustr); err != nil { + return err + } + *u = UUID7(ustr) + return nil } // DeepCopyInto copies the receiver and writes its value into out. -func (u *UUID5) DeepCopyInto(out *UUID5) { +func (u *UUID7) DeepCopyInto(out *UUID7) { *out = *u } -// DeepCopy copies the receiver into a new UUID5. -func (u *UUID5) DeepCopy() *UUID5 { +// DeepCopy copies the receiver into a new UUID7. +func (u *UUID7) DeepCopy() *UUID7 { if u == nil { return nil } - out := new(UUID5) + out := new(UUID7) u.DeepCopyInto(out) return out } @@ -1545,7 +1409,7 @@ func (u *ISBN) UnmarshalText(data []byte) error { // validation is performed lat } // Scan read a value from a database driver -func (u *ISBN) Scan(raw interface{}) error { +func (u *ISBN) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = ISBN(string(v)) @@ -1585,25 +1449,6 @@ func (u *ISBN) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u ISBN) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *ISBN) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = ISBN(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as ISBN: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *ISBN) DeepCopyInto(out *ISBN) { *out = *u @@ -1636,7 +1481,7 @@ func (u *ISBN10) UnmarshalText(data []byte) error { // validation is performed l } // Scan read a value from a database driver -func (u *ISBN10) Scan(raw interface{}) error { +func (u *ISBN10) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = ISBN10(string(v)) @@ -1676,25 +1521,6 @@ func (u *ISBN10) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u ISBN10) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *ISBN10) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = ISBN10(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as ISBN10: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *ISBN10) DeepCopyInto(out *ISBN10) { *out = *u @@ -1727,7 +1553,7 @@ func (u *ISBN13) UnmarshalText(data []byte) error { // validation is performed l } // Scan read a value from a database driver -func (u *ISBN13) Scan(raw interface{}) error { +func (u *ISBN13) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = ISBN13(string(v)) @@ -1767,25 +1593,6 @@ func (u *ISBN13) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u ISBN13) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *ISBN13) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = ISBN13(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as ISBN13: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *ISBN13) DeepCopyInto(out *ISBN13) { *out = *u @@ -1818,7 +1625,7 @@ func (u *CreditCard) UnmarshalText(data []byte) error { // validation is perform } // Scan read a value from a database driver -func (u *CreditCard) Scan(raw interface{}) error { +func (u *CreditCard) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = CreditCard(string(v)) @@ -1858,25 +1665,6 @@ func (u *CreditCard) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u CreditCard) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *CreditCard) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = CreditCard(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as CreditCard: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *CreditCard) DeepCopyInto(out *CreditCard) { *out = *u @@ -1909,7 +1697,7 @@ func (u *SSN) UnmarshalText(data []byte) error { // validation is performed late } // Scan read a value from a database driver -func (u *SSN) Scan(raw interface{}) error { +func (u *SSN) Scan(raw any) error { switch v := raw.(type) { case []byte: *u = SSN(string(v)) @@ -1949,25 +1737,6 @@ func (u *SSN) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u SSN) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *SSN) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *u = SSN(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as SSN: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *SSN) DeepCopyInto(out *SSN) { *out = *u @@ -2000,7 +1769,7 @@ func (h *HexColor) UnmarshalText(data []byte) error { // validation is performed } // Scan read a value from a database driver -func (h *HexColor) Scan(raw interface{}) error { +func (h *HexColor) Scan(raw any) error { switch v := raw.(type) { case []byte: *h = HexColor(string(v)) @@ -2040,25 +1809,6 @@ func (h *HexColor) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (h HexColor) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": h.String()}) -} - -// UnmarshalBSON document into this value -func (h *HexColor) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *h = HexColor(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as HexColor: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (h *HexColor) DeepCopyInto(out *HexColor) { *out = *h @@ -2091,7 +1841,7 @@ func (r *RGBColor) UnmarshalText(data []byte) error { // validation is performed } // Scan read a value from a database driver -func (r *RGBColor) Scan(raw interface{}) error { +func (r *RGBColor) Scan(raw any) error { switch v := raw.(type) { case []byte: *r = RGBColor(string(v)) @@ -2131,25 +1881,6 @@ func (r *RGBColor) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (r RGBColor) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": r.String()}) -} - -// UnmarshalBSON document into this value -func (r *RGBColor) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *r = RGBColor(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as RGBColor: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (r *RGBColor) DeepCopyInto(out *RGBColor) { *out = *r @@ -2183,7 +1914,7 @@ func (r *Password) UnmarshalText(data []byte) error { // validation is performed } // Scan read a value from a database driver -func (r *Password) Scan(raw interface{}) error { +func (r *Password) Scan(raw any) error { switch v := raw.(type) { case []byte: *r = Password(string(v)) @@ -2223,25 +1954,6 @@ func (r *Password) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (r Password) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": r.String()}) -} - -// UnmarshalBSON document into this value -func (r *Password) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - *r = Password(ud) - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as Password: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (r *Password) DeepCopyInto(out *Password) { *out = *r @@ -2256,3 +1968,143 @@ func (r *Password) DeepCopy() *Password { r.DeepCopyInto(out) return out } + +func isRequestURI(rawurl string) bool { + _, err := url.ParseRequestURI(rawurl) + return err == nil +} + +// isIPv4 checks if the string is an IP version 4. +func isIPv4(str string) bool { + ip := net.ParseIP(str) + return ip != nil && strings.Contains(str, ".") +} + +// isIPv6 checks if the string is an IP version 6. +func isIPv6(str string) bool { + ip := net.ParseIP(str) + return ip != nil && strings.Contains(str, ":") +} + +// isCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6) +func isCIDR(str string) bool { + _, _, err := net.ParseCIDR(str) + return err == nil +} + +// isMAC checks if a string is valid MAC address. +// Possible MAC formats: +// 01:23:45:67:89:ab +// 01:23:45:67:89:ab:cd:ef +// 01-23-45-67-89-ab +// 01-23-45-67-89-ab-cd-ef +// 0123.4567.89ab +// 0123.4567.89ab.cdef +func isMAC(str string) bool { + _, err := net.ParseMAC(str) + return err == nil +} + +// isISBN checks if the string is an ISBN (version 10 or 13). +// If version value is not equal to 10 or 13, it will be checks both variants. +func isISBN(str string, version int) bool { + sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") + var checksum int32 + var i int32 + + switch version { + case isbnVersion10: + if !rxISBN10.MatchString(sanitized) { + return false + } + for i = range isbnVersion10 - 1 { + checksum += (i + 1) * int32(sanitized[i]-'0') + } + if sanitized[isbnVersion10-1] == 'X' { + checksum += isbnVersion10 * isbnVersion10 + } else { + checksum += isbnVersion10 * int32(sanitized[isbnVersion10-1]-'0') + } + if checksum%(isbnVersion10+1) == 0 { + return true + } + return false + case isbnVersion13: + if !rxISBN13.MatchString(sanitized) { + return false + } + factor := []int32{1, 3} + for i = range isbnVersion13 - 1 { + checksum += factor[i%2] * int32(sanitized[i]-'0') + } + return (int32(sanitized[isbnVersion13-1]-'0'))-((decimalBase-(checksum%decimalBase))%decimalBase) == 0 + default: + return isISBN(str, isbnVersion10) || isISBN(str, isbnVersion13) + } +} + +// isISBN10 checks if the string is an ISBN version 10. +func isISBN10(str string) bool { + return isISBN(str, isbnVersion10) +} + +// isISBN13 checks if the string is an ISBN version 13. +func isISBN13(str string) bool { + return isISBN(str, isbnVersion13) +} + +// isCreditCard checks if the string is a credit card. +func isCreditCard(str string) bool { + sanitized := whiteSpacesAndMinus.ReplaceAllString(str, "") + if !rxCreditCard.MatchString(sanitized) { + return false + } + + number, err := strconv.ParseInt(sanitized, 0, 64) + if err != nil { + return false + } + number, lastDigit := number/decimalBase, number%decimalBase + + var sum int64 + for i := 0; number > 0; i++ { + digit := number % decimalBase + + if i%2 == 0 { + digit *= 2 + if digit > decimalBase-1 { + digit -= decimalBase - 1 + } + } + + sum += digit + number /= decimalBase + } + + return (sum+lastDigit)%decimalBase == 0 +} + +// isSSN will validate the given string as a U.S. Social Security Number +func isSSN(str string) bool { + if str == "" || len(str) != 11 { + return false + } + return rxSSN.MatchString(str) +} + +// isHexcolor checks if the string is a hexadecimal color. +func isHexcolor(str string) bool { + return rxHexcolor.MatchString(str) +} + +// isRGBcolor checks if the string is a valid RGB color in form rgb(RRR, GGG, BBB). +func isRGBcolor(str string) bool { + return rxRGBcolor.MatchString(str) +} + +// isBase64 checks if a string is base64 encoded. +func isBase64(str string) bool { + _, err := base64.StdEncoding.DecodeString(str) + + return err == nil +} diff --git a/vendor/github.com/go-openapi/strfmt/doc.go b/vendor/github.com/go-openapi/strfmt/doc.go index 41aebe6d51a..5825b72108e 100644 --- a/vendor/github.com/go-openapi/strfmt/doc.go +++ b/vendor/github.com/go-openapi/strfmt/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 // Package strfmt contains custom string formats // diff --git a/vendor/github.com/go-openapi/strfmt/duration.go b/vendor/github.com/go-openapi/strfmt/duration.go index 749c4b561c2..908c1b02f3c 100644 --- a/vendor/github.com/go-openapi/strfmt/duration.go +++ b/vendor/github.com/go-openapi/strfmt/duration.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -23,8 +12,6 @@ import ( "strconv" "strings" "time" - - "go.mongodb.org/mongo-driver/bson" ) func init() { @@ -154,7 +141,7 @@ func ParseDuration(cand string) (time.Duration, error) { } // Scan reads a Duration value from database driver type. -func (d *Duration) Scan(raw interface{}) error { +func (d *Duration) Scan(raw any) error { switch v := raw.(type) { // TODO: case []byte: // ? case int64: @@ -203,28 +190,6 @@ func (d *Duration) UnmarshalJSON(data []byte) error { return nil } -func (d Duration) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": d.String()}) -} - -func (d *Duration) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if data, ok := m["data"].(string); ok { - rd, err := ParseDuration(data) - if err != nil { - return err - } - *d = Duration(rd) - return nil - } - - return fmt.Errorf("couldn't unmarshal bson bytes value as Date: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (d *Duration) DeepCopyInto(out *Duration) { *out = *d diff --git a/vendor/github.com/go-openapi/strfmt/errors.go b/vendor/github.com/go-openapi/strfmt/errors.go index 9a9240363de..9faa37cf2e5 100644 --- a/vendor/github.com/go-openapi/strfmt/errors.go +++ b/vendor/github.com/go-openapi/strfmt/errors.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + package strfmt type strfmtError string diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go index 73f83af9c92..d9d9e04c208 100644 --- a/vendor/github.com/go-openapi/strfmt/format.go +++ b/vendor/github.com/go-openapi/strfmt/format.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt @@ -18,6 +7,7 @@ import ( "encoding" "fmt" "reflect" + "slices" "strings" "sync" "time" @@ -32,27 +22,6 @@ var Default = NewSeededFormats(nil, nil) // Validator represents a validator for a string format. type Validator func(string) bool -// Format represents a string format. -// -// All implementations of Format provide a string representation and text -// marshaling/unmarshaling interface to be used by encoders (e.g. encoding/json). -type Format interface { - String() string - encoding.TextMarshaler - encoding.TextUnmarshaler -} - -// Registry is a registry of string formats, with a validation method. -type Registry interface { - Add(string, Format, Validator) bool - DelByName(string) bool - GetType(string) (reflect.Type, bool) - ContainsName(string) bool - Validates(string, string) bool - Parse(string, string) (any, error) - MapStructureHookFunc() mapstructure.DecodeHookFunc -} - // NewFormats creates a new formats registry seeded with the values from the default func NewFormats() Registry { //nolint:forcetypeassert @@ -64,10 +33,9 @@ func NewSeededFormats(seeds []knownFormat, normalizer NameNormalizer) Registry { if normalizer == nil { normalizer = DefaultNameNormalizer } - // copy here, don't modify original - d := append([]knownFormat(nil), seeds...) + // copy here, don't modify the original return &defaultFormats{ - data: d, + data: slices.Clone(seeds), normalizeName: normalizer, } } @@ -139,6 +107,8 @@ func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc { return UUID4(data), nil case "uuid5": return UUID5(data), nil + case "uuid7": + return UUID7(data), nil case "hostname": return Hostname(data), nil case "ipv4": diff --git a/vendor/github.com/go-openapi/strfmt/ifaces.go b/vendor/github.com/go-openapi/strfmt/ifaces.go new file mode 100644 index 00000000000..1b9e72c64eb --- /dev/null +++ b/vendor/github.com/go-openapi/strfmt/ifaces.go @@ -0,0 +1,32 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package strfmt + +import ( + "encoding" + "reflect" + + "github.com/go-viper/mapstructure/v2" +) + +// Format represents a string format. +// +// All implementations of Format provide a string representation and text +// marshaling/unmarshaling interface to be used by encoders (e.g. encoding/json). +type Format interface { + String() string + encoding.TextMarshaler + encoding.TextUnmarshaler +} + +// Registry is a registry of string formats, with a validation method. +type Registry interface { + Add(string, Format, Validator) bool + DelByName(string) bool + GetType(string) (reflect.Type, bool) + ContainsName(string) bool + Validates(string, string) bool + Parse(string, string) (any, error) + MapStructureHookFunc() mapstructure.DecodeHookFunc +} diff --git a/vendor/github.com/go-openapi/strfmt/mongo.go b/vendor/github.com/go-openapi/strfmt/mongo.go new file mode 100644 index 00000000000..641fed9b1a6 --- /dev/null +++ b/vendor/github.com/go-openapi/strfmt/mongo.go @@ -0,0 +1,646 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + +package strfmt + +import ( + "encoding/base64" + "encoding/binary" + "fmt" + "time" + + "github.com/oklog/ulid" + "go.mongodb.org/mongo-driver/bson" + "go.mongodb.org/mongo-driver/bson/bsontype" + bsonprim "go.mongodb.org/mongo-driver/bson/primitive" +) + +var ( + _ bson.Marshaler = Date{} + _ bson.Unmarshaler = &Date{} + _ bson.Marshaler = Base64{} + _ bson.Unmarshaler = &Base64{} + _ bson.Marshaler = Duration(0) + _ bson.Unmarshaler = (*Duration)(nil) + _ bson.Marshaler = DateTime{} + _ bson.Unmarshaler = &DateTime{} + _ bson.Marshaler = ULID{} + _ bson.Unmarshaler = &ULID{} + _ bson.Marshaler = URI("") + _ bson.Unmarshaler = (*URI)(nil) + _ bson.Marshaler = Email("") + _ bson.Unmarshaler = (*Email)(nil) + _ bson.Marshaler = Hostname("") + _ bson.Unmarshaler = (*Hostname)(nil) + _ bson.Marshaler = IPv4("") + _ bson.Unmarshaler = (*IPv4)(nil) + _ bson.Marshaler = IPv6("") + _ bson.Unmarshaler = (*IPv6)(nil) + _ bson.Marshaler = CIDR("") + _ bson.Unmarshaler = (*CIDR)(nil) + _ bson.Marshaler = MAC("") + _ bson.Unmarshaler = (*MAC)(nil) + _ bson.Marshaler = Password("") + _ bson.Unmarshaler = (*Password)(nil) + _ bson.Marshaler = UUID("") + _ bson.Unmarshaler = (*UUID)(nil) + _ bson.Marshaler = UUID3("") + _ bson.Unmarshaler = (*UUID3)(nil) + _ bson.Marshaler = UUID4("") + _ bson.Unmarshaler = (*UUID4)(nil) + _ bson.Marshaler = UUID5("") + _ bson.Unmarshaler = (*UUID5)(nil) + _ bson.Marshaler = UUID7("") + _ bson.Unmarshaler = (*UUID7)(nil) + _ bson.Marshaler = ISBN("") + _ bson.Unmarshaler = (*ISBN)(nil) + _ bson.Marshaler = ISBN10("") + _ bson.Unmarshaler = (*ISBN10)(nil) + _ bson.Marshaler = ISBN13("") + _ bson.Unmarshaler = (*ISBN13)(nil) + _ bson.Marshaler = CreditCard("") + _ bson.Unmarshaler = (*CreditCard)(nil) + _ bson.Marshaler = SSN("") + _ bson.Unmarshaler = (*SSN)(nil) + _ bson.Marshaler = HexColor("") + _ bson.Unmarshaler = (*HexColor)(nil) + _ bson.Marshaler = RGBColor("") + _ bson.Unmarshaler = (*RGBColor)(nil) + _ bson.Marshaler = ObjectId{} + _ bson.Unmarshaler = &ObjectId{} + + _ bson.ValueMarshaler = DateTime{} + _ bson.ValueUnmarshaler = &DateTime{} + _ bson.ValueMarshaler = ObjectId{} + _ bson.ValueUnmarshaler = &ObjectId{} +) + +const ( + millisec = 1000 + microsec = 1_000_000 + bsonDateTimeSize = 8 +) + +func (d Date) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": d.String()}) +} + +func (d *Date) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if data, ok := m["data"].(string); ok { + rd, err := time.ParseInLocation(RFC3339FullDate, data, DefaultTimeLocation) + if err != nil { + return err + } + *d = Date(rd) + return nil + } + + return fmt.Errorf("couldn't unmarshal bson bytes value as Date: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (b Base64) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": b.String()}) +} + +// UnmarshalBSON document into this value +func (b *Base64) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if bd, ok := m["data"].(string); ok { + vb, err := base64.StdEncoding.DecodeString(bd) + if err != nil { + return err + } + *b = Base64(vb) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as base64: %w", ErrFormat) +} + +func (d Duration) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": d.String()}) +} + +func (d *Duration) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if data, ok := m["data"].(string); ok { + rd, err := ParseDuration(data) + if err != nil { + return err + } + *d = Duration(rd) + return nil + } + + return fmt.Errorf("couldn't unmarshal bson bytes value as Date: %w", ErrFormat) +} + +// MarshalBSON renders the DateTime as a BSON document +func (t DateTime) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": t}) +} + +// UnmarshalBSON reads the DateTime from a BSON document +func (t *DateTime) UnmarshalBSON(data []byte) error { + var obj struct { + Data DateTime + } + + if err := bson.Unmarshal(data, &obj); err != nil { + return err + } + + *t = obj.Data + + return nil +} + +// MarshalBSONValue is an interface implemented by types that can marshal themselves +// into a BSON document represented as bytes. The bytes returned must be a valid +// BSON document if the error is nil. +// +// Marshals a DateTime as a bson.TypeDateTime, an int64 representing +// milliseconds since epoch. +func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { + // UnixNano cannot be used directly, the result of calling UnixNano on the zero + // Time is undefined. Thats why we use time.Nanosecond() instead. + + tNorm := NormalizeTimeForMarshal(time.Time(t)) + i64 := tNorm.Unix()*millisec + int64(tNorm.Nanosecond())/microsec + buf := make([]byte, bsonDateTimeSize) + binary.LittleEndian.PutUint64(buf, uint64(i64)) //nolint:gosec // it's okay to handle negative int64 this way + + return bson.TypeDateTime, buf, nil +} + +// UnmarshalBSONValue is an interface implemented by types that can unmarshal a +// BSON value representation of themselves. The BSON bytes and type can be +// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it +// wishes to retain the data after returning. +func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { + if tpe == bson.TypeNull { + *t = DateTime{} + return nil + } + + if len(data) != bsonDateTimeSize { + return fmt.Errorf("bson date field length not exactly %d bytes: %w", bsonDateTimeSize, ErrFormat) + } + + i64 := int64(binary.LittleEndian.Uint64(data)) //nolint:gosec // it's okay if we overflow and get a negative datetime + *t = DateTime(time.Unix(i64/millisec, i64%millisec*microsec)) + + return nil +} + +// MarshalBSON document from this value +func (u ULID) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *ULID) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + id, err := ulid.ParseStrict(ud) + if err != nil { + return fmt.Errorf("couldn't parse bson bytes as ULID: %w: %w", err, ErrFormat) + } + u.ULID = id + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as ULID: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u URI) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *URI) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = URI(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as uri: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (e Email) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": e.String()}) +} + +// UnmarshalBSON document into this value +func (e *Email) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *e = Email(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as email: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (h Hostname) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": h.String()}) +} + +// UnmarshalBSON document into this value +func (h *Hostname) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *h = Hostname(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as hostname: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u IPv4) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *IPv4) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = IPv4(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as ipv4: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u IPv6) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *IPv6) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = IPv6(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as ipv6: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u CIDR) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *CIDR) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = CIDR(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as CIDR: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u MAC) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *MAC) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = MAC(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as MAC: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (r Password) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": r.String()}) +} + +// UnmarshalBSON document into this value +func (r *Password) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *r = Password(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as Password: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u UUID) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *UUID) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = UUID(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as UUID: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u UUID3) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *UUID3) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = UUID3(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as UUID3: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u UUID4) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *UUID4) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = UUID4(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as UUID4: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u UUID5) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *UUID5) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = UUID5(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as UUID5: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u UUID7) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *UUID7) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = UUID7(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as UUID7: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u ISBN) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *ISBN) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = ISBN(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as ISBN: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u ISBN10) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *ISBN10) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = ISBN10(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as ISBN10: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u ISBN13) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *ISBN13) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = ISBN13(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as ISBN13: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u CreditCard) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *CreditCard) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = CreditCard(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as CreditCard: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (u SSN) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": u.String()}) +} + +// UnmarshalBSON document into this value +func (u *SSN) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *u = SSN(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as SSN: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (h HexColor) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": h.String()}) +} + +// UnmarshalBSON document into this value +func (h *HexColor) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *h = HexColor(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as HexColor: %w", ErrFormat) +} + +// MarshalBSON document from this value +func (r RGBColor) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": r.String()}) +} + +// UnmarshalBSON document into this value +func (r *RGBColor) UnmarshalBSON(data []byte) error { + var m bson.M + if err := bson.Unmarshal(data, &m); err != nil { + return err + } + + if ud, ok := m["data"].(string); ok { + *r = RGBColor(ud) + return nil + } + return fmt.Errorf("couldn't unmarshal bson bytes as RGBColor: %w", ErrFormat) +} + +// MarshalBSON renders the object id as a BSON document +func (id ObjectId) MarshalBSON() ([]byte, error) { + return bson.Marshal(bson.M{"data": bsonprim.ObjectID(id)}) +} + +// UnmarshalBSON reads the objectId from a BSON document +func (id *ObjectId) UnmarshalBSON(data []byte) error { + var obj struct { + Data bsonprim.ObjectID + } + if err := bson.Unmarshal(data, &obj); err != nil { + return err + } + *id = ObjectId(obj.Data) + return nil +} + +// MarshalBSONValue is an interface implemented by types that can marshal themselves +// into a BSON document represented as bytes. The bytes returned must be a valid +// BSON document if the error is nil. +func (id ObjectId) MarshalBSONValue() (bsontype.Type, []byte, error) { + oid := bsonprim.ObjectID(id) + return bson.TypeObjectID, oid[:], nil +} + +// UnmarshalBSONValue is an interface implemented by types that can unmarshal a +// BSON value representation of themselves. The BSON bytes and type can be +// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it +// wishes to retain the data after returning. +func (id *ObjectId) UnmarshalBSONValue(_ bsontype.Type, data []byte) error { + var oid bsonprim.ObjectID + copy(oid[:], data) + *id = ObjectId(oid) + return nil +} diff --git a/vendor/github.com/go-openapi/strfmt/time.go b/vendor/github.com/go-openapi/strfmt/time.go index 84e2412b937..8085aaf6965 100644 --- a/vendor/github.com/go-openapi/strfmt/time.go +++ b/vendor/github.com/go-openapi/strfmt/time.go @@ -1,31 +1,15 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package strfmt import ( "database/sql/driver" - "encoding/binary" "encoding/json" "fmt" "regexp" "strings" "time" - - "go.mongodb.org/mongo-driver/bson" - - "go.mongodb.org/mongo-driver/bson/bsontype" ) var ( @@ -178,7 +162,7 @@ func (t *DateTime) UnmarshalText(text []byte) error { } // Scan scans a DateTime value from database driver type. -func (t *DateTime) Scan(raw interface{}) error { +func (t *DateTime) Scan(raw any) error { // TODO: case int64: and case float64: ? switch v := raw.(type) { case []byte: @@ -224,69 +208,6 @@ func (t *DateTime) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON renders the DateTime as a BSON document -func (t DateTime) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": t}) -} - -// UnmarshalBSON reads the DateTime from a BSON document -func (t *DateTime) UnmarshalBSON(data []byte) error { - var obj struct { - Data DateTime - } - - if err := bson.Unmarshal(data, &obj); err != nil { - return err - } - - *t = obj.Data - - return nil -} - -const bsonDateLength = 8 - -// MarshalBSONValue is an interface implemented by types that can marshal themselves -// into a BSON document represented as bytes. The bytes returned must be a valid -// BSON document if the error is nil. -// -// Marshals a DateTime as a bsontype.DateTime, an int64 representing -// milliseconds since epoch. -func (t DateTime) MarshalBSONValue() (bsontype.Type, []byte, error) { - // UnixNano cannot be used directly, the result of calling UnixNano on the zero - // Time is undefined. That's why we use time.Nanosecond() instead. - tNorm := NormalizeTimeForMarshal(time.Time(t)) - i64 := tNorm.UnixMilli() - - buf := make([]byte, bsonDateLength) - // int64 -> uint64 conversion is safe here - binary.LittleEndian.PutUint64(buf, uint64(i64)) //nolint:gosec - - return bson.TypeDateTime, buf, nil -} - -// UnmarshalBSONValue is an interface implemented by types that can unmarshal a -// BSON value representation of themselves. The BSON bytes and type can be -// assumed to be valid. UnmarshalBSONValue must copy the BSON value bytes if it -// wishes to retain the data after returning. -func (t *DateTime) UnmarshalBSONValue(tpe bsontype.Type, data []byte) error { - if tpe == bson.TypeNull { - *t = DateTime{} - return nil - } - - if len(data) != bsonDateLength { - return fmt.Errorf("bson date field length not exactly 8 bytes: %w", ErrFormat) - } - - // it's ok to get negative values after conversion - i64 := int64(binary.LittleEndian.Uint64(data)) //nolint:gosec - // TODO: Use bsonprim.DateTime.Time() method - *t = DateTime(time.UnixMilli(i64)) - - return nil -} - // DeepCopyInto copies the receiver and writes its value into out. func (t *DateTime) DeepCopyInto(out *DateTime) { *out = *t diff --git a/vendor/github.com/go-openapi/strfmt/ulid.go b/vendor/github.com/go-openapi/strfmt/ulid.go index 434eb01baa5..85c5b53e6c7 100644 --- a/vendor/github.com/go-openapi/strfmt/ulid.go +++ b/vendor/github.com/go-openapi/strfmt/ulid.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + package strfmt import ( @@ -9,7 +12,6 @@ import ( "sync" "github.com/oklog/ulid" - "go.mongodb.org/mongo-driver/bson" ) // ULID represents a ulid string format @@ -28,12 +30,12 @@ type ULID struct { var ( ulidEntropyPool = sync.Pool{ - New: func() interface{} { + New: func() any { return cryptorand.Reader }, } - ULIDScanDefaultFunc = func(raw interface{}) (ULID, error) { + ULIDScanDefaultFunc = func(raw any) (ULID, error) { u := NewULIDZero() switch x := raw.(type) { case nil: @@ -111,7 +113,7 @@ func NewULID() (ULID, error) { } // GetULID returns underlying instance of ULID -func (u *ULID) GetULID() interface{} { +func (u *ULID) GetULID() any { return u.ULID } @@ -126,7 +128,7 @@ func (u *ULID) UnmarshalText(data []byte) error { // validation is performed lat } // Scan reads a value from a database driver -func (u *ULID) Scan(raw interface{}) error { +func (u *ULID) Scan(raw any) error { ul, err := ULIDScanOverrideFunc(raw) if err == nil { *u = ul @@ -165,29 +167,6 @@ func (u *ULID) UnmarshalJSON(data []byte) error { return nil } -// MarshalBSON document from this value -func (u ULID) MarshalBSON() ([]byte, error) { - return bson.Marshal(bson.M{"data": u.String()}) -} - -// UnmarshalBSON document into this value -func (u *ULID) UnmarshalBSON(data []byte) error { - var m bson.M - if err := bson.Unmarshal(data, &m); err != nil { - return err - } - - if ud, ok := m["data"].(string); ok { - id, err := ulid.ParseStrict(ud) - if err != nil { - return fmt.Errorf("couldn't parse bson bytes as ULID: %w: %w", err, ErrFormat) - } - u.ULID = id - return nil - } - return fmt.Errorf("couldn't unmarshal bson bytes as ULID: %w", ErrFormat) -} - // DeepCopyInto copies the receiver and writes its value into out. func (u *ULID) DeepCopyInto(out *ULID) { *out = *u diff --git a/vendor/github.com/go-openapi/swag/conv/convert.go b/vendor/github.com/go-openapi/swag/conv/convert.go index b9b8698543a..f205c391345 100644 --- a/vendor/github.com/go-openapi/swag/conv/convert.go +++ b/vendor/github.com/go-openapi/swag/conv/convert.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package conv diff --git a/vendor/github.com/go-openapi/swag/conv/convert_types.go b/vendor/github.com/go-openapi/swag/conv/convert_types.go index 423e8663f8e..cf4c6495ebc 100644 --- a/vendor/github.com/go-openapi/swag/conv/convert_types.go +++ b/vendor/github.com/go-openapi/swag/conv/convert_types.go @@ -1,20 +1,13 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package conv -// The original version of this file, eons ago, was taken from the aws go sdk +// Unlicensed credits (idea, concept) +// +// The idea to convert values to pointers and the other way around, was inspired, eons ago, by the aws go sdk. +// +// Nowadays, all sensible API sdk's expose a similar functionality. // Pointer returns a pointer to the value passed in. func Pointer[T any](v T) *T { diff --git a/vendor/github.com/go-openapi/swag/conv/doc.go b/vendor/github.com/go-openapi/swag/conv/doc.go index b02711f422c..1bd6ead6e2d 100644 --- a/vendor/github.com/go-openapi/swag/conv/doc.go +++ b/vendor/github.com/go-openapi/swag/conv/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 // Package conv exposes utilities to convert types. // diff --git a/vendor/github.com/go-openapi/swag/conv/format.go b/vendor/github.com/go-openapi/swag/conv/format.go index db7562a4a34..5b87b8e146b 100644 --- a/vendor/github.com/go-openapi/swag/conv/format.go +++ b/vendor/github.com/go-openapi/swag/conv/format.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package conv diff --git a/vendor/github.com/go-openapi/swag/conv/sizeof.go b/vendor/github.com/go-openapi/swag/conv/sizeof.go index 646f8be9aa3..49434655738 100644 --- a/vendor/github.com/go-openapi/swag/conv/sizeof.go +++ b/vendor/github.com/go-openapi/swag/conv/sizeof.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + package conv import "unsafe" diff --git a/vendor/github.com/go-openapi/swag/conv/type_constraints.go b/vendor/github.com/go-openapi/swag/conv/type_constraints.go index 3c61498361c..81135e827e5 100644 --- a/vendor/github.com/go-openapi/swag/conv/type_constraints.go +++ b/vendor/github.com/go-openapi/swag/conv/type_constraints.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package conv diff --git a/vendor/github.com/go-openapi/swag/jsonutils/README.md b/vendor/github.com/go-openapi/swag/jsonutils/README.md index c8d0cab67b6..d745cdb466e 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/README.md +++ b/vendor/github.com/go-openapi/swag/jsonutils/README.md @@ -78,7 +78,7 @@ Each adapter is an independent go module. Hence you'll pick its dependencies onl At this moment we provide: * `stdlib`: JSON adapter based on the standard library -* `easyjson`: JSON adapter based on the `github.com/mailru/easyyjson` +* `easyjson`: JSON adapter based on the `github.com/mailru/easyjson` The adapters provide the basic `Marshal` and `Unmarshal` capabilities, plus an implementation of the `MapSlice` pattern. diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go index dbb38c2f0cf..76d3898fca5 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 // Package adapters exposes a registry of adapters to multiple // JSON serialization libraries. diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go index 49649859af6..1fd43a1fad5 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/doc.go @@ -1,2 +1,5 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + // Package ifaces exposes all interfaces to work with adapters. package ifaces diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go index 4927d872dab..7805e5e5e39 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/ifaces.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + package ifaces import ( diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go index d1fe6a0adb6..2d6c69f4e60 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/ifaces/registry_iface.go @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 + package ifaces import ( diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go index b34a2305181..3062acaff26 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/registry.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package adapters diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go index 4df831b62dd..0213ff5c29f 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/adapter.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go index 2ff6b212fc8..5ea1b440425 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 // Package json implements an [ifaces.Adapter] using the standard library. package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go index 6d919199d03..b5aa1c7972e 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/lexer.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go index 18e6294e50e..54deef406f3 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/ordered_map.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go index 0f51d3a20cd..709b97c3046 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/pool.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go index 18bbc377450..fc8818694ea 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/register.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go index 38e9b6e034a..dc2325c1a30 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/writer.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package json diff --git a/vendor/github.com/go-openapi/swag/jsonutils/concat.go b/vendor/github.com/go-openapi/swag/jsonutils/concat.go index 049d4698bf8..2068503af05 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/concat.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/concat.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package jsonutils @@ -34,7 +23,7 @@ func init() { // ConcatJSON concatenates multiple json objects or arrays efficiently. // -// Note that [ConcatJSON] performs a very simmple (and fast) concatenation +// Note that [ConcatJSON] performs a very simple (and fast) concatenation // operation: it does not attempt to merge objects. func ConcatJSON(blobs ...[]byte) []byte { if len(blobs) == 0 { diff --git a/vendor/github.com/go-openapi/swag/jsonutils/doc.go b/vendor/github.com/go-openapi/swag/jsonutils/doc.go index 495ef834134..3926cc58d1b 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/doc.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 // Package jsonutils provides helpers to work with JSON. // diff --git a/vendor/github.com/go-openapi/swag/jsonutils/json.go b/vendor/github.com/go-openapi/swag/jsonutils/json.go index a33b89bd4d9..40753ce03fd 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/json.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/json.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package jsonutils diff --git a/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go index 931ce2559d8..38dd3e24442 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/ordered_map.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package jsonutils diff --git a/vendor/github.com/go-openapi/swag/typeutils/doc.go b/vendor/github.com/go-openapi/swag/typeutils/doc.go index 67e49d12ec5..66bed20dff0 100644 --- a/vendor/github.com/go-openapi/swag/typeutils/doc.go +++ b/vendor/github.com/go-openapi/swag/typeutils/doc.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 // Package typeutils exposes utilities to inspect generic types. package typeutils diff --git a/vendor/github.com/go-openapi/swag/typeutils/types.go b/vendor/github.com/go-openapi/swag/typeutils/types.go index f0ddd3cd3df..55487a673c4 100644 --- a/vendor/github.com/go-openapi/swag/typeutils/types.go +++ b/vendor/github.com/go-openapi/swag/typeutils/types.go @@ -1,16 +1,5 @@ -// Copyright 2015 go-swagger maintainers -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers +// SPDX-License-Identifier: Apache-2.0 package typeutils diff --git a/vendor/github.com/goccy/go-json/.codecov.yml b/vendor/github.com/goccy/go-json/.codecov.yml deleted file mode 100644 index e98134570c4..00000000000 --- a/vendor/github.com/goccy/go-json/.codecov.yml +++ /dev/null @@ -1,32 +0,0 @@ -codecov: - require_ci_to_pass: yes - -coverage: - precision: 2 - round: down - range: "70...100" - - status: - project: - default: - target: 70% - threshold: 2% - patch: off - changes: no - -parsers: - gcov: - branch_detection: - conditional: yes - loop: yes - method: no - macro: no - -comment: - layout: "header,diff" - behavior: default - require_changes: no - -ignore: - - internal/encoder/vm_color - - internal/encoder/vm_color_indent diff --git a/vendor/github.com/goccy/go-json/.gitignore b/vendor/github.com/goccy/go-json/.gitignore deleted file mode 100644 index 378283829cf..00000000000 --- a/vendor/github.com/goccy/go-json/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -cover.html -cover.out diff --git a/vendor/github.com/goccy/go-json/.golangci.yml b/vendor/github.com/goccy/go-json/.golangci.yml deleted file mode 100644 index 977accaa9f4..00000000000 --- a/vendor/github.com/goccy/go-json/.golangci.yml +++ /dev/null @@ -1,86 +0,0 @@ -run: - skip-files: - - encode_optype.go - - ".*_test\\.go$" - -linters-settings: - govet: - enable-all: true - disable: - - shadow - -linters: - enable-all: true - disable: - - dogsled - - dupl - - exhaustive - - exhaustivestruct - - errorlint - - forbidigo - - funlen - - gci - - gochecknoglobals - - gochecknoinits - - gocognit - - gocritic - - gocyclo - - godot - - godox - - goerr113 - - gofumpt - - gomnd - - gosec - - ifshort - - lll - - makezero - - nakedret - - nestif - - nlreturn - - paralleltest - - testpackage - - thelper - - wrapcheck - - interfacer - - lll - - nakedret - - nestif - - nlreturn - - testpackage - - wsl - - varnamelen - - nilnil - - ireturn - - govet - - forcetypeassert - - cyclop - - containedctx - - revive - - nosnakecase - - exhaustruct - - depguard - -issues: - exclude-rules: - # not needed - - path: /*.go - text: "ST1003: should not use underscores in package names" - linters: - - stylecheck - - path: /*.go - text: "don't use an underscore in package name" - linters: - - golint - - path: rtype.go - linters: - - golint - - stylecheck - - path: error.go - linters: - - staticcheck - - # Maximum issues count per one linter. Set to 0 to disable. Default is 50. - max-issues-per-linter: 0 - - # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. - max-same-issues: 0 diff --git a/vendor/github.com/goccy/go-json/CHANGELOG.md b/vendor/github.com/goccy/go-json/CHANGELOG.md deleted file mode 100644 index d09bb89c318..00000000000 --- a/vendor/github.com/goccy/go-json/CHANGELOG.md +++ /dev/null @@ -1,425 +0,0 @@ -# v0.10.2 - 2023/03/20 - -### New features - -* Support DebugDOT option for debugging encoder ( #440 ) - -### Fix bugs - -* Fix combination of embedding structure and omitempty option ( #442 ) - -# v0.10.1 - 2023/03/13 - -### Fix bugs - -* Fix checkptr error for array decoder ( #415 ) -* Fix added buffer size check when decoding key ( #430 ) -* Fix handling of anonymous fields other than struct ( #431 ) -* Fix to not optimize when lower conversion can't handle byte-by-byte ( #432 ) -* Fix a problem that MarshalIndent does not work when UnorderedMap is specified ( #435 ) -* Fix mapDecoder.DecodeStream() for empty objects containing whitespace ( #425 ) -* Fix an issue that could not set the correct NextField for fields in the embedded structure ( #438 ) - -# v0.10.0 - 2022/11/29 - -### New features - -* Support JSON Path ( #250 ) - -### Fix bugs - -* Fix marshaler for map's key ( #409 ) - -# v0.9.11 - 2022/08/18 - -### Fix bugs - -* Fix unexpected behavior when buffer ends with backslash ( #383 ) -* Fix stream decoding of escaped character ( #387 ) - -# v0.9.10 - 2022/07/15 - -### Fix bugs - -* Fix boundary exception of type caching ( #382 ) - -# v0.9.9 - 2022/07/15 - -### Fix bugs - -* Fix encoding of directed interface with typed nil ( #377 ) -* Fix embedded primitive type encoding using alias ( #378 ) -* Fix slice/array type encoding with types implementing MarshalJSON ( #379 ) -* Fix unicode decoding when the expected buffer state is not met after reading ( #380 ) - -# v0.9.8 - 2022/06/30 - -### Fix bugs - -* Fix decoding of surrogate-pair ( #365 ) -* Fix handling of embedded primitive type ( #366 ) -* Add validation of escape sequence for decoder ( #367 ) -* Fix stream tokenizing respecting UseNumber ( #369 ) -* Fix encoding when struct pointer type that implements Marshal JSON is embedded ( #375 ) - -### Improve performance - -* Improve performance of linkRecursiveCode ( #368 ) - -# v0.9.7 - 2022/04/22 - -### Fix bugs - -#### Encoder - -* Add filtering process for encoding on slow path ( #355 ) -* Fix encoding of interface{} with pointer type ( #363 ) - -#### Decoder - -* Fix map key decoder that implements UnmarshalJSON ( #353 ) -* Fix decoding of []uint8 type ( #361 ) - -### New features - -* Add DebugWith option for encoder ( #356 ) - -# v0.9.6 - 2022/03/22 - -### Fix bugs - -* Correct the handling of the minimum value of int type for decoder ( #344 ) -* Fix bugs of stream decoder's bufferSize ( #349 ) -* Add a guard to use typeptr more safely ( #351 ) - -### Improve decoder performance - -* Improve escapeString's performance ( #345 ) - -### Others - -* Update go version for CI ( #347 ) - -# v0.9.5 - 2022/03/04 - -### Fix bugs - -* Fix panic when decoding time.Time with context ( #328 ) -* Fix reading the next character in buffer to nul consideration ( #338 ) -* Fix incorrect handling on skipValue ( #341 ) - -### Improve decoder performance - -* Improve performance when a payload contains escape sequence ( #334 ) - -# v0.9.4 - 2022/01/21 - -* Fix IsNilForMarshaler for string type with omitempty ( #323 ) -* Fix the case where the embedded field is at the end ( #326 ) - -# v0.9.3 - 2022/01/14 - -* Fix logic of removing struct field for decoder ( #322 ) - -# v0.9.2 - 2022/01/14 - -* Add invalid decoder to delay type error judgment at decode ( #321 ) - -# v0.9.1 - 2022/01/11 - -* Fix encoding of MarshalText/MarshalJSON operation with head offset ( #319 ) - -# v0.9.0 - 2022/01/05 - -### New feature - -* Supports dynamic filtering of struct fields ( #314 ) - -### Improve encoding performance - -* Improve map encoding performance ( #310 ) -* Optimize encoding path for escaped string ( #311 ) -* Add encoding option for performance ( #312 ) - -### Fix bugs - -* Fix panic at encoding map value on 1.18 ( #310 ) -* Fix MarshalIndent for interface type ( #317 ) - -# v0.8.1 - 2021/12/05 - -* Fix operation conversion from PtrHead to Head in Recursive type ( #305 ) - -# v0.8.0 - 2021/12/02 - -* Fix embedded field conflict behavior ( #300 ) -* Refactor compiler for encoder ( #301 #302 ) - -# v0.7.10 - 2021/10/16 - -* Fix conversion from pointer to uint64 ( #294 ) - -# v0.7.9 - 2021/09/28 - -* Fix encoding of nil value about interface type that has method ( #291 ) - -# v0.7.8 - 2021/09/01 - -* Fix mapassign_faststr for indirect struct type ( #283 ) -* Fix encoding of not empty interface type ( #284 ) -* Fix encoding of empty struct interface type ( #286 ) - -# v0.7.7 - 2021/08/25 - -* Fix invalid utf8 on stream decoder ( #279 ) -* Fix buffer length bug on string stream decoder ( #280 ) - -Thank you @orisano !! - -# v0.7.6 - 2021/08/13 - -* Fix nil slice assignment ( #276 ) -* Improve error message ( #277 ) - -# v0.7.5 - 2021/08/12 - -* Fix encoding of embedded struct with tags ( #265 ) -* Fix encoding of embedded struct that isn't first field ( #272 ) -* Fix decoding of binary type with escaped char ( #273 ) - -# v0.7.4 - 2021/07/06 - -* Fix encoding of indirect layout structure ( #264 ) - -# v0.7.3 - 2021/06/29 - -* Fix encoding of pointer type in empty interface ( #262 ) - -# v0.7.2 - 2021/06/26 - -### Fix decoder - -* Add decoder for func type to fix decoding of nil function value ( #257 ) -* Fix stream decoding of []byte type ( #258 ) - -### Performance - -* Improve decoding performance of map[string]interface{} type ( use `mapassign_faststr` ) ( #256 ) -* Improve encoding performance of empty interface type ( remove recursive calling of `vm.Run` ) ( #259 ) - -### Benchmark - -* Add bytedance/sonic as benchmark target ( #254 ) - -# v0.7.1 - 2021/06/18 - -### Fix decoder - -* Fix error when unmarshal empty array ( #253 ) - -# v0.7.0 - 2021/06/12 - -### Support context for MarshalJSON and UnmarshalJSON ( #248 ) - -* json.MarshalContext(context.Context, interface{}, ...json.EncodeOption) ([]byte, error) -* json.NewEncoder(io.Writer).EncodeContext(context.Context, interface{}, ...json.EncodeOption) error -* json.UnmarshalContext(context.Context, []byte, interface{}, ...json.DecodeOption) error -* json.NewDecoder(io.Reader).DecodeContext(context.Context, interface{}) error - -```go -type MarshalerContext interface { - MarshalJSON(context.Context) ([]byte, error) -} - -type UnmarshalerContext interface { - UnmarshalJSON(context.Context, []byte) error -} -``` - -### Add DecodeFieldPriorityFirstWin option ( #242 ) - -In the default behavior, go-json, like encoding/json, will reflect the result of the last evaluation when a field with the same name exists. I've added new options to allow you to change this behavior. `json.DecodeFieldPriorityFirstWin` option reflects the result of the first evaluation if a field with the same name exists. This behavior has a performance advantage as it allows the subsequent strings to be skipped if all fields have been evaluated. - -### Fix encoder - -* Fix indent number contains recursive type ( #249 ) -* Fix encoding of using empty interface as map key ( #244 ) - -### Fix decoder - -* Fix decoding fields containing escaped characters ( #237 ) - -### Refactor - -* Move some tests to subdirectory ( #243 ) -* Refactor package layout for decoder ( #238 ) - -# v0.6.1 - 2021/06/02 - -### Fix encoder - -* Fix value of totalLength for encoding ( #236 ) - -# v0.6.0 - 2021/06/01 - -### Support Colorize option for encoding (#233) - -```go -b, err := json.MarshalWithOption(v, json.Colorize(json.DefaultColorScheme)) -if err != nil { - ... -} -fmt.Println(string(b)) // print colored json -``` - -### Refactor - -* Fix opcode layout - Adjust memory layout of the opcode to 128 bytes in a 64-bit environment ( #230 ) -* Refactor encode option ( #231 ) -* Refactor escape string ( #232 ) - -# v0.5.1 - 2021/5/20 - -### Optimization - -* Add type addrShift to enable bigger encoder/decoder cache ( #213 ) - -### Fix decoder - -* Keep original reference of slice element ( #229 ) - -### Refactor - -* Refactor Debug mode for encoding ( #226 ) -* Generate VM sources for encoding ( #227 ) -* Refactor validator for null/true/false for decoding ( #221 ) - -# v0.5.0 - 2021/5/9 - -### Supports using omitempty and string tags at the same time ( #216 ) - -### Fix decoder - -* Fix stream decoder for unicode char ( #215 ) -* Fix decoding of slice element ( #219 ) -* Fix calculating of buffer length for stream decoder ( #220 ) - -### Refactor - -* replace skipWhiteSpace goto by loop ( #212 ) - -# v0.4.14 - 2021/5/4 - -### Benchmark - -* Add valyala/fastjson to benchmark ( #193 ) -* Add benchmark task for CI ( #211 ) - -### Fix decoder - -* Fix decoding of slice with unmarshal json type ( #198 ) -* Fix decoding of null value for interface type that does not implement Unmarshaler ( #205 ) -* Fix decoding of null value to []byte by json.Unmarshal ( #206 ) -* Fix decoding of backslash char at the end of string ( #207 ) -* Fix stream decoder for null/true/false value ( #208 ) -* Fix stream decoder for slow reader ( #211 ) - -### Performance - -* If cap of slice is enough, reuse slice data for compatibility with encoding/json ( #200 ) - -# v0.4.13 - 2021/4/20 - -### Fix json.Compact and json.Indent - -* Support validation the input buffer for json.Compact and json.Indent ( #189 ) -* Optimize json.Compact and json.Indent ( improve memory footprint ) ( #190 ) - -# v0.4.12 - 2021/4/15 - -### Fix encoder - -* Fix unnecessary indent for empty slice type ( #181 ) -* Fix encoding of omitempty feature for the slice or interface type ( #183 ) -* Fix encoding custom types zero values with omitempty when marshaller exists ( #187 ) - -### Fix decoder - -* Fix decoder for invalid top level value ( #184 ) -* Fix decoder for invalid number value ( #185 ) - -# v0.4.11 - 2021/4/3 - -* Improve decoder performance for interface type - -# v0.4.10 - 2021/4/2 - -### Fix encoder - -* Fixed a bug when encoding slice and map containing recursive structures -* Fixed a logic to determine if indirect reference - -# v0.4.9 - 2021/3/29 - -### Add debug mode - -If you use `json.MarshalWithOption(v, json.Debug())` and `panic` occurred in `go-json`, produces debug information to console. - -### Support a new feature to compatible with encoding/json - -- invalid UTF-8 is coerced to valid UTF-8 ( without performance down ) - -### Fix encoder - -- Fixed handling of MarshalJSON of function type - -### Fix decoding of slice of pointer type - -If there is a pointer value, go-json will use it. (This behavior is necessary to achieve the ability to prioritize pre-filled values). However, since slices are reused internally, there was a bug that referred to the previous pointer value. Therefore, it is not necessary to refer to the pointer value in advance for the slice element, so we explicitly initialize slice element by `nil`. - -# v0.4.8 - 2021/3/21 - -### Reduce memory usage at compile time - -* go-json have used about 2GB of memory at compile time, but now it can compile with about less than 550MB. - -### Fix any encoder's bug - -* Add many test cases for encoder -* Fix composite type ( slice/array/map ) -* Fix pointer types -* Fix encoding of MarshalJSON or MarshalText or json.Number type - -### Refactor encoder - -* Change package layout for reducing memory usage at compile -* Remove anonymous and only operation -* Remove root property from encodeCompileContext and opcode - -### Fix CI - -* Add Go 1.16 -* Remove Go 1.13 -* Fix `make cover` task - -### Number/Delim/Token/RawMessage use the types defined in encoding/json by type alias - -# v0.4.7 - 2021/02/22 - -### Fix decoder - -* Fix decoding of deep recursive structure -* Fix decoding of embedded unexported pointer field -* Fix invalid test case -* Fix decoding of invalid value -* Fix decoding of prefilled value -* Fix not being able to return UnmarshalTypeError when it should be returned -* Fix decoding of null value -* Fix decoding of type of null string -* Use pre allocated pointer if exists it at decoding - -### Reduce memory usage at compile - -* Integrate int/int8/int16/int32/int64 and uint/uint8/uint16/uint32/uint64 operation to reduce memory usage at compile - -### Remove unnecessary optype diff --git a/vendor/github.com/goccy/go-json/Makefile b/vendor/github.com/goccy/go-json/Makefile deleted file mode 100644 index c030577dcf9..00000000000 --- a/vendor/github.com/goccy/go-json/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -PKG := github.com/goccy/go-json - -BIN_DIR := $(CURDIR)/bin -PKGS := $(shell go list ./... | grep -v internal/cmd|grep -v test) -COVER_PKGS := $(foreach pkg,$(PKGS),$(subst $(PKG),.,$(pkg))) - -COMMA := , -EMPTY := -SPACE := $(EMPTY) $(EMPTY) -COVERPKG_OPT := $(subst $(SPACE),$(COMMA),$(COVER_PKGS)) - -$(BIN_DIR): - @mkdir -p $(BIN_DIR) - -.PHONY: cover -cover: - go test -coverpkg=$(COVERPKG_OPT) -coverprofile=cover.out ./... - -.PHONY: cover-html -cover-html: cover - go tool cover -html=cover.out - -.PHONY: lint -lint: golangci-lint - $(BIN_DIR)/golangci-lint run - -golangci-lint: | $(BIN_DIR) - @{ \ - set -e; \ - GOLANGCI_LINT_TMP_DIR=$$(mktemp -d); \ - cd $$GOLANGCI_LINT_TMP_DIR; \ - go mod init tmp; \ - GOBIN=$(BIN_DIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.2; \ - rm -rf $$GOLANGCI_LINT_TMP_DIR; \ - } - -.PHONY: generate -generate: - go generate ./internal/... diff --git a/vendor/github.com/goccy/go-json/README.md b/vendor/github.com/goccy/go-json/README.md deleted file mode 100644 index 7bacc54f9cd..00000000000 --- a/vendor/github.com/goccy/go-json/README.md +++ /dev/null @@ -1,529 +0,0 @@ -# go-json - -![Go](https://github.com/goccy/go-json/workflows/Go/badge.svg) -[![GoDoc](https://godoc.org/github.com/goccy/go-json?status.svg)](https://pkg.go.dev/github.com/goccy/go-json?tab=doc) -[![codecov](https://codecov.io/gh/goccy/go-json/branch/master/graph/badge.svg)](https://codecov.io/gh/goccy/go-json) - -Fast JSON encoder/decoder compatible with encoding/json for Go - - - -# Roadmap - -``` -* version ( expected release date ) - -* v0.9.0 - | - | while maintaining compatibility with encoding/json, we will add convenient APIs - | - v -* v1.0.0 -``` - -We are accepting requests for features that will be implemented between v0.9.0 and v.1.0.0. -If you have the API you need, please submit your issue [here](https://github.com/goccy/go-json/issues). - -# Features - -- Drop-in replacement of `encoding/json` -- Fast ( See [Benchmark section](https://github.com/goccy/go-json#benchmarks) ) -- Flexible customization with options -- Coloring the encoded string -- Can propagate context.Context to `MarshalJSON` or `UnmarshalJSON` -- Can dynamically filter the fields of the structure type-safely - -# Installation - -``` -go get github.com/goccy/go-json -``` - -# How to use - -Replace import statement from `encoding/json` to `github.com/goccy/go-json` - -``` --import "encoding/json" -+import "github.com/goccy/go-json" -``` - -# JSON library comparison - -| name | encoder | decoder | compatible with `encoding/json` | -| :----: | :------: | :-----: | :-----------------------------: | -| encoding/json | yes | yes | N/A | -| [json-iterator/go](https://github.com/json-iterator/go) | yes | yes | partial | -| [easyjson](https://github.com/mailru/easyjson) | yes | yes | no | -| [gojay](https://github.com/francoispqt/gojay) | yes | yes | no | -| [segmentio/encoding/json](https://github.com/segmentio/encoding/tree/master/json) | yes | yes | partial | -| [jettison](https://github.com/wI2L/jettison) | yes | no | no | -| [simdjson-go](https://github.com/minio/simdjson-go) | no | yes | no | -| goccy/go-json | yes | yes | yes | - -- `json-iterator/go` isn't compatible with `encoding/json` in many ways (e.g. https://github.com/json-iterator/go/issues/229 ), but it hasn't been supported for a long time. -- `segmentio/encoding/json` is well supported for encoders, but some are not supported for decoder APIs such as `Token` ( streaming decode ) - -## Other libraries - -- [jingo](https://github.com/bet365/jingo) - -I tried the benchmark but it didn't work. -Also, it seems to panic when it receives an unexpected value because there is no error handling... - -- [ffjson](https://github.com/pquerna/ffjson) - -Benchmarking gave very slow results. -It seems that it is assumed that the user will use the buffer pool properly. -Also, development seems to have already stopped - -# Benchmarks - -``` -$ cd benchmarks -$ go test -bench . -``` - -## Encode - - - - -## Decode - - - - - - -# Fuzzing - -[go-json-fuzz](https://github.com/goccy/go-json-fuzz) is the repository for fuzzing tests. -If you run the test in this repository and find a bug, please commit to corpus to go-json-fuzz and report the issue to [go-json](https://github.com/goccy/go-json/issues). - -# How it works - -`go-json` is very fast in both encoding and decoding compared to other libraries. -It's easier to implement by using automatic code generation for performance or by using a dedicated interface, but `go-json` dares to stick to compatibility with `encoding/json` and is the simple interface. Despite this, we are developing with the aim of being the fastest library. - -Here, we explain the various speed-up techniques implemented by `go-json`. - -## Basic technique - -The techniques listed here are the ones used by most of the libraries listed above. - -### Buffer reuse - -Since the only value required for the result of `json.Marshal(interface{}) ([]byte, error)` is `[]byte`, the only value that must be allocated during encoding is the return value `[]byte` . - -Also, as the number of allocations increases, the performance will be affected, so the number of allocations should be kept as low as possible when creating `[]byte`. - -Therefore, there is a technique to reduce the number of times a new buffer must be allocated by reusing the buffer used for the previous encoding by using `sync.Pool`. - -Finally, you allocate a buffer that is as long as the resulting buffer and copy the contents into it, you only need to allocate the buffer once in theory. - -```go -type buffer struct { - data []byte -} - -var bufPool = sync.Pool{ - New: func() interface{} { - return &buffer{data: make([]byte, 0, 1024)} - }, -} - -buf := bufPool.Get().(*buffer) -data := encode(buf.data) // reuse buf.data - -newBuf := make([]byte, len(data)) -copy(newBuf, buf) - -buf.data = data -bufPool.Put(buf) -``` - -### Elimination of reflection - -As you know, the reflection operation is very slow. - -Therefore, using the fact that the address position where the type information is stored is fixed for each binary ( we call this `typeptr` ), -we can use the address in the type information to call a pre-built optimized process. - -For example, you can get the address to the type information from `interface{}` as follows and you can use that information to call a process that does not have reflection. - -To process without reflection, pass a pointer (`unsafe.Pointer`) to the value is stored. - -```go - -type emptyInterface struct { - typ unsafe.Pointer - ptr unsafe.Pointer -} - -var typeToEncoder = map[uintptr]func(unsafe.Pointer)([]byte, error){} - -func Marshal(v interface{}) ([]byte, error) { - iface := (*emptyInterface)(unsafe.Pointer(&v) - typeptr := uintptr(iface.typ) - if enc, exists := typeToEncoder[typeptr]; exists { - return enc(iface.ptr) - } - ... -} -``` - -※ In reality, `typeToEncoder` can be referenced by multiple goroutines, so exclusive control is required. - -## Unique speed-up technique - -## Encoder - -### Do not escape arguments of `Marshal` - -`json.Marshal` and `json.Unmarshal` receive `interface{}` value and they perform type determination dynamically to process. -In normal case, you need to use the `reflect` library to determine the type dynamically, but since `reflect.Type` is defined as `interface`, when you call the method of `reflect.Type`, The reflect's argument is escaped. - -Therefore, the arguments for `Marshal` and `Unmarshal` are always escaped to the heap. -However, `go-json` can use the feature of `reflect.Type` while avoiding escaping. - -`reflect.Type` is defined as `interface`, but in reality `reflect.Type` is implemented only by the structure `rtype` defined in the `reflect` package. -For this reason, to date `reflect.Type` is the same as `*reflect.rtype`. - -Therefore, by directly handling `*reflect.rtype`, which is an implementation of `reflect.Type`, it is possible to avoid escaping because it changes from `interface` to using `struct`. - -The technique for working with `*reflect.rtype` directly from `go-json` is implemented at [rtype.go](https://github.com/goccy/go-json/blob/master/internal/runtime/rtype.go) - -Also, the same technique is cut out as a library ( https://github.com/goccy/go-reflect ) - -Initially this feature was the default behavior of `go-json`. -But after careful testing, I found that I passed a large value to `json.Marshal()` and if the argument could not be assigned to the stack, it could not be properly escaped to the heap (a bug in the Go compiler). - -Therefore, this feature will be provided as an **optional** until this issue is resolved. - -To use it, add `NoEscape` like `MarshalNoEscape()` - -### Encoding using opcode sequence - -I explained that you can use `typeptr` to call a pre-built process from type information. - -In other libraries, this dedicated process is processed by making it an function calling like anonymous function, but function calls are inherently slow processes and should be avoided as much as possible. - -Therefore, `go-json` adopted the Instruction-based execution processing system, which is also used to implement virtual machines for programming language. - -If it is the first type to encode, create the opcode ( instruction ) sequence required for encoding. -From the second time onward, use `typeptr` to get the cached pre-built opcode sequence and encode it based on it. An example of the opcode sequence is shown below. - -```go -json.Marshal(struct{ - X int `json:"x"` - Y string `json:"y"` -}{X: 1, Y: "hello"}) -``` - -When encoding a structure like the one above, create a sequence of opcodes like this: - -``` -- opStructFieldHead ( `{` ) -- opStructFieldInt ( `"x": 1,` ) -- opStructFieldString ( `"y": "hello"` ) -- opStructEnd ( `}` ) -- opEnd -``` - -※ When processing each operation, write the letters on the right. - -In addition, each opcode is managed by the following structure ( -Pseudo code ). - -```go -type opType int -const ( - opStructFieldHead opType = iota - opStructFieldInt - opStructFieldStirng - opStructEnd - opEnd -) -type opcode struct { - op opType - key []byte - next *opcode -} -``` - -The process of encoding using the opcode sequence is roughly implemented as follows. - -```go -func encode(code *opcode, b []byte, p unsafe.Pointer) ([]byte, error) { - for { - switch code.op { - case opStructFieldHead: - b = append(b, '{') - code = code.next - case opStructFieldInt: - b = append(b, code.key...) - b = appendInt((*int)(unsafe.Pointer(uintptr(p)+code.offset))) - code = code.next - case opStructFieldString: - b = append(b, code.key...) - b = appendString((*string)(unsafe.Pointer(uintptr(p)+code.offset))) - code = code.next - case opStructEnd: - b = append(b, '}') - code = code.next - case opEnd: - goto END - } - } -END: - return b, nil -} -``` - -In this way, the huge `switch-case` is used to encode by manipulating the linked list opcodes to avoid unnecessary function calls. - -### Opcode sequence optimization - -One of the advantages of encoding using the opcode sequence is the ease of optimization. -The opcode sequence mentioned above is actually converted into the following optimized operations and used. - -``` -- opStructFieldHeadInt ( `{"x": 1,` ) -- opStructEndString ( `"y": "hello"}` ) -- opEnd -``` - -It has been reduced from 5 opcodes to 3 opcodes ! -Reducing the number of opcodees means reducing the number of branches with `switch-case`. -In other words, the closer the number of operations is to 1, the faster the processing can be performed. - -In `go-json`, optimization to reduce the number of opcodes itself like the above and it speeds up by preparing opcodes with optimized paths. - -### Change recursive call from CALL to JMP - -Recursive processing is required during encoding if the type is defined recursively as follows: - -```go -type T struct { - X int - U *U -} - -type U struct { - T *T -} - -b, err := json.Marshal(&T{ - X: 1, - U: &U{ - T: &T{ - X: 2, - }, - }, -}) -fmt.Println(string(b)) // {"X":1,"U":{"T":{"X":2,"U":null}}} -``` - -In `go-json`, recursive processing is processed by the operation type of ` opStructFieldRecursive`. - -In this operation, after acquiring the opcode sequence used for recursive processing, the function is **not** called recursively as it is, but the necessary values ​​are saved by itself and implemented by moving to the next operation. - -The technique of implementing recursive processing with the `JMP` operation while avoiding the `CALL` operation is a famous technique for implementing a high-speed virtual machine. - -For more details, please refer to [the article](https://engineering.mercari.com/blog/entry/1599563768-081104c850) ( but Japanese only ). - -### Dispatch by typeptr from map to slice - -When retrieving the data cached from the type information by `typeptr`, we usually use map. -Map requires exclusive control, so use `sync.Map` for a naive implementation. - -However, this is slow, so it's a good idea to use the `atomic` package for exclusive control as implemented by `segmentio/encoding/json` ( https://github.com/segmentio/encoding/blob/master/json/codec.go#L41-L55 ). - -This implementation slows down the set instead of speeding up the get, but it works well because of the nature of the library, it encodes much more for the same type. - -However, as a result of profiling, I noticed that `runtime.mapaccess2` accounts for a significant percentage of the execution time. So I thought if I could change the lookup from map to slice. - -There is an API named `typelinks` defined in the `runtime` package that the `reflect` package uses internally. -This allows you to get all the type information defined in the binary at runtime. - -The fact that all type information can be acquired means that by constructing slices in advance with the acquired total number of type information, it is possible to look up with the value of `typeptr` without worrying about out-of-range access. - -However, if there is too much type information, it will use a lot of memory, so by default we will only use this optimization if the slice size fits within **2Mib** . - -If this approach is not available, it will fall back to the `atomic` based process described above. - -If you want to know more, please refer to the implementation [here](https://github.com/goccy/go-json/blob/master/internal/runtime/type.go#L36-L100) - -## Decoder - -### Dispatch by typeptr from map to slice - -Like the encoder, the decoder also uses typeptr to call the dedicated process. - -### Faster termination character inspection using NUL character - -In order to decode, you have to traverse the input buffer character by position. -At that time, if you check whether the buffer has reached the end, it will be very slow. - -`buf` : `[]byte` type variable. holds the string passed to the decoder -`cursor` : `int64` type variable. holds the current read position - -```go -buflen := len(buf) -for ; cursor < buflen; cursor++ { // compare cursor and buflen at all times, it is so slow. - switch buf[cursor] { - case ' ', '\n', '\r', '\t': - } -} -``` - -Therefore, by adding the `NUL` (`\000`) character to the end of the read buffer as shown below, it is possible to check the termination character at the same time as other characters. - -```go -for { - switch buf[cursor] { - case ' ', '\n', '\r', '\t': - case '\000': - return nil - } - cursor++ -} -``` - -### Use Boundary Check Elimination - -Due to the `NUL` character optimization, the Go compiler does a boundary check every time, even though `buf[cursor]` does not cause out-of-range access. - -Therefore, `go-json` eliminates boundary check by fetching characters for hotspot by pointer operation. For example, the following code. - -```go -func char(ptr unsafe.Pointer, offset int64) byte { - return *(*byte)(unsafe.Pointer(uintptr(ptr) + uintptr(offset))) -} - -p := (*sliceHeader)(&unsafe.Pointer(buf)).data -for { - switch char(p, cursor) { - case ' ', '\n', '\r', '\t': - case '\000': - return nil - } - cursor++ -} -``` - -### Checking the existence of fields of struct using Bitmaps - -I found by the profiling result, in the struct decode, lookup process for field was taking a long time. - -For example, consider decoding a string like `{"a":1,"b":2,"c":3}` into the following structure: - -```go -type T struct { - A int `json:"a"` - B int `json:"b"` - C int `json:"c"` -} -``` - -At this time, it was found that it takes a lot of time to acquire the decoding process corresponding to the field from the field name as shown below during the decoding process. - -```go -fieldName := decodeKey(buf, cursor) // "a" or "b" or "c" -decoder, exists := fieldToDecoderMap[fieldName] // so slow -if exists { - decoder(buf, cursor) -} else { - skipValue(buf, cursor) -} -``` - -To improve this process, `json-iterator/go` is optimized so that it can be branched by switch-case when the number of fields in the structure is 10 or less (switch-case is faster than map). However, there is a risk of hash collision because the value hashed by the FNV algorithm is used for conditional branching. Also, `gojay` processes this part at high speed by letting the library user yourself write `switch-case`. - - -`go-json` considers and implements a new approach that is different from these. I call this **bitmap field optimization**. - -The range of values ​​per character can be represented by `[256]byte`. Also, if the number of fields in the structure is 8 or less, `int8` type can represent the state of each field. -In other words, it has the following structure. - -- Base ( 8bit ): `00000000` -- Key "a": `00000001` ( assign key "a" to the first bit ) -- Key "b": `00000010` ( assign key "b" to the second bit ) -- Key "c": `00000100` ( assign key "c" to the third bit ) - -Bitmap structure is the following - -``` - | key index(0) | ------------------------- - 0 | 00000000 | - 1 | 00000000 | -~~ | | -97 (a) | 00000001 | -98 (b) | 00000010 | -99 (c) | 00000100 | -~~ | | -255 | 00000000 | -``` - -You can think of this as a Bitmap with a height of `256` and a width of the maximum string length in the field name. -In other words, it can be represented by the following type . - -```go -[maxFieldKeyLength][256]int8 -``` - -When decoding a field character, check whether the corresponding character exists by referring to the pre-built bitmap like the following. - -```go -var curBit int8 = math.MaxInt8 // 11111111 - -c := char(buf, cursor) -bit := bitmap[keyIdx][c] -curBit &= bit -if curBit == 0 { - // not found field -} -``` - -If `curBit` is not `0` until the end of the field string, then the string is -You may have hit one of the fields. -But the possibility is that if the decoded string is shorter than the field string, you will get a false hit. - -- input: `{"a":1}` -```go -type T struct { - X int `json:"abc"` -} -``` -※ Since `a` is shorter than `abc`, it can decode to the end of the field character without `curBit` being 0. - -Rest assured. In this case, it doesn't matter because you can tell if you hit by comparing the string length of `a` with the string length of `abc`. - -Finally, calculate the position of the bit where `1` is set and get the corresponding value, and you're done. - -Using this technique, field lookups are possible with only bitwise operations and access to slices. - -`go-json` uses a similar technique for fields with 9 or more and 16 or less fields. At this time, Bitmap is constructed as `[maxKeyLen][256]int16` type. - -Currently, this optimization is not performed when the maximum length of the field name is long (specifically, 64 bytes or more) in addition to the limitation of the number of fields from the viewpoint of saving memory usage. - -### Others - -I have done a lot of other optimizations. I will find time to write about them. If you have any questions about what's written here or other optimizations, please visit the `#go-json` channel on `gophers.slack.com` . - -## Reference - -Regarding the story of go-json, there are the following articles in Japanese only. - -- https://speakerdeck.com/goccy/zui-su-falsejsonraiburariwoqiu-mete -- https://engineering.mercari.com/blog/entry/1599563768-081104c850/ - -# Looking for Sponsors - -I'm looking for sponsors this library. This library is being developed as a personal project in my spare time. If you want a quick response or problem resolution when using this library in your project, please register as a [sponsor](https://github.com/sponsors/goccy). I will cooperate as much as possible. Of course, this library is developed as an MIT license, so you can use it freely for free. - -# License - -MIT diff --git a/vendor/github.com/goccy/go-json/color.go b/vendor/github.com/goccy/go-json/color.go deleted file mode 100644 index e80b22b4869..00000000000 --- a/vendor/github.com/goccy/go-json/color.go +++ /dev/null @@ -1,68 +0,0 @@ -package json - -import ( - "fmt" - - "github.com/goccy/go-json/internal/encoder" -) - -type ( - ColorFormat = encoder.ColorFormat - ColorScheme = encoder.ColorScheme -) - -const escape = "\x1b" - -type colorAttr int - -//nolint:deadcode,varcheck -const ( - fgBlackColor colorAttr = iota + 30 - fgRedColor - fgGreenColor - fgYellowColor - fgBlueColor - fgMagentaColor - fgCyanColor - fgWhiteColor -) - -//nolint:deadcode,varcheck -const ( - fgHiBlackColor colorAttr = iota + 90 - fgHiRedColor - fgHiGreenColor - fgHiYellowColor - fgHiBlueColor - fgHiMagentaColor - fgHiCyanColor - fgHiWhiteColor -) - -func createColorFormat(attr colorAttr) ColorFormat { - return ColorFormat{ - Header: wrapColor(attr), - Footer: resetColor(), - } -} - -func wrapColor(attr colorAttr) string { - return fmt.Sprintf("%s[%dm", escape, attr) -} - -func resetColor() string { - return wrapColor(colorAttr(0)) -} - -var ( - DefaultColorScheme = &ColorScheme{ - Int: createColorFormat(fgHiMagentaColor), - Uint: createColorFormat(fgHiMagentaColor), - Float: createColorFormat(fgHiMagentaColor), - Bool: createColorFormat(fgHiYellowColor), - String: createColorFormat(fgHiGreenColor), - Binary: createColorFormat(fgHiRedColor), - ObjectKey: createColorFormat(fgHiCyanColor), - Null: createColorFormat(fgBlueColor), - } -) diff --git a/vendor/github.com/goccy/go-json/decode.go b/vendor/github.com/goccy/go-json/decode.go deleted file mode 100644 index 74c6ac3bcad..00000000000 --- a/vendor/github.com/goccy/go-json/decode.go +++ /dev/null @@ -1,263 +0,0 @@ -package json - -import ( - "context" - "fmt" - "io" - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/decoder" - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type Decoder struct { - s *decoder.Stream -} - -const ( - nul = '\000' -) - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -func unmarshal(data []byte, v interface{}, optFuncs ...DecodeOptionFunc) error { - src := make([]byte, len(data)+1) // append nul byte to the end - copy(src, data) - - header := (*emptyInterface)(unsafe.Pointer(&v)) - - if err := validateType(header.typ, uintptr(header.ptr)); err != nil { - return err - } - dec, err := decoder.CompileToGetDecoder(header.typ) - if err != nil { - return err - } - ctx := decoder.TakeRuntimeContext() - ctx.Buf = src - ctx.Option.Flags = 0 - for _, optFunc := range optFuncs { - optFunc(ctx.Option) - } - cursor, err := dec.Decode(ctx, 0, 0, header.ptr) - if err != nil { - decoder.ReleaseRuntimeContext(ctx) - return err - } - decoder.ReleaseRuntimeContext(ctx) - return validateEndBuf(src, cursor) -} - -func unmarshalContext(ctx context.Context, data []byte, v interface{}, optFuncs ...DecodeOptionFunc) error { - src := make([]byte, len(data)+1) // append nul byte to the end - copy(src, data) - - header := (*emptyInterface)(unsafe.Pointer(&v)) - - if err := validateType(header.typ, uintptr(header.ptr)); err != nil { - return err - } - dec, err := decoder.CompileToGetDecoder(header.typ) - if err != nil { - return err - } - rctx := decoder.TakeRuntimeContext() - rctx.Buf = src - rctx.Option.Flags = 0 - rctx.Option.Flags |= decoder.ContextOption - rctx.Option.Context = ctx - for _, optFunc := range optFuncs { - optFunc(rctx.Option) - } - cursor, err := dec.Decode(rctx, 0, 0, header.ptr) - if err != nil { - decoder.ReleaseRuntimeContext(rctx) - return err - } - decoder.ReleaseRuntimeContext(rctx) - return validateEndBuf(src, cursor) -} - -var ( - pathDecoder = decoder.NewPathDecoder() -) - -func extractFromPath(path *Path, data []byte, optFuncs ...DecodeOptionFunc) ([][]byte, error) { - if path.path.RootSelectorOnly { - return [][]byte{data}, nil - } - src := make([]byte, len(data)+1) // append nul byte to the end - copy(src, data) - - ctx := decoder.TakeRuntimeContext() - ctx.Buf = src - ctx.Option.Flags = 0 - ctx.Option.Flags |= decoder.PathOption - ctx.Option.Path = path.path - for _, optFunc := range optFuncs { - optFunc(ctx.Option) - } - paths, cursor, err := pathDecoder.DecodePath(ctx, 0, 0) - if err != nil { - decoder.ReleaseRuntimeContext(ctx) - return nil, err - } - decoder.ReleaseRuntimeContext(ctx) - if err := validateEndBuf(src, cursor); err != nil { - return nil, err - } - return paths, nil -} - -func unmarshalNoEscape(data []byte, v interface{}, optFuncs ...DecodeOptionFunc) error { - src := make([]byte, len(data)+1) // append nul byte to the end - copy(src, data) - - header := (*emptyInterface)(unsafe.Pointer(&v)) - - if err := validateType(header.typ, uintptr(header.ptr)); err != nil { - return err - } - dec, err := decoder.CompileToGetDecoder(header.typ) - if err != nil { - return err - } - - ctx := decoder.TakeRuntimeContext() - ctx.Buf = src - ctx.Option.Flags = 0 - for _, optFunc := range optFuncs { - optFunc(ctx.Option) - } - cursor, err := dec.Decode(ctx, 0, 0, noescape(header.ptr)) - if err != nil { - decoder.ReleaseRuntimeContext(ctx) - return err - } - decoder.ReleaseRuntimeContext(ctx) - return validateEndBuf(src, cursor) -} - -func validateEndBuf(src []byte, cursor int64) error { - for { - switch src[cursor] { - case ' ', '\t', '\n', '\r': - cursor++ - continue - case nul: - return nil - } - return errors.ErrSyntax( - fmt.Sprintf("invalid character '%c' after top-level value", src[cursor]), - cursor+1, - ) - } -} - -//nolint:staticcheck -//go:nosplit -func noescape(p unsafe.Pointer) unsafe.Pointer { - x := uintptr(p) - return unsafe.Pointer(x ^ 0) -} - -func validateType(typ *runtime.Type, p uintptr) error { - if typ == nil || typ.Kind() != reflect.Ptr || p == 0 { - return &InvalidUnmarshalError{Type: runtime.RType2Type(typ)} - } - return nil -} - -// NewDecoder returns a new decoder that reads from r. -// -// The decoder introduces its own buffering and may -// read data from r beyond the JSON values requested. -func NewDecoder(r io.Reader) *Decoder { - s := decoder.NewStream(r) - return &Decoder{ - s: s, - } -} - -// Buffered returns a reader of the data remaining in the Decoder's -// buffer. The reader is valid until the next call to Decode. -func (d *Decoder) Buffered() io.Reader { - return d.s.Buffered() -} - -// Decode reads the next JSON-encoded value from its -// input and stores it in the value pointed to by v. -// -// See the documentation for Unmarshal for details about -// the conversion of JSON into a Go value. -func (d *Decoder) Decode(v interface{}) error { - return d.DecodeWithOption(v) -} - -// DecodeContext reads the next JSON-encoded value from its -// input and stores it in the value pointed to by v with context.Context. -func (d *Decoder) DecodeContext(ctx context.Context, v interface{}) error { - d.s.Option.Flags |= decoder.ContextOption - d.s.Option.Context = ctx - return d.DecodeWithOption(v) -} - -func (d *Decoder) DecodeWithOption(v interface{}, optFuncs ...DecodeOptionFunc) error { - header := (*emptyInterface)(unsafe.Pointer(&v)) - typ := header.typ - ptr := uintptr(header.ptr) - typeptr := uintptr(unsafe.Pointer(typ)) - // noescape trick for header.typ ( reflect.*rtype ) - copiedType := *(**runtime.Type)(unsafe.Pointer(&typeptr)) - - if err := validateType(copiedType, ptr); err != nil { - return err - } - - dec, err := decoder.CompileToGetDecoder(typ) - if err != nil { - return err - } - if err := d.s.PrepareForDecode(); err != nil { - return err - } - s := d.s - for _, optFunc := range optFuncs { - optFunc(s.Option) - } - if err := dec.DecodeStream(s, 0, header.ptr); err != nil { - return err - } - s.Reset() - return nil -} - -func (d *Decoder) More() bool { - return d.s.More() -} - -func (d *Decoder) Token() (Token, error) { - return d.s.Token() -} - -// DisallowUnknownFields causes the Decoder to return an error when the destination -// is a struct and the input contains object keys which do not match any -// non-ignored, exported fields in the destination. -func (d *Decoder) DisallowUnknownFields() { - d.s.DisallowUnknownFields = true -} - -func (d *Decoder) InputOffset() int64 { - return d.s.TotalOffset() -} - -// UseNumber causes the Decoder to unmarshal a number into an interface{} as a -// Number instead of as a float64. -func (d *Decoder) UseNumber() { - d.s.UseNumber = true -} diff --git a/vendor/github.com/goccy/go-json/docker-compose.yml b/vendor/github.com/goccy/go-json/docker-compose.yml deleted file mode 100644 index db40c79ad5d..00000000000 --- a/vendor/github.com/goccy/go-json/docker-compose.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '2' -services: - go-json: - image: golang:1.18 - volumes: - - '.:/go/src/go-json' - deploy: - resources: - limits: - memory: 620M - working_dir: /go/src/go-json - command: | - sh -c "go test -c . && ls go-json.test" diff --git a/vendor/github.com/goccy/go-json/encode.go b/vendor/github.com/goccy/go-json/encode.go deleted file mode 100644 index c5173825a95..00000000000 --- a/vendor/github.com/goccy/go-json/encode.go +++ /dev/null @@ -1,326 +0,0 @@ -package json - -import ( - "context" - "io" - "os" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/encoder/vm" - "github.com/goccy/go-json/internal/encoder/vm_color" - "github.com/goccy/go-json/internal/encoder/vm_color_indent" - "github.com/goccy/go-json/internal/encoder/vm_indent" -) - -// An Encoder writes JSON values to an output stream. -type Encoder struct { - w io.Writer - enabledIndent bool - enabledHTMLEscape bool - prefix string - indentStr string -} - -// NewEncoder returns a new encoder that writes to w. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{w: w, enabledHTMLEscape: true} -} - -// Encode writes the JSON encoding of v to the stream, followed by a newline character. -// -// See the documentation for Marshal for details about the conversion of Go values to JSON. -func (e *Encoder) Encode(v interface{}) error { - return e.EncodeWithOption(v) -} - -// EncodeWithOption call Encode with EncodeOption. -func (e *Encoder) EncodeWithOption(v interface{}, optFuncs ...EncodeOptionFunc) error { - ctx := encoder.TakeRuntimeContext() - ctx.Option.Flag = 0 - - err := e.encodeWithOption(ctx, v, optFuncs...) - - encoder.ReleaseRuntimeContext(ctx) - return err -} - -// EncodeContext call Encode with context.Context and EncodeOption. -func (e *Encoder) EncodeContext(ctx context.Context, v interface{}, optFuncs ...EncodeOptionFunc) error { - rctx := encoder.TakeRuntimeContext() - rctx.Option.Flag = 0 - rctx.Option.Flag |= encoder.ContextOption - rctx.Option.Context = ctx - - err := e.encodeWithOption(rctx, v, optFuncs...) //nolint: contextcheck - - encoder.ReleaseRuntimeContext(rctx) - return err -} - -func (e *Encoder) encodeWithOption(ctx *encoder.RuntimeContext, v interface{}, optFuncs ...EncodeOptionFunc) error { - if e.enabledHTMLEscape { - ctx.Option.Flag |= encoder.HTMLEscapeOption - } - ctx.Option.Flag |= encoder.NormalizeUTF8Option - ctx.Option.DebugOut = os.Stdout - for _, optFunc := range optFuncs { - optFunc(ctx.Option) - } - var ( - buf []byte - err error - ) - if e.enabledIndent { - buf, err = encodeIndent(ctx, v, e.prefix, e.indentStr) - } else { - buf, err = encode(ctx, v) - } - if err != nil { - return err - } - if e.enabledIndent { - buf = buf[:len(buf)-2] - } else { - buf = buf[:len(buf)-1] - } - buf = append(buf, '\n') - if _, err := e.w.Write(buf); err != nil { - return err - } - return nil -} - -// SetEscapeHTML specifies whether problematic HTML characters should be escaped inside JSON quoted strings. -// The default behavior is to escape &, <, and > to \u0026, \u003c, and \u003e to avoid certain safety problems that can arise when embedding JSON in HTML. -// -// In non-HTML settings where the escaping interferes with the readability of the output, SetEscapeHTML(false) disables this behavior. -func (e *Encoder) SetEscapeHTML(on bool) { - e.enabledHTMLEscape = on -} - -// SetIndent instructs the encoder to format each subsequent encoded value as if indented by the package-level function Indent(dst, src, prefix, indent). -// Calling SetIndent("", "") disables indentation. -func (e *Encoder) SetIndent(prefix, indent string) { - if prefix == "" && indent == "" { - e.enabledIndent = false - return - } - e.prefix = prefix - e.indentStr = indent - e.enabledIndent = true -} - -func marshalContext(ctx context.Context, v interface{}, optFuncs ...EncodeOptionFunc) ([]byte, error) { - rctx := encoder.TakeRuntimeContext() - rctx.Option.Flag = 0 - rctx.Option.Flag = encoder.HTMLEscapeOption | encoder.NormalizeUTF8Option | encoder.ContextOption - rctx.Option.Context = ctx - for _, optFunc := range optFuncs { - optFunc(rctx.Option) - } - - buf, err := encode(rctx, v) //nolint: contextcheck - if err != nil { - encoder.ReleaseRuntimeContext(rctx) - return nil, err - } - - // this line exists to escape call of `runtime.makeslicecopy` . - // if use `make([]byte, len(buf)-1)` and `copy(copied, buf)`, - // dst buffer size and src buffer size are differrent. - // in this case, compiler uses `runtime.makeslicecopy`, but it is slow. - buf = buf[:len(buf)-1] - copied := make([]byte, len(buf)) - copy(copied, buf) - - encoder.ReleaseRuntimeContext(rctx) - return copied, nil -} - -func marshal(v interface{}, optFuncs ...EncodeOptionFunc) ([]byte, error) { - ctx := encoder.TakeRuntimeContext() - - ctx.Option.Flag = 0 - ctx.Option.Flag |= (encoder.HTMLEscapeOption | encoder.NormalizeUTF8Option) - for _, optFunc := range optFuncs { - optFunc(ctx.Option) - } - - buf, err := encode(ctx, v) - if err != nil { - encoder.ReleaseRuntimeContext(ctx) - return nil, err - } - - // this line exists to escape call of `runtime.makeslicecopy` . - // if use `make([]byte, len(buf)-1)` and `copy(copied, buf)`, - // dst buffer size and src buffer size are differrent. - // in this case, compiler uses `runtime.makeslicecopy`, but it is slow. - buf = buf[:len(buf)-1] - copied := make([]byte, len(buf)) - copy(copied, buf) - - encoder.ReleaseRuntimeContext(ctx) - return copied, nil -} - -func marshalNoEscape(v interface{}) ([]byte, error) { - ctx := encoder.TakeRuntimeContext() - - ctx.Option.Flag = 0 - ctx.Option.Flag |= (encoder.HTMLEscapeOption | encoder.NormalizeUTF8Option) - - buf, err := encodeNoEscape(ctx, v) - if err != nil { - encoder.ReleaseRuntimeContext(ctx) - return nil, err - } - - // this line exists to escape call of `runtime.makeslicecopy` . - // if use `make([]byte, len(buf)-1)` and `copy(copied, buf)`, - // dst buffer size and src buffer size are differrent. - // in this case, compiler uses `runtime.makeslicecopy`, but it is slow. - buf = buf[:len(buf)-1] - copied := make([]byte, len(buf)) - copy(copied, buf) - - encoder.ReleaseRuntimeContext(ctx) - return copied, nil -} - -func marshalIndent(v interface{}, prefix, indent string, optFuncs ...EncodeOptionFunc) ([]byte, error) { - ctx := encoder.TakeRuntimeContext() - - ctx.Option.Flag = 0 - ctx.Option.Flag |= (encoder.HTMLEscapeOption | encoder.NormalizeUTF8Option | encoder.IndentOption) - for _, optFunc := range optFuncs { - optFunc(ctx.Option) - } - - buf, err := encodeIndent(ctx, v, prefix, indent) - if err != nil { - encoder.ReleaseRuntimeContext(ctx) - return nil, err - } - - buf = buf[:len(buf)-2] - copied := make([]byte, len(buf)) - copy(copied, buf) - - encoder.ReleaseRuntimeContext(ctx) - return copied, nil -} - -func encode(ctx *encoder.RuntimeContext, v interface{}) ([]byte, error) { - b := ctx.Buf[:0] - if v == nil { - b = encoder.AppendNull(ctx, b) - b = encoder.AppendComma(ctx, b) - return b, nil - } - header := (*emptyInterface)(unsafe.Pointer(&v)) - typ := header.typ - - typeptr := uintptr(unsafe.Pointer(typ)) - codeSet, err := encoder.CompileToGetCodeSet(ctx, typeptr) - if err != nil { - return nil, err - } - - p := uintptr(header.ptr) - ctx.Init(p, codeSet.CodeLength) - ctx.KeepRefs = append(ctx.KeepRefs, header.ptr) - - buf, err := encodeRunCode(ctx, b, codeSet) - if err != nil { - return nil, err - } - ctx.Buf = buf - return buf, nil -} - -func encodeNoEscape(ctx *encoder.RuntimeContext, v interface{}) ([]byte, error) { - b := ctx.Buf[:0] - if v == nil { - b = encoder.AppendNull(ctx, b) - b = encoder.AppendComma(ctx, b) - return b, nil - } - header := (*emptyInterface)(unsafe.Pointer(&v)) - typ := header.typ - - typeptr := uintptr(unsafe.Pointer(typ)) - codeSet, err := encoder.CompileToGetCodeSet(ctx, typeptr) - if err != nil { - return nil, err - } - - p := uintptr(header.ptr) - ctx.Init(p, codeSet.CodeLength) - buf, err := encodeRunCode(ctx, b, codeSet) - if err != nil { - return nil, err - } - - ctx.Buf = buf - return buf, nil -} - -func encodeIndent(ctx *encoder.RuntimeContext, v interface{}, prefix, indent string) ([]byte, error) { - b := ctx.Buf[:0] - if v == nil { - b = encoder.AppendNull(ctx, b) - b = encoder.AppendCommaIndent(ctx, b) - return b, nil - } - header := (*emptyInterface)(unsafe.Pointer(&v)) - typ := header.typ - - typeptr := uintptr(unsafe.Pointer(typ)) - codeSet, err := encoder.CompileToGetCodeSet(ctx, typeptr) - if err != nil { - return nil, err - } - - p := uintptr(header.ptr) - ctx.Init(p, codeSet.CodeLength) - buf, err := encodeRunIndentCode(ctx, b, codeSet, prefix, indent) - - ctx.KeepRefs = append(ctx.KeepRefs, header.ptr) - - if err != nil { - return nil, err - } - - ctx.Buf = buf - return buf, nil -} - -func encodeRunCode(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - if (ctx.Option.Flag & encoder.DebugOption) != 0 { - if (ctx.Option.Flag & encoder.ColorizeOption) != 0 { - return vm_color.DebugRun(ctx, b, codeSet) - } - return vm.DebugRun(ctx, b, codeSet) - } - if (ctx.Option.Flag & encoder.ColorizeOption) != 0 { - return vm_color.Run(ctx, b, codeSet) - } - return vm.Run(ctx, b, codeSet) -} - -func encodeRunIndentCode(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet, prefix, indent string) ([]byte, error) { - ctx.Prefix = []byte(prefix) - ctx.IndentStr = []byte(indent) - if (ctx.Option.Flag & encoder.DebugOption) != 0 { - if (ctx.Option.Flag & encoder.ColorizeOption) != 0 { - return vm_color_indent.DebugRun(ctx, b, codeSet) - } - return vm_indent.DebugRun(ctx, b, codeSet) - } - if (ctx.Option.Flag & encoder.ColorizeOption) != 0 { - return vm_color_indent.Run(ctx, b, codeSet) - } - return vm_indent.Run(ctx, b, codeSet) -} diff --git a/vendor/github.com/goccy/go-json/error.go b/vendor/github.com/goccy/go-json/error.go deleted file mode 100644 index 5b2dcee50ec..00000000000 --- a/vendor/github.com/goccy/go-json/error.go +++ /dev/null @@ -1,41 +0,0 @@ -package json - -import ( - "github.com/goccy/go-json/internal/errors" -) - -// Before Go 1.2, an InvalidUTF8Error was returned by Marshal when -// attempting to encode a string value with invalid UTF-8 sequences. -// As of Go 1.2, Marshal instead coerces the string to valid UTF-8 by -// replacing invalid bytes with the Unicode replacement rune U+FFFD. -// -// Deprecated: No longer used; kept for compatibility. -type InvalidUTF8Error = errors.InvalidUTF8Error - -// An InvalidUnmarshalError describes an invalid argument passed to Unmarshal. -// (The argument to Unmarshal must be a non-nil pointer.) -type InvalidUnmarshalError = errors.InvalidUnmarshalError - -// A MarshalerError represents an error from calling a MarshalJSON or MarshalText method. -type MarshalerError = errors.MarshalerError - -// A SyntaxError is a description of a JSON syntax error. -type SyntaxError = errors.SyntaxError - -// An UnmarshalFieldError describes a JSON object key that -// led to an unexported (and therefore unwritable) struct field. -// -// Deprecated: No longer used; kept for compatibility. -type UnmarshalFieldError = errors.UnmarshalFieldError - -// An UnmarshalTypeError describes a JSON value that was -// not appropriate for a value of a specific Go type. -type UnmarshalTypeError = errors.UnmarshalTypeError - -// An UnsupportedTypeError is returned by Marshal when attempting -// to encode an unsupported value type. -type UnsupportedTypeError = errors.UnsupportedTypeError - -type UnsupportedValueError = errors.UnsupportedValueError - -type PathError = errors.PathError diff --git a/vendor/github.com/goccy/go-json/internal/decoder/anonymous_field.go b/vendor/github.com/goccy/go-json/internal/decoder/anonymous_field.go deleted file mode 100644 index b6876cf0d04..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/anonymous_field.go +++ /dev/null @@ -1,41 +0,0 @@ -package decoder - -import ( - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -type anonymousFieldDecoder struct { - structType *runtime.Type - offset uintptr - dec Decoder -} - -func newAnonymousFieldDecoder(structType *runtime.Type, offset uintptr, dec Decoder) *anonymousFieldDecoder { - return &anonymousFieldDecoder{ - structType: structType, - offset: offset, - dec: dec, - } -} - -func (d *anonymousFieldDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - if *(*unsafe.Pointer)(p) == nil { - *(*unsafe.Pointer)(p) = unsafe_New(d.structType) - } - p = *(*unsafe.Pointer)(p) - return d.dec.DecodeStream(s, depth, unsafe.Pointer(uintptr(p)+d.offset)) -} - -func (d *anonymousFieldDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - if *(*unsafe.Pointer)(p) == nil { - *(*unsafe.Pointer)(p) = unsafe_New(d.structType) - } - p = *(*unsafe.Pointer)(p) - return d.dec.Decode(ctx, cursor, depth, unsafe.Pointer(uintptr(p)+d.offset)) -} - -func (d *anonymousFieldDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return d.dec.DecodePath(ctx, cursor, depth) -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/array.go b/vendor/github.com/goccy/go-json/internal/decoder/array.go deleted file mode 100644 index 4b23ed43fe2..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/array.go +++ /dev/null @@ -1,176 +0,0 @@ -package decoder - -import ( - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type arrayDecoder struct { - elemType *runtime.Type - size uintptr - valueDecoder Decoder - alen int - structName string - fieldName string - zeroValue unsafe.Pointer -} - -func newArrayDecoder(dec Decoder, elemType *runtime.Type, alen int, structName, fieldName string) *arrayDecoder { - // workaround to avoid checkptr errors. cannot use `*(*unsafe.Pointer)(unsafe_New(elemType))` directly. - zeroValuePtr := unsafe_New(elemType) - zeroValue := **(**unsafe.Pointer)(unsafe.Pointer(&zeroValuePtr)) - return &arrayDecoder{ - valueDecoder: dec, - elemType: elemType, - size: elemType.Size(), - alen: alen, - structName: structName, - fieldName: fieldName, - zeroValue: zeroValue, - } -} - -func (d *arrayDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - case 'n': - if err := nullBytes(s); err != nil { - return err - } - return nil - case '[': - idx := 0 - s.cursor++ - if s.skipWhiteSpace() == ']' { - for idx < d.alen { - *(*unsafe.Pointer)(unsafe.Pointer(uintptr(p) + uintptr(idx)*d.size)) = d.zeroValue - idx++ - } - s.cursor++ - return nil - } - for { - if idx < d.alen { - if err := d.valueDecoder.DecodeStream(s, depth, unsafe.Pointer(uintptr(p)+uintptr(idx)*d.size)); err != nil { - return err - } - } else { - if err := s.skipValue(depth); err != nil { - return err - } - } - idx++ - switch s.skipWhiteSpace() { - case ']': - for idx < d.alen { - *(*unsafe.Pointer)(unsafe.Pointer(uintptr(p) + uintptr(idx)*d.size)) = d.zeroValue - idx++ - } - s.cursor++ - return nil - case ',': - s.cursor++ - continue - case nul: - if s.read() { - s.cursor++ - continue - } - goto ERROR - default: - goto ERROR - } - } - case nul: - if s.read() { - continue - } - goto ERROR - default: - goto ERROR - } - s.cursor++ - } -ERROR: - return errors.ErrUnexpectedEndOfJSON("array", s.totalOffset()) -} - -func (d *arrayDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - return cursor, nil - case '[': - idx := 0 - cursor++ - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == ']' { - for idx < d.alen { - *(*unsafe.Pointer)(unsafe.Pointer(uintptr(p) + uintptr(idx)*d.size)) = d.zeroValue - idx++ - } - cursor++ - return cursor, nil - } - for { - if idx < d.alen { - c, err := d.valueDecoder.Decode(ctx, cursor, depth, unsafe.Pointer(uintptr(p)+uintptr(idx)*d.size)) - if err != nil { - return 0, err - } - cursor = c - } else { - c, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - cursor = c - } - idx++ - cursor = skipWhiteSpace(buf, cursor) - switch buf[cursor] { - case ']': - for idx < d.alen { - *(*unsafe.Pointer)(unsafe.Pointer(uintptr(p) + uintptr(idx)*d.size)) = d.zeroValue - idx++ - } - cursor++ - return cursor, nil - case ',': - cursor++ - continue - default: - return 0, errors.ErrInvalidCharacter(buf[cursor], "array", cursor) - } - } - default: - return 0, errors.ErrUnexpectedEndOfJSON("array", cursor) - } - } -} - -func (d *arrayDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: array decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/assign.go b/vendor/github.com/goccy/go-json/internal/decoder/assign.go deleted file mode 100644 index c53e6ad9fc5..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/assign.go +++ /dev/null @@ -1,438 +0,0 @@ -package decoder - -import ( - "fmt" - "reflect" - "strconv" -) - -var ( - nilValue = reflect.ValueOf(nil) -) - -func AssignValue(src, dst reflect.Value) error { - if dst.Type().Kind() != reflect.Ptr { - return fmt.Errorf("invalid dst type. required pointer type: %T", dst.Type()) - } - casted, err := castValue(dst.Elem().Type(), src) - if err != nil { - return err - } - dst.Elem().Set(casted) - return nil -} - -func castValue(t reflect.Type, v reflect.Value) (reflect.Value, error) { - switch t.Kind() { - case reflect.Int: - vv, err := castInt(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(int(vv.Int())), nil - case reflect.Int8: - vv, err := castInt(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(int8(vv.Int())), nil - case reflect.Int16: - vv, err := castInt(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(int16(vv.Int())), nil - case reflect.Int32: - vv, err := castInt(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(int32(vv.Int())), nil - case reflect.Int64: - return castInt(v) - case reflect.Uint: - vv, err := castUint(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(uint(vv.Uint())), nil - case reflect.Uint8: - vv, err := castUint(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(uint8(vv.Uint())), nil - case reflect.Uint16: - vv, err := castUint(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(uint16(vv.Uint())), nil - case reflect.Uint32: - vv, err := castUint(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(uint32(vv.Uint())), nil - case reflect.Uint64: - return castUint(v) - case reflect.Uintptr: - vv, err := castUint(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(uintptr(vv.Uint())), nil - case reflect.String: - return castString(v) - case reflect.Bool: - return castBool(v) - case reflect.Float32: - vv, err := castFloat(v) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(float32(vv.Float())), nil - case reflect.Float64: - return castFloat(v) - case reflect.Array: - return castArray(t, v) - case reflect.Slice: - return castSlice(t, v) - case reflect.Map: - return castMap(t, v) - case reflect.Struct: - return castStruct(t, v) - } - return v, nil -} - -func castInt(v reflect.Value) (reflect.Value, error) { - switch v.Type().Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return v, nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return reflect.ValueOf(int64(v.Uint())), nil - case reflect.String: - i64, err := strconv.ParseInt(v.String(), 10, 64) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(i64), nil - case reflect.Bool: - if v.Bool() { - return reflect.ValueOf(int64(1)), nil - } - return reflect.ValueOf(int64(0)), nil - case reflect.Float32, reflect.Float64: - return reflect.ValueOf(int64(v.Float())), nil - case reflect.Array: - if v.Len() > 0 { - return castInt(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to int64 from empty array") - case reflect.Slice: - if v.Len() > 0 { - return castInt(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to int64 from empty slice") - case reflect.Interface: - return castInt(reflect.ValueOf(v.Interface())) - case reflect.Map: - return nilValue, fmt.Errorf("failed to cast to int64 from map") - case reflect.Struct: - return nilValue, fmt.Errorf("failed to cast to int64 from struct") - case reflect.Ptr: - return castInt(v.Elem()) - } - return nilValue, fmt.Errorf("failed to cast to int64 from %s", v.Type().Kind()) -} - -func castUint(v reflect.Value) (reflect.Value, error) { - switch v.Type().Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return reflect.ValueOf(uint64(v.Int())), nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return v, nil - case reflect.String: - u64, err := strconv.ParseUint(v.String(), 10, 64) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(u64), nil - case reflect.Bool: - if v.Bool() { - return reflect.ValueOf(uint64(1)), nil - } - return reflect.ValueOf(uint64(0)), nil - case reflect.Float32, reflect.Float64: - return reflect.ValueOf(uint64(v.Float())), nil - case reflect.Array: - if v.Len() > 0 { - return castUint(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to uint64 from empty array") - case reflect.Slice: - if v.Len() > 0 { - return castUint(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to uint64 from empty slice") - case reflect.Interface: - return castUint(reflect.ValueOf(v.Interface())) - case reflect.Map: - return nilValue, fmt.Errorf("failed to cast to uint64 from map") - case reflect.Struct: - return nilValue, fmt.Errorf("failed to cast to uint64 from struct") - case reflect.Ptr: - return castUint(v.Elem()) - } - return nilValue, fmt.Errorf("failed to cast to uint64 from %s", v.Type().Kind()) -} - -func castString(v reflect.Value) (reflect.Value, error) { - switch v.Type().Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return reflect.ValueOf(fmt.Sprint(v.Int())), nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return reflect.ValueOf(fmt.Sprint(v.Uint())), nil - case reflect.String: - return v, nil - case reflect.Bool: - if v.Bool() { - return reflect.ValueOf("true"), nil - } - return reflect.ValueOf("false"), nil - case reflect.Float32, reflect.Float64: - return reflect.ValueOf(fmt.Sprint(v.Float())), nil - case reflect.Array: - if v.Len() > 0 { - return castString(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to string from empty array") - case reflect.Slice: - if v.Len() > 0 { - return castString(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to string from empty slice") - case reflect.Interface: - return castString(reflect.ValueOf(v.Interface())) - case reflect.Map: - return nilValue, fmt.Errorf("failed to cast to string from map") - case reflect.Struct: - return nilValue, fmt.Errorf("failed to cast to string from struct") - case reflect.Ptr: - return castString(v.Elem()) - } - return nilValue, fmt.Errorf("failed to cast to string from %s", v.Type().Kind()) -} - -func castBool(v reflect.Value) (reflect.Value, error) { - switch v.Type().Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - switch v.Int() { - case 0: - return reflect.ValueOf(false), nil - case 1: - return reflect.ValueOf(true), nil - } - return nilValue, fmt.Errorf("failed to cast to bool from %d", v.Int()) - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - switch v.Uint() { - case 0: - return reflect.ValueOf(false), nil - case 1: - return reflect.ValueOf(true), nil - } - return nilValue, fmt.Errorf("failed to cast to bool from %d", v.Uint()) - case reflect.String: - b, err := strconv.ParseBool(v.String()) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(b), nil - case reflect.Bool: - return v, nil - case reflect.Float32, reflect.Float64: - switch v.Float() { - case 0: - return reflect.ValueOf(false), nil - case 1: - return reflect.ValueOf(true), nil - } - return nilValue, fmt.Errorf("failed to cast to bool from %f", v.Float()) - case reflect.Array: - if v.Len() > 0 { - return castBool(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to string from empty array") - case reflect.Slice: - if v.Len() > 0 { - return castBool(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to string from empty slice") - case reflect.Interface: - return castBool(reflect.ValueOf(v.Interface())) - case reflect.Map: - return nilValue, fmt.Errorf("failed to cast to string from map") - case reflect.Struct: - return nilValue, fmt.Errorf("failed to cast to string from struct") - case reflect.Ptr: - return castBool(v.Elem()) - } - return nilValue, fmt.Errorf("failed to cast to bool from %s", v.Type().Kind()) -} - -func castFloat(v reflect.Value) (reflect.Value, error) { - switch v.Type().Kind() { - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return reflect.ValueOf(float64(v.Int())), nil - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return reflect.ValueOf(float64(v.Uint())), nil - case reflect.String: - f64, err := strconv.ParseFloat(v.String(), 64) - if err != nil { - return nilValue, err - } - return reflect.ValueOf(f64), nil - case reflect.Bool: - if v.Bool() { - return reflect.ValueOf(float64(1)), nil - } - return reflect.ValueOf(float64(0)), nil - case reflect.Float32, reflect.Float64: - return v, nil - case reflect.Array: - if v.Len() > 0 { - return castFloat(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to float64 from empty array") - case reflect.Slice: - if v.Len() > 0 { - return castFloat(v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to float64 from empty slice") - case reflect.Interface: - return castFloat(reflect.ValueOf(v.Interface())) - case reflect.Map: - return nilValue, fmt.Errorf("failed to cast to float64 from map") - case reflect.Struct: - return nilValue, fmt.Errorf("failed to cast to float64 from struct") - case reflect.Ptr: - return castFloat(v.Elem()) - } - return nilValue, fmt.Errorf("failed to cast to float64 from %s", v.Type().Kind()) -} - -func castArray(t reflect.Type, v reflect.Value) (reflect.Value, error) { - kind := v.Type().Kind() - if kind == reflect.Interface { - return castArray(t, reflect.ValueOf(v.Interface())) - } - if kind != reflect.Slice && kind != reflect.Array { - return nilValue, fmt.Errorf("failed to cast to array from %s", kind) - } - if t.Elem() == v.Type().Elem() { - return v, nil - } - if t.Len() != v.Len() { - return nilValue, fmt.Errorf("failed to cast [%d]array from slice of %d length", t.Len(), v.Len()) - } - ret := reflect.New(t).Elem() - for i := 0; i < v.Len(); i++ { - vv, err := castValue(t.Elem(), v.Index(i)) - if err != nil { - return nilValue, err - } - ret.Index(i).Set(vv) - } - return ret, nil -} - -func castSlice(t reflect.Type, v reflect.Value) (reflect.Value, error) { - kind := v.Type().Kind() - if kind == reflect.Interface { - return castSlice(t, reflect.ValueOf(v.Interface())) - } - if kind != reflect.Slice && kind != reflect.Array { - return nilValue, fmt.Errorf("failed to cast to slice from %s", kind) - } - if t.Elem() == v.Type().Elem() { - return v, nil - } - ret := reflect.MakeSlice(t, v.Len(), v.Len()) - for i := 0; i < v.Len(); i++ { - vv, err := castValue(t.Elem(), v.Index(i)) - if err != nil { - return nilValue, err - } - ret.Index(i).Set(vv) - } - return ret, nil -} - -func castMap(t reflect.Type, v reflect.Value) (reflect.Value, error) { - ret := reflect.MakeMap(t) - switch v.Type().Kind() { - case reflect.Map: - iter := v.MapRange() - for iter.Next() { - key, err := castValue(t.Key(), iter.Key()) - if err != nil { - return nilValue, err - } - value, err := castValue(t.Elem(), iter.Value()) - if err != nil { - return nilValue, err - } - ret.SetMapIndex(key, value) - } - return ret, nil - case reflect.Interface: - return castMap(t, reflect.ValueOf(v.Interface())) - case reflect.Slice: - if v.Len() > 0 { - return castMap(t, v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to map from empty slice") - } - return nilValue, fmt.Errorf("failed to cast to map from %s", v.Type().Kind()) -} - -func castStruct(t reflect.Type, v reflect.Value) (reflect.Value, error) { - ret := reflect.New(t).Elem() - switch v.Type().Kind() { - case reflect.Map: - iter := v.MapRange() - for iter.Next() { - key := iter.Key() - k, err := castString(key) - if err != nil { - return nilValue, err - } - fieldName := k.String() - field, ok := t.FieldByName(fieldName) - if ok { - value, err := castValue(field.Type, iter.Value()) - if err != nil { - return nilValue, err - } - ret.FieldByName(fieldName).Set(value) - } - } - return ret, nil - case reflect.Struct: - for i := 0; i < v.Type().NumField(); i++ { - name := v.Type().Field(i).Name - ret.FieldByName(name).Set(v.FieldByName(name)) - } - return ret, nil - case reflect.Interface: - return castStruct(t, reflect.ValueOf(v.Interface())) - case reflect.Slice: - if v.Len() > 0 { - return castStruct(t, v.Index(0)) - } - return nilValue, fmt.Errorf("failed to cast to struct from empty slice") - default: - return nilValue, fmt.Errorf("failed to cast to struct from %s", v.Type().Kind()) - } -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/bool.go b/vendor/github.com/goccy/go-json/internal/decoder/bool.go deleted file mode 100644 index ba6cf5bc496..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/bool.go +++ /dev/null @@ -1,83 +0,0 @@ -package decoder - -import ( - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -type boolDecoder struct { - structName string - fieldName string -} - -func newBoolDecoder(structName, fieldName string) *boolDecoder { - return &boolDecoder{structName: structName, fieldName: fieldName} -} - -func (d *boolDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - c := s.skipWhiteSpace() - for { - switch c { - case 't': - if err := trueBytes(s); err != nil { - return err - } - **(**bool)(unsafe.Pointer(&p)) = true - return nil - case 'f': - if err := falseBytes(s); err != nil { - return err - } - **(**bool)(unsafe.Pointer(&p)) = false - return nil - case 'n': - if err := nullBytes(s); err != nil { - return err - } - return nil - case nul: - if s.read() { - c = s.char() - continue - } - goto ERROR - } - break - } -ERROR: - return errors.ErrUnexpectedEndOfJSON("bool", s.totalOffset()) -} - -func (d *boolDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - switch buf[cursor] { - case 't': - if err := validateTrue(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - **(**bool)(unsafe.Pointer(&p)) = true - return cursor, nil - case 'f': - if err := validateFalse(buf, cursor); err != nil { - return 0, err - } - cursor += 5 - **(**bool)(unsafe.Pointer(&p)) = false - return cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - return cursor, nil - } - return 0, errors.ErrUnexpectedEndOfJSON("bool", cursor) -} - -func (d *boolDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: bool decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/bytes.go b/vendor/github.com/goccy/go-json/internal/decoder/bytes.go deleted file mode 100644 index 939bf432741..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/bytes.go +++ /dev/null @@ -1,118 +0,0 @@ -package decoder - -import ( - "encoding/base64" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type bytesDecoder struct { - typ *runtime.Type - sliceDecoder Decoder - stringDecoder *stringDecoder - structName string - fieldName string -} - -func byteUnmarshalerSliceDecoder(typ *runtime.Type, structName string, fieldName string) Decoder { - var unmarshalDecoder Decoder - switch { - case runtime.PtrTo(typ).Implements(unmarshalJSONType): - unmarshalDecoder = newUnmarshalJSONDecoder(runtime.PtrTo(typ), structName, fieldName) - case runtime.PtrTo(typ).Implements(unmarshalTextType): - unmarshalDecoder = newUnmarshalTextDecoder(runtime.PtrTo(typ), structName, fieldName) - default: - unmarshalDecoder, _ = compileUint8(typ, structName, fieldName) - } - return newSliceDecoder(unmarshalDecoder, typ, 1, structName, fieldName) -} - -func newBytesDecoder(typ *runtime.Type, structName string, fieldName string) *bytesDecoder { - return &bytesDecoder{ - typ: typ, - sliceDecoder: byteUnmarshalerSliceDecoder(typ, structName, fieldName), - stringDecoder: newStringDecoder(structName, fieldName), - structName: structName, - fieldName: fieldName, - } -} - -func (d *bytesDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.decodeStreamBinary(s, depth, p) - if err != nil { - return err - } - if bytes == nil { - s.reset() - return nil - } - decodedLen := base64.StdEncoding.DecodedLen(len(bytes)) - buf := make([]byte, decodedLen) - n, err := base64.StdEncoding.Decode(buf, bytes) - if err != nil { - return err - } - *(*[]byte)(p) = buf[:n] - s.reset() - return nil -} - -func (d *bytesDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - bytes, c, err := d.decodeBinary(ctx, cursor, depth, p) - if err != nil { - return 0, err - } - if bytes == nil { - return c, nil - } - cursor = c - decodedLen := base64.StdEncoding.DecodedLen(len(bytes)) - b := make([]byte, decodedLen) - n, err := base64.StdEncoding.Decode(b, bytes) - if err != nil { - return 0, err - } - *(*[]byte)(p) = b[:n] - return cursor, nil -} - -func (d *bytesDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: []byte decoder does not support decode path") -} - -func (d *bytesDecoder) decodeStreamBinary(s *Stream, depth int64, p unsafe.Pointer) ([]byte, error) { - c := s.skipWhiteSpace() - if c == '[' { - if d.sliceDecoder == nil { - return nil, &errors.UnmarshalTypeError{ - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - } - err := d.sliceDecoder.DecodeStream(s, depth, p) - return nil, err - } - return d.stringDecoder.decodeStreamByte(s) -} - -func (d *bytesDecoder) decodeBinary(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) ([]byte, int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == '[' { - if d.sliceDecoder == nil { - return nil, 0, &errors.UnmarshalTypeError{ - Type: runtime.RType2Type(d.typ), - Offset: cursor, - } - } - c, err := d.sliceDecoder.Decode(ctx, cursor, depth, p) - if err != nil { - return nil, 0, err - } - return nil, c, nil - } - return d.stringDecoder.decodeByte(buf, cursor) -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/compile.go b/vendor/github.com/goccy/go-json/internal/decoder/compile.go deleted file mode 100644 index 8ad50936c0c..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/compile.go +++ /dev/null @@ -1,493 +0,0 @@ -package decoder - -import ( - "encoding/json" - "fmt" - "reflect" - "strings" - "sync" - "sync/atomic" - "unicode" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -var ( - jsonNumberType = reflect.TypeOf(json.Number("")) - typeAddr *runtime.TypeAddr - cachedDecoderMap unsafe.Pointer // map[uintptr]decoder - cachedDecoder []Decoder - initOnce sync.Once -) - -func initDecoder() { - initOnce.Do(func() { - typeAddr = runtime.AnalyzeTypeAddr() - if typeAddr == nil { - typeAddr = &runtime.TypeAddr{} - } - cachedDecoder = make([]Decoder, typeAddr.AddrRange>>typeAddr.AddrShift+1) - }) -} - -func loadDecoderMap() map[uintptr]Decoder { - initDecoder() - p := atomic.LoadPointer(&cachedDecoderMap) - return *(*map[uintptr]Decoder)(unsafe.Pointer(&p)) -} - -func storeDecoder(typ uintptr, dec Decoder, m map[uintptr]Decoder) { - initDecoder() - newDecoderMap := make(map[uintptr]Decoder, len(m)+1) - newDecoderMap[typ] = dec - - for k, v := range m { - newDecoderMap[k] = v - } - - atomic.StorePointer(&cachedDecoderMap, *(*unsafe.Pointer)(unsafe.Pointer(&newDecoderMap))) -} - -func compileToGetDecoderSlowPath(typeptr uintptr, typ *runtime.Type) (Decoder, error) { - decoderMap := loadDecoderMap() - if dec, exists := decoderMap[typeptr]; exists { - return dec, nil - } - - dec, err := compileHead(typ, map[uintptr]Decoder{}) - if err != nil { - return nil, err - } - storeDecoder(typeptr, dec, decoderMap) - return dec, nil -} - -func compileHead(typ *runtime.Type, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - switch { - case implementsUnmarshalJSONType(runtime.PtrTo(typ)): - return newUnmarshalJSONDecoder(runtime.PtrTo(typ), "", ""), nil - case runtime.PtrTo(typ).Implements(unmarshalTextType): - return newUnmarshalTextDecoder(runtime.PtrTo(typ), "", ""), nil - } - return compile(typ.Elem(), "", "", structTypeToDecoder) -} - -func compile(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - switch { - case implementsUnmarshalJSONType(runtime.PtrTo(typ)): - return newUnmarshalJSONDecoder(runtime.PtrTo(typ), structName, fieldName), nil - case runtime.PtrTo(typ).Implements(unmarshalTextType): - return newUnmarshalTextDecoder(runtime.PtrTo(typ), structName, fieldName), nil - } - - switch typ.Kind() { - case reflect.Ptr: - return compilePtr(typ, structName, fieldName, structTypeToDecoder) - case reflect.Struct: - return compileStruct(typ, structName, fieldName, structTypeToDecoder) - case reflect.Slice: - elem := typ.Elem() - if elem.Kind() == reflect.Uint8 { - return compileBytes(elem, structName, fieldName) - } - return compileSlice(typ, structName, fieldName, structTypeToDecoder) - case reflect.Array: - return compileArray(typ, structName, fieldName, structTypeToDecoder) - case reflect.Map: - return compileMap(typ, structName, fieldName, structTypeToDecoder) - case reflect.Interface: - return compileInterface(typ, structName, fieldName) - case reflect.Uintptr: - return compileUint(typ, structName, fieldName) - case reflect.Int: - return compileInt(typ, structName, fieldName) - case reflect.Int8: - return compileInt8(typ, structName, fieldName) - case reflect.Int16: - return compileInt16(typ, structName, fieldName) - case reflect.Int32: - return compileInt32(typ, structName, fieldName) - case reflect.Int64: - return compileInt64(typ, structName, fieldName) - case reflect.Uint: - return compileUint(typ, structName, fieldName) - case reflect.Uint8: - return compileUint8(typ, structName, fieldName) - case reflect.Uint16: - return compileUint16(typ, structName, fieldName) - case reflect.Uint32: - return compileUint32(typ, structName, fieldName) - case reflect.Uint64: - return compileUint64(typ, structName, fieldName) - case reflect.String: - return compileString(typ, structName, fieldName) - case reflect.Bool: - return compileBool(structName, fieldName) - case reflect.Float32: - return compileFloat32(structName, fieldName) - case reflect.Float64: - return compileFloat64(structName, fieldName) - case reflect.Func: - return compileFunc(typ, structName, fieldName) - } - return newInvalidDecoder(typ, structName, fieldName), nil -} - -func isStringTagSupportedType(typ *runtime.Type) bool { - switch { - case implementsUnmarshalJSONType(runtime.PtrTo(typ)): - return false - case runtime.PtrTo(typ).Implements(unmarshalTextType): - return false - } - switch typ.Kind() { - case reflect.Map: - return false - case reflect.Slice: - return false - case reflect.Array: - return false - case reflect.Struct: - return false - case reflect.Interface: - return false - } - return true -} - -func compileMapKey(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - if runtime.PtrTo(typ).Implements(unmarshalTextType) { - return newUnmarshalTextDecoder(runtime.PtrTo(typ), structName, fieldName), nil - } - if typ.Kind() == reflect.String { - return newStringDecoder(structName, fieldName), nil - } - dec, err := compile(typ, structName, fieldName, structTypeToDecoder) - if err != nil { - return nil, err - } - for { - switch t := dec.(type) { - case *stringDecoder, *interfaceDecoder: - return dec, nil - case *boolDecoder, *intDecoder, *uintDecoder, *numberDecoder: - return newWrappedStringDecoder(typ, dec, structName, fieldName), nil - case *ptrDecoder: - dec = t.dec - default: - return newInvalidDecoder(typ, structName, fieldName), nil - } - } -} - -func compilePtr(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - dec, err := compile(typ.Elem(), structName, fieldName, structTypeToDecoder) - if err != nil { - return nil, err - } - return newPtrDecoder(dec, typ.Elem(), structName, fieldName), nil -} - -func compileInt(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newIntDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v int64) { - *(*int)(p) = int(v) - }), nil -} - -func compileInt8(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newIntDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v int64) { - *(*int8)(p) = int8(v) - }), nil -} - -func compileInt16(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newIntDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v int64) { - *(*int16)(p) = int16(v) - }), nil -} - -func compileInt32(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newIntDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v int64) { - *(*int32)(p) = int32(v) - }), nil -} - -func compileInt64(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newIntDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v int64) { - *(*int64)(p) = v - }), nil -} - -func compileUint(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newUintDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v uint64) { - *(*uint)(p) = uint(v) - }), nil -} - -func compileUint8(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newUintDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v uint64) { - *(*uint8)(p) = uint8(v) - }), nil -} - -func compileUint16(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newUintDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v uint64) { - *(*uint16)(p) = uint16(v) - }), nil -} - -func compileUint32(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newUintDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v uint64) { - *(*uint32)(p) = uint32(v) - }), nil -} - -func compileUint64(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newUintDecoder(typ, structName, fieldName, func(p unsafe.Pointer, v uint64) { - *(*uint64)(p) = v - }), nil -} - -func compileFloat32(structName, fieldName string) (Decoder, error) { - return newFloatDecoder(structName, fieldName, func(p unsafe.Pointer, v float64) { - *(*float32)(p) = float32(v) - }), nil -} - -func compileFloat64(structName, fieldName string) (Decoder, error) { - return newFloatDecoder(structName, fieldName, func(p unsafe.Pointer, v float64) { - *(*float64)(p) = v - }), nil -} - -func compileString(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - if typ == runtime.Type2RType(jsonNumberType) { - return newNumberDecoder(structName, fieldName, func(p unsafe.Pointer, v json.Number) { - *(*json.Number)(p) = v - }), nil - } - return newStringDecoder(structName, fieldName), nil -} - -func compileBool(structName, fieldName string) (Decoder, error) { - return newBoolDecoder(structName, fieldName), nil -} - -func compileBytes(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newBytesDecoder(typ, structName, fieldName), nil -} - -func compileSlice(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - elem := typ.Elem() - decoder, err := compile(elem, structName, fieldName, structTypeToDecoder) - if err != nil { - return nil, err - } - return newSliceDecoder(decoder, elem, elem.Size(), structName, fieldName), nil -} - -func compileArray(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - elem := typ.Elem() - decoder, err := compile(elem, structName, fieldName, structTypeToDecoder) - if err != nil { - return nil, err - } - return newArrayDecoder(decoder, elem, typ.Len(), structName, fieldName), nil -} - -func compileMap(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - keyDec, err := compileMapKey(typ.Key(), structName, fieldName, structTypeToDecoder) - if err != nil { - return nil, err - } - valueDec, err := compile(typ.Elem(), structName, fieldName, structTypeToDecoder) - if err != nil { - return nil, err - } - return newMapDecoder(typ, typ.Key(), keyDec, typ.Elem(), valueDec, structName, fieldName), nil -} - -func compileInterface(typ *runtime.Type, structName, fieldName string) (Decoder, error) { - return newInterfaceDecoder(typ, structName, fieldName), nil -} - -func compileFunc(typ *runtime.Type, strutName, fieldName string) (Decoder, error) { - return newFuncDecoder(typ, strutName, fieldName), nil -} - -func typeToStructTags(typ *runtime.Type) runtime.StructTags { - tags := runtime.StructTags{} - fieldNum := typ.NumField() - for i := 0; i < fieldNum; i++ { - field := typ.Field(i) - if runtime.IsIgnoredStructField(field) { - continue - } - tags = append(tags, runtime.StructTagFromField(field)) - } - return tags -} - -func compileStruct(typ *runtime.Type, structName, fieldName string, structTypeToDecoder map[uintptr]Decoder) (Decoder, error) { - fieldNum := typ.NumField() - fieldMap := map[string]*structFieldSet{} - typeptr := uintptr(unsafe.Pointer(typ)) - if dec, exists := structTypeToDecoder[typeptr]; exists { - return dec, nil - } - structDec := newStructDecoder(structName, fieldName, fieldMap) - structTypeToDecoder[typeptr] = structDec - structName = typ.Name() - tags := typeToStructTags(typ) - allFields := []*structFieldSet{} - for i := 0; i < fieldNum; i++ { - field := typ.Field(i) - if runtime.IsIgnoredStructField(field) { - continue - } - isUnexportedField := unicode.IsLower([]rune(field.Name)[0]) - tag := runtime.StructTagFromField(field) - dec, err := compile(runtime.Type2RType(field.Type), structName, field.Name, structTypeToDecoder) - if err != nil { - return nil, err - } - if field.Anonymous && !tag.IsTaggedKey { - if stDec, ok := dec.(*structDecoder); ok { - if runtime.Type2RType(field.Type) == typ { - // recursive definition - continue - } - for k, v := range stDec.fieldMap { - if tags.ExistsKey(k) { - continue - } - fieldSet := &structFieldSet{ - dec: v.dec, - offset: field.Offset + v.offset, - isTaggedKey: v.isTaggedKey, - key: k, - keyLen: int64(len(k)), - } - allFields = append(allFields, fieldSet) - } - } else if pdec, ok := dec.(*ptrDecoder); ok { - contentDec := pdec.contentDecoder() - if pdec.typ == typ { - // recursive definition - continue - } - var fieldSetErr error - if isUnexportedField { - fieldSetErr = fmt.Errorf( - "json: cannot set embedded pointer to unexported struct: %v", - field.Type.Elem(), - ) - } - if dec, ok := contentDec.(*structDecoder); ok { - for k, v := range dec.fieldMap { - if tags.ExistsKey(k) { - continue - } - fieldSet := &structFieldSet{ - dec: newAnonymousFieldDecoder(pdec.typ, v.offset, v.dec), - offset: field.Offset, - isTaggedKey: v.isTaggedKey, - key: k, - keyLen: int64(len(k)), - err: fieldSetErr, - } - allFields = append(allFields, fieldSet) - } - } else { - fieldSet := &structFieldSet{ - dec: pdec, - offset: field.Offset, - isTaggedKey: tag.IsTaggedKey, - key: field.Name, - keyLen: int64(len(field.Name)), - } - allFields = append(allFields, fieldSet) - } - } else { - fieldSet := &structFieldSet{ - dec: dec, - offset: field.Offset, - isTaggedKey: tag.IsTaggedKey, - key: field.Name, - keyLen: int64(len(field.Name)), - } - allFields = append(allFields, fieldSet) - } - } else { - if tag.IsString && isStringTagSupportedType(runtime.Type2RType(field.Type)) { - dec = newWrappedStringDecoder(runtime.Type2RType(field.Type), dec, structName, field.Name) - } - var key string - if tag.Key != "" { - key = tag.Key - } else { - key = field.Name - } - fieldSet := &structFieldSet{ - dec: dec, - offset: field.Offset, - isTaggedKey: tag.IsTaggedKey, - key: key, - keyLen: int64(len(key)), - } - allFields = append(allFields, fieldSet) - } - } - for _, set := range filterDuplicatedFields(allFields) { - fieldMap[set.key] = set - lower := strings.ToLower(set.key) - if _, exists := fieldMap[lower]; !exists { - // first win - fieldMap[lower] = set - } - } - delete(structTypeToDecoder, typeptr) - structDec.tryOptimize() - return structDec, nil -} - -func filterDuplicatedFields(allFields []*structFieldSet) []*structFieldSet { - fieldMap := map[string][]*structFieldSet{} - for _, field := range allFields { - fieldMap[field.key] = append(fieldMap[field.key], field) - } - duplicatedFieldMap := map[string]struct{}{} - for k, sets := range fieldMap { - sets = filterFieldSets(sets) - if len(sets) != 1 { - duplicatedFieldMap[k] = struct{}{} - } - } - - filtered := make([]*structFieldSet, 0, len(allFields)) - for _, field := range allFields { - if _, exists := duplicatedFieldMap[field.key]; exists { - continue - } - filtered = append(filtered, field) - } - return filtered -} - -func filterFieldSets(sets []*structFieldSet) []*structFieldSet { - if len(sets) == 1 { - return sets - } - filtered := make([]*structFieldSet, 0, len(sets)) - for _, set := range sets { - if set.isTaggedKey { - filtered = append(filtered, set) - } - } - return filtered -} - -func implementsUnmarshalJSONType(typ *runtime.Type) bool { - return typ.Implements(unmarshalJSONType) || typ.Implements(unmarshalJSONContextType) -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/compile_norace.go b/vendor/github.com/goccy/go-json/internal/decoder/compile_norace.go deleted file mode 100644 index 025ca85b5e2..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/compile_norace.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build !race -// +build !race - -package decoder - -import ( - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -func CompileToGetDecoder(typ *runtime.Type) (Decoder, error) { - initDecoder() - typeptr := uintptr(unsafe.Pointer(typ)) - if typeptr > typeAddr.MaxTypeAddr { - return compileToGetDecoderSlowPath(typeptr, typ) - } - - index := (typeptr - typeAddr.BaseTypeAddr) >> typeAddr.AddrShift - if dec := cachedDecoder[index]; dec != nil { - return dec, nil - } - - dec, err := compileHead(typ, map[uintptr]Decoder{}) - if err != nil { - return nil, err - } - cachedDecoder[index] = dec - return dec, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/compile_race.go b/vendor/github.com/goccy/go-json/internal/decoder/compile_race.go deleted file mode 100644 index 023b817c368..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/compile_race.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build race -// +build race - -package decoder - -import ( - "sync" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -var decMu sync.RWMutex - -func CompileToGetDecoder(typ *runtime.Type) (Decoder, error) { - initDecoder() - typeptr := uintptr(unsafe.Pointer(typ)) - if typeptr > typeAddr.MaxTypeAddr { - return compileToGetDecoderSlowPath(typeptr, typ) - } - - index := (typeptr - typeAddr.BaseTypeAddr) >> typeAddr.AddrShift - decMu.RLock() - if dec := cachedDecoder[index]; dec != nil { - decMu.RUnlock() - return dec, nil - } - decMu.RUnlock() - - dec, err := compileHead(typ, map[uintptr]Decoder{}) - if err != nil { - return nil, err - } - decMu.Lock() - cachedDecoder[index] = dec - decMu.Unlock() - return dec, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/context.go b/vendor/github.com/goccy/go-json/internal/decoder/context.go deleted file mode 100644 index cb2ffdafd03..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/context.go +++ /dev/null @@ -1,254 +0,0 @@ -package decoder - -import ( - "sync" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -type RuntimeContext struct { - Buf []byte - Option *Option -} - -var ( - runtimeContextPool = sync.Pool{ - New: func() interface{} { - return &RuntimeContext{ - Option: &Option{}, - } - }, - } -) - -func TakeRuntimeContext() *RuntimeContext { - return runtimeContextPool.Get().(*RuntimeContext) -} - -func ReleaseRuntimeContext(ctx *RuntimeContext) { - runtimeContextPool.Put(ctx) -} - -var ( - isWhiteSpace = [256]bool{} -) - -func init() { - isWhiteSpace[' '] = true - isWhiteSpace['\n'] = true - isWhiteSpace['\t'] = true - isWhiteSpace['\r'] = true -} - -func char(ptr unsafe.Pointer, offset int64) byte { - return *(*byte)(unsafe.Pointer(uintptr(ptr) + uintptr(offset))) -} - -func skipWhiteSpace(buf []byte, cursor int64) int64 { - for isWhiteSpace[buf[cursor]] { - cursor++ - } - return cursor -} - -func skipObject(buf []byte, cursor, depth int64) (int64, error) { - braceCount := 1 - for { - switch buf[cursor] { - case '{': - braceCount++ - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - case '}': - depth-- - braceCount-- - if braceCount == 0 { - return cursor + 1, nil - } - case '[': - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - case ']': - depth-- - case '"': - for { - cursor++ - switch buf[cursor] { - case '\\': - cursor++ - if buf[cursor] == nul { - return 0, errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - case '"': - goto SWITCH_OUT - case nul: - return 0, errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - } - case nul: - return 0, errors.ErrUnexpectedEndOfJSON("object of object", cursor) - } - SWITCH_OUT: - cursor++ - } -} - -func skipArray(buf []byte, cursor, depth int64) (int64, error) { - bracketCount := 1 - for { - switch buf[cursor] { - case '[': - bracketCount++ - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - case ']': - bracketCount-- - depth-- - if bracketCount == 0 { - return cursor + 1, nil - } - case '{': - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - case '}': - depth-- - case '"': - for { - cursor++ - switch buf[cursor] { - case '\\': - cursor++ - if buf[cursor] == nul { - return 0, errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - case '"': - goto SWITCH_OUT - case nul: - return 0, errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - } - case nul: - return 0, errors.ErrUnexpectedEndOfJSON("array of object", cursor) - } - SWITCH_OUT: - cursor++ - } -} - -func skipValue(buf []byte, cursor, depth int64) (int64, error) { - for { - switch buf[cursor] { - case ' ', '\t', '\n', '\r': - cursor++ - continue - case '{': - return skipObject(buf, cursor+1, depth+1) - case '[': - return skipArray(buf, cursor+1, depth+1) - case '"': - for { - cursor++ - switch buf[cursor] { - case '\\': - cursor++ - if buf[cursor] == nul { - return 0, errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - case '"': - return cursor + 1, nil - case nul: - return 0, errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - for { - cursor++ - if floatTable[buf[cursor]] { - continue - } - break - } - return cursor, nil - case 't': - if err := validateTrue(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - return cursor, nil - case 'f': - if err := validateFalse(buf, cursor); err != nil { - return 0, err - } - cursor += 5 - return cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - return cursor, nil - default: - return cursor, errors.ErrUnexpectedEndOfJSON("null", cursor) - } - } -} - -func validateTrue(buf []byte, cursor int64) error { - if cursor+3 >= int64(len(buf)) { - return errors.ErrUnexpectedEndOfJSON("true", cursor) - } - if buf[cursor+1] != 'r' { - return errors.ErrInvalidCharacter(buf[cursor+1], "true", cursor) - } - if buf[cursor+2] != 'u' { - return errors.ErrInvalidCharacter(buf[cursor+2], "true", cursor) - } - if buf[cursor+3] != 'e' { - return errors.ErrInvalidCharacter(buf[cursor+3], "true", cursor) - } - return nil -} - -func validateFalse(buf []byte, cursor int64) error { - if cursor+4 >= int64(len(buf)) { - return errors.ErrUnexpectedEndOfJSON("false", cursor) - } - if buf[cursor+1] != 'a' { - return errors.ErrInvalidCharacter(buf[cursor+1], "false", cursor) - } - if buf[cursor+2] != 'l' { - return errors.ErrInvalidCharacter(buf[cursor+2], "false", cursor) - } - if buf[cursor+3] != 's' { - return errors.ErrInvalidCharacter(buf[cursor+3], "false", cursor) - } - if buf[cursor+4] != 'e' { - return errors.ErrInvalidCharacter(buf[cursor+4], "false", cursor) - } - return nil -} - -func validateNull(buf []byte, cursor int64) error { - if cursor+3 >= int64(len(buf)) { - return errors.ErrUnexpectedEndOfJSON("null", cursor) - } - if buf[cursor+1] != 'u' { - return errors.ErrInvalidCharacter(buf[cursor+1], "null", cursor) - } - if buf[cursor+2] != 'l' { - return errors.ErrInvalidCharacter(buf[cursor+2], "null", cursor) - } - if buf[cursor+3] != 'l' { - return errors.ErrInvalidCharacter(buf[cursor+3], "null", cursor) - } - return nil -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/float.go b/vendor/github.com/goccy/go-json/internal/decoder/float.go deleted file mode 100644 index 9b2eb8b35a4..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/float.go +++ /dev/null @@ -1,170 +0,0 @@ -package decoder - -import ( - "strconv" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -type floatDecoder struct { - op func(unsafe.Pointer, float64) - structName string - fieldName string -} - -func newFloatDecoder(structName, fieldName string, op func(unsafe.Pointer, float64)) *floatDecoder { - return &floatDecoder{op: op, structName: structName, fieldName: fieldName} -} - -var ( - floatTable = [256]bool{ - '0': true, - '1': true, - '2': true, - '3': true, - '4': true, - '5': true, - '6': true, - '7': true, - '8': true, - '9': true, - '.': true, - 'e': true, - 'E': true, - '+': true, - '-': true, - } - - validEndNumberChar = [256]bool{ - nul: true, - ' ': true, - '\t': true, - '\r': true, - '\n': true, - ',': true, - ':': true, - '}': true, - ']': true, - } -) - -func floatBytes(s *Stream) []byte { - start := s.cursor - for { - s.cursor++ - if floatTable[s.char()] { - continue - } else if s.char() == nul { - if s.read() { - s.cursor-- // for retry current character - continue - } - } - break - } - return s.buf[start:s.cursor] -} - -func (d *floatDecoder) decodeStreamByte(s *Stream) ([]byte, error) { - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - s.cursor++ - continue - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return floatBytes(s), nil - case 'n': - if err := nullBytes(s); err != nil { - return nil, err - } - return nil, nil - case nul: - if s.read() { - continue - } - goto ERROR - default: - goto ERROR - } - } -ERROR: - return nil, errors.ErrUnexpectedEndOfJSON("float", s.totalOffset()) -} - -func (d *floatDecoder) decodeByte(buf []byte, cursor int64) ([]byte, int64, error) { - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - start := cursor - cursor++ - for floatTable[buf[cursor]] { - cursor++ - } - num := buf[start:cursor] - return num, cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return nil, cursor, nil - default: - return nil, 0, errors.ErrUnexpectedEndOfJSON("float", cursor) - } - } -} - -func (d *floatDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.decodeStreamByte(s) - if err != nil { - return err - } - if bytes == nil { - return nil - } - str := *(*string)(unsafe.Pointer(&bytes)) - f64, err := strconv.ParseFloat(str, 64) - if err != nil { - return errors.ErrSyntax(err.Error(), s.totalOffset()) - } - d.op(p, f64) - return nil -} - -func (d *floatDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - bytes, c, err := d.decodeByte(buf, cursor) - if err != nil { - return 0, err - } - if bytes == nil { - return c, nil - } - cursor = c - if !validEndNumberChar[buf[cursor]] { - return 0, errors.ErrUnexpectedEndOfJSON("float", cursor) - } - s := *(*string)(unsafe.Pointer(&bytes)) - f64, err := strconv.ParseFloat(s, 64) - if err != nil { - return 0, errors.ErrSyntax(err.Error(), cursor) - } - d.op(p, f64) - return cursor, nil -} - -func (d *floatDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - buf := ctx.Buf - bytes, c, err := d.decodeByte(buf, cursor) - if err != nil { - return nil, 0, err - } - if bytes == nil { - return [][]byte{nullbytes}, c, nil - } - return [][]byte{bytes}, c, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/func.go b/vendor/github.com/goccy/go-json/internal/decoder/func.go deleted file mode 100644 index 4cc12ca81f1..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/func.go +++ /dev/null @@ -1,146 +0,0 @@ -package decoder - -import ( - "bytes" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type funcDecoder struct { - typ *runtime.Type - structName string - fieldName string -} - -func newFuncDecoder(typ *runtime.Type, structName, fieldName string) *funcDecoder { - fnDecoder := &funcDecoder{typ, structName, fieldName} - return fnDecoder -} - -func (d *funcDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - s.skipWhiteSpace() - start := s.cursor - if err := s.skipValue(depth); err != nil { - return err - } - src := s.buf[start:s.cursor] - if len(src) > 0 { - switch src[0] { - case '"': - return &errors.UnmarshalTypeError{ - Value: "string", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case '[': - return &errors.UnmarshalTypeError{ - Value: "array", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case '{': - return &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return &errors.UnmarshalTypeError{ - Value: "number", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case 'n': - if err := nullBytes(s); err != nil { - return err - } - *(*unsafe.Pointer)(p) = nil - return nil - case 't': - if err := trueBytes(s); err == nil { - return &errors.UnmarshalTypeError{ - Value: "boolean", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - } - case 'f': - if err := falseBytes(s); err == nil { - return &errors.UnmarshalTypeError{ - Value: "boolean", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - } - } - } - return errors.ErrInvalidBeginningOfValue(s.buf[s.cursor], s.totalOffset()) -} - -func (d *funcDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - src := buf[start:end] - if len(src) > 0 { - switch src[0] { - case '"': - return 0, &errors.UnmarshalTypeError{ - Value: "string", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case '[': - return 0, &errors.UnmarshalTypeError{ - Value: "array", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case '{': - return 0, &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return 0, &errors.UnmarshalTypeError{ - Value: "number", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case 'n': - if bytes.Equal(src, nullbytes) { - *(*unsafe.Pointer)(p) = nil - return end, nil - } - case 't': - if err := validateTrue(buf, start); err == nil { - return 0, &errors.UnmarshalTypeError{ - Value: "boolean", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - } - case 'f': - if err := validateFalse(buf, start); err == nil { - return 0, &errors.UnmarshalTypeError{ - Value: "boolean", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - } - } - } - return cursor, errors.ErrInvalidBeginningOfValue(buf[cursor], cursor) -} - -func (d *funcDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: func decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/int.go b/vendor/github.com/goccy/go-json/internal/decoder/int.go deleted file mode 100644 index 1a7f081994c..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/int.go +++ /dev/null @@ -1,246 +0,0 @@ -package decoder - -import ( - "fmt" - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type intDecoder struct { - typ *runtime.Type - kind reflect.Kind - op func(unsafe.Pointer, int64) - structName string - fieldName string -} - -func newIntDecoder(typ *runtime.Type, structName, fieldName string, op func(unsafe.Pointer, int64)) *intDecoder { - return &intDecoder{ - typ: typ, - kind: typ.Kind(), - op: op, - structName: structName, - fieldName: fieldName, - } -} - -func (d *intDecoder) typeError(buf []byte, offset int64) *errors.UnmarshalTypeError { - return &errors.UnmarshalTypeError{ - Value: fmt.Sprintf("number %s", string(buf)), - Type: runtime.RType2Type(d.typ), - Struct: d.structName, - Field: d.fieldName, - Offset: offset, - } -} - -var ( - pow10i64 = [...]int64{ - 1e00, 1e01, 1e02, 1e03, 1e04, 1e05, 1e06, 1e07, 1e08, 1e09, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, - } - pow10i64Len = len(pow10i64) -) - -func (d *intDecoder) parseInt(b []byte) (int64, error) { - isNegative := false - if b[0] == '-' { - b = b[1:] - isNegative = true - } - maxDigit := len(b) - if maxDigit > pow10i64Len { - return 0, fmt.Errorf("invalid length of number") - } - sum := int64(0) - for i := 0; i < maxDigit; i++ { - c := int64(b[i]) - 48 - digitValue := pow10i64[maxDigit-i-1] - sum += c * digitValue - } - if isNegative { - return -1 * sum, nil - } - return sum, nil -} - -var ( - numTable = [256]bool{ - '0': true, - '1': true, - '2': true, - '3': true, - '4': true, - '5': true, - '6': true, - '7': true, - '8': true, - '9': true, - } -) - -var ( - numZeroBuf = []byte{'0'} -) - -func (d *intDecoder) decodeStreamByte(s *Stream) ([]byte, error) { - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - s.cursor++ - continue - case '-': - start := s.cursor - for { - s.cursor++ - if numTable[s.char()] { - continue - } else if s.char() == nul { - if s.read() { - s.cursor-- // for retry current character - continue - } - } - break - } - num := s.buf[start:s.cursor] - if len(num) < 2 { - goto ERROR - } - return num, nil - case '0': - s.cursor++ - return numZeroBuf, nil - case '1', '2', '3', '4', '5', '6', '7', '8', '9': - start := s.cursor - for { - s.cursor++ - if numTable[s.char()] { - continue - } else if s.char() == nul { - if s.read() { - s.cursor-- // for retry current character - continue - } - } - break - } - num := s.buf[start:s.cursor] - return num, nil - case 'n': - if err := nullBytes(s); err != nil { - return nil, err - } - return nil, nil - case nul: - if s.read() { - continue - } - goto ERROR - default: - return nil, d.typeError([]byte{s.char()}, s.totalOffset()) - } - } -ERROR: - return nil, errors.ErrUnexpectedEndOfJSON("number(integer)", s.totalOffset()) -} - -func (d *intDecoder) decodeByte(buf []byte, cursor int64) ([]byte, int64, error) { - b := (*sliceHeader)(unsafe.Pointer(&buf)).data - for { - switch char(b, cursor) { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case '0': - cursor++ - return numZeroBuf, cursor, nil - case '-', '1', '2', '3', '4', '5', '6', '7', '8', '9': - start := cursor - cursor++ - for numTable[char(b, cursor)] { - cursor++ - } - num := buf[start:cursor] - return num, cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return nil, cursor, nil - default: - return nil, 0, d.typeError([]byte{char(b, cursor)}, cursor) - } - } -} - -func (d *intDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.decodeStreamByte(s) - if err != nil { - return err - } - if bytes == nil { - return nil - } - i64, err := d.parseInt(bytes) - if err != nil { - return d.typeError(bytes, s.totalOffset()) - } - switch d.kind { - case reflect.Int8: - if i64 < -1*(1<<7) || (1<<7) <= i64 { - return d.typeError(bytes, s.totalOffset()) - } - case reflect.Int16: - if i64 < -1*(1<<15) || (1<<15) <= i64 { - return d.typeError(bytes, s.totalOffset()) - } - case reflect.Int32: - if i64 < -1*(1<<31) || (1<<31) <= i64 { - return d.typeError(bytes, s.totalOffset()) - } - } - d.op(p, i64) - s.reset() - return nil -} - -func (d *intDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - bytes, c, err := d.decodeByte(ctx.Buf, cursor) - if err != nil { - return 0, err - } - if bytes == nil { - return c, nil - } - cursor = c - - i64, err := d.parseInt(bytes) - if err != nil { - return 0, d.typeError(bytes, cursor) - } - switch d.kind { - case reflect.Int8: - if i64 < -1*(1<<7) || (1<<7) <= i64 { - return 0, d.typeError(bytes, cursor) - } - case reflect.Int16: - if i64 < -1*(1<<15) || (1<<15) <= i64 { - return 0, d.typeError(bytes, cursor) - } - case reflect.Int32: - if i64 < -1*(1<<31) || (1<<31) <= i64 { - return 0, d.typeError(bytes, cursor) - } - } - d.op(p, i64) - return cursor, nil -} - -func (d *intDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: int decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/interface.go b/vendor/github.com/goccy/go-json/internal/decoder/interface.go deleted file mode 100644 index 45c69ab8c70..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/interface.go +++ /dev/null @@ -1,528 +0,0 @@ -package decoder - -import ( - "bytes" - "encoding" - "encoding/json" - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type interfaceDecoder struct { - typ *runtime.Type - structName string - fieldName string - sliceDecoder *sliceDecoder - mapDecoder *mapDecoder - floatDecoder *floatDecoder - numberDecoder *numberDecoder - stringDecoder *stringDecoder -} - -func newEmptyInterfaceDecoder(structName, fieldName string) *interfaceDecoder { - ifaceDecoder := &interfaceDecoder{ - typ: emptyInterfaceType, - structName: structName, - fieldName: fieldName, - floatDecoder: newFloatDecoder(structName, fieldName, func(p unsafe.Pointer, v float64) { - *(*interface{})(p) = v - }), - numberDecoder: newNumberDecoder(structName, fieldName, func(p unsafe.Pointer, v json.Number) { - *(*interface{})(p) = v - }), - stringDecoder: newStringDecoder(structName, fieldName), - } - ifaceDecoder.sliceDecoder = newSliceDecoder( - ifaceDecoder, - emptyInterfaceType, - emptyInterfaceType.Size(), - structName, fieldName, - ) - ifaceDecoder.mapDecoder = newMapDecoder( - interfaceMapType, - stringType, - ifaceDecoder.stringDecoder, - interfaceMapType.Elem(), - ifaceDecoder, - structName, - fieldName, - ) - return ifaceDecoder -} - -func newInterfaceDecoder(typ *runtime.Type, structName, fieldName string) *interfaceDecoder { - emptyIfaceDecoder := newEmptyInterfaceDecoder(structName, fieldName) - stringDecoder := newStringDecoder(structName, fieldName) - return &interfaceDecoder{ - typ: typ, - structName: structName, - fieldName: fieldName, - sliceDecoder: newSliceDecoder( - emptyIfaceDecoder, - emptyInterfaceType, - emptyInterfaceType.Size(), - structName, fieldName, - ), - mapDecoder: newMapDecoder( - interfaceMapType, - stringType, - stringDecoder, - interfaceMapType.Elem(), - emptyIfaceDecoder, - structName, - fieldName, - ), - floatDecoder: newFloatDecoder(structName, fieldName, func(p unsafe.Pointer, v float64) { - *(*interface{})(p) = v - }), - numberDecoder: newNumberDecoder(structName, fieldName, func(p unsafe.Pointer, v json.Number) { - *(*interface{})(p) = v - }), - stringDecoder: stringDecoder, - } -} - -func (d *interfaceDecoder) numDecoder(s *Stream) Decoder { - if s.UseNumber { - return d.numberDecoder - } - return d.floatDecoder -} - -var ( - emptyInterfaceType = runtime.Type2RType(reflect.TypeOf((*interface{})(nil)).Elem()) - EmptyInterfaceType = emptyInterfaceType - interfaceMapType = runtime.Type2RType( - reflect.TypeOf((*map[string]interface{})(nil)).Elem(), - ) - stringType = runtime.Type2RType( - reflect.TypeOf(""), - ) -) - -func decodeStreamUnmarshaler(s *Stream, depth int64, unmarshaler json.Unmarshaler) error { - start := s.cursor - if err := s.skipValue(depth); err != nil { - return err - } - src := s.buf[start:s.cursor] - dst := make([]byte, len(src)) - copy(dst, src) - - if err := unmarshaler.UnmarshalJSON(dst); err != nil { - return err - } - return nil -} - -func decodeStreamUnmarshalerContext(s *Stream, depth int64, unmarshaler unmarshalerContext) error { - start := s.cursor - if err := s.skipValue(depth); err != nil { - return err - } - src := s.buf[start:s.cursor] - dst := make([]byte, len(src)) - copy(dst, src) - - if err := unmarshaler.UnmarshalJSON(s.Option.Context, dst); err != nil { - return err - } - return nil -} - -func decodeUnmarshaler(buf []byte, cursor, depth int64, unmarshaler json.Unmarshaler) (int64, error) { - cursor = skipWhiteSpace(buf, cursor) - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - src := buf[start:end] - dst := make([]byte, len(src)) - copy(dst, src) - - if err := unmarshaler.UnmarshalJSON(dst); err != nil { - return 0, err - } - return end, nil -} - -func decodeUnmarshalerContext(ctx *RuntimeContext, buf []byte, cursor, depth int64, unmarshaler unmarshalerContext) (int64, error) { - cursor = skipWhiteSpace(buf, cursor) - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - src := buf[start:end] - dst := make([]byte, len(src)) - copy(dst, src) - - if err := unmarshaler.UnmarshalJSON(ctx.Option.Context, dst); err != nil { - return 0, err - } - return end, nil -} - -func decodeStreamTextUnmarshaler(s *Stream, depth int64, unmarshaler encoding.TextUnmarshaler, p unsafe.Pointer) error { - start := s.cursor - if err := s.skipValue(depth); err != nil { - return err - } - src := s.buf[start:s.cursor] - if bytes.Equal(src, nullbytes) { - *(*unsafe.Pointer)(p) = nil - return nil - } - - dst := make([]byte, len(src)) - copy(dst, src) - - if err := unmarshaler.UnmarshalText(dst); err != nil { - return err - } - return nil -} - -func decodeTextUnmarshaler(buf []byte, cursor, depth int64, unmarshaler encoding.TextUnmarshaler, p unsafe.Pointer) (int64, error) { - cursor = skipWhiteSpace(buf, cursor) - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - src := buf[start:end] - if bytes.Equal(src, nullbytes) { - *(*unsafe.Pointer)(p) = nil - return end, nil - } - if s, ok := unquoteBytes(src); ok { - src = s - } - if err := unmarshaler.UnmarshalText(src); err != nil { - return 0, err - } - return end, nil -} - -func (d *interfaceDecoder) decodeStreamEmptyInterface(s *Stream, depth int64, p unsafe.Pointer) error { - c := s.skipWhiteSpace() - for { - switch c { - case '{': - var v map[string]interface{} - ptr := unsafe.Pointer(&v) - if err := d.mapDecoder.DecodeStream(s, depth, ptr); err != nil { - return err - } - *(*interface{})(p) = v - return nil - case '[': - var v []interface{} - ptr := unsafe.Pointer(&v) - if err := d.sliceDecoder.DecodeStream(s, depth, ptr); err != nil { - return err - } - *(*interface{})(p) = v - return nil - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return d.numDecoder(s).DecodeStream(s, depth, p) - case '"': - s.cursor++ - start := s.cursor - for { - switch s.char() { - case '\\': - if _, err := decodeEscapeString(s, nil); err != nil { - return err - } - case '"': - literal := s.buf[start:s.cursor] - s.cursor++ - *(*interface{})(p) = string(literal) - return nil - case nul: - if s.read() { - continue - } - return errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - } - s.cursor++ - } - case 't': - if err := trueBytes(s); err != nil { - return err - } - **(**interface{})(unsafe.Pointer(&p)) = true - return nil - case 'f': - if err := falseBytes(s); err != nil { - return err - } - **(**interface{})(unsafe.Pointer(&p)) = false - return nil - case 'n': - if err := nullBytes(s); err != nil { - return err - } - *(*interface{})(p) = nil - return nil - case nul: - if s.read() { - c = s.char() - continue - } - } - break - } - return errors.ErrInvalidBeginningOfValue(c, s.totalOffset()) -} - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -func (d *interfaceDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - runtimeInterfaceValue := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: d.typ, - ptr: p, - })) - rv := reflect.ValueOf(runtimeInterfaceValue) - if rv.NumMethod() > 0 && rv.CanInterface() { - if u, ok := rv.Interface().(unmarshalerContext); ok { - return decodeStreamUnmarshalerContext(s, depth, u) - } - if u, ok := rv.Interface().(json.Unmarshaler); ok { - return decodeStreamUnmarshaler(s, depth, u) - } - if u, ok := rv.Interface().(encoding.TextUnmarshaler); ok { - return decodeStreamTextUnmarshaler(s, depth, u, p) - } - if s.skipWhiteSpace() == 'n' { - if err := nullBytes(s); err != nil { - return err - } - *(*interface{})(p) = nil - return nil - } - return d.errUnmarshalType(rv.Type(), s.totalOffset()) - } - iface := rv.Interface() - ifaceHeader := (*emptyInterface)(unsafe.Pointer(&iface)) - typ := ifaceHeader.typ - if ifaceHeader.ptr == nil || d.typ == typ || typ == nil { - // concrete type is empty interface - return d.decodeStreamEmptyInterface(s, depth, p) - } - if typ.Kind() == reflect.Ptr && typ.Elem() == d.typ || typ.Kind() != reflect.Ptr { - return d.decodeStreamEmptyInterface(s, depth, p) - } - if s.skipWhiteSpace() == 'n' { - if err := nullBytes(s); err != nil { - return err - } - *(*interface{})(p) = nil - return nil - } - decoder, err := CompileToGetDecoder(typ) - if err != nil { - return err - } - return decoder.DecodeStream(s, depth, ifaceHeader.ptr) -} - -func (d *interfaceDecoder) errUnmarshalType(typ reflect.Type, offset int64) *errors.UnmarshalTypeError { - return &errors.UnmarshalTypeError{ - Value: typ.String(), - Type: typ, - Offset: offset, - Struct: d.structName, - Field: d.fieldName, - } -} - -func (d *interfaceDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - runtimeInterfaceValue := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: d.typ, - ptr: p, - })) - rv := reflect.ValueOf(runtimeInterfaceValue) - if rv.NumMethod() > 0 && rv.CanInterface() { - if u, ok := rv.Interface().(unmarshalerContext); ok { - return decodeUnmarshalerContext(ctx, buf, cursor, depth, u) - } - if u, ok := rv.Interface().(json.Unmarshaler); ok { - return decodeUnmarshaler(buf, cursor, depth, u) - } - if u, ok := rv.Interface().(encoding.TextUnmarshaler); ok { - return decodeTextUnmarshaler(buf, cursor, depth, u, p) - } - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == 'n' { - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - **(**interface{})(unsafe.Pointer(&p)) = nil - return cursor, nil - } - return 0, d.errUnmarshalType(rv.Type(), cursor) - } - - iface := rv.Interface() - ifaceHeader := (*emptyInterface)(unsafe.Pointer(&iface)) - typ := ifaceHeader.typ - if ifaceHeader.ptr == nil || d.typ == typ || typ == nil { - // concrete type is empty interface - return d.decodeEmptyInterface(ctx, cursor, depth, p) - } - if typ.Kind() == reflect.Ptr && typ.Elem() == d.typ || typ.Kind() != reflect.Ptr { - return d.decodeEmptyInterface(ctx, cursor, depth, p) - } - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == 'n' { - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - **(**interface{})(unsafe.Pointer(&p)) = nil - return cursor, nil - } - decoder, err := CompileToGetDecoder(typ) - if err != nil { - return 0, err - } - return decoder.Decode(ctx, cursor, depth, ifaceHeader.ptr) -} - -func (d *interfaceDecoder) decodeEmptyInterface(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - switch buf[cursor] { - case '{': - var v map[string]interface{} - ptr := unsafe.Pointer(&v) - cursor, err := d.mapDecoder.Decode(ctx, cursor, depth, ptr) - if err != nil { - return 0, err - } - **(**interface{})(unsafe.Pointer(&p)) = v - return cursor, nil - case '[': - var v []interface{} - ptr := unsafe.Pointer(&v) - cursor, err := d.sliceDecoder.Decode(ctx, cursor, depth, ptr) - if err != nil { - return 0, err - } - **(**interface{})(unsafe.Pointer(&p)) = v - return cursor, nil - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return d.floatDecoder.Decode(ctx, cursor, depth, p) - case '"': - var v string - ptr := unsafe.Pointer(&v) - cursor, err := d.stringDecoder.Decode(ctx, cursor, depth, ptr) - if err != nil { - return 0, err - } - **(**interface{})(unsafe.Pointer(&p)) = v - return cursor, nil - case 't': - if err := validateTrue(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - **(**interface{})(unsafe.Pointer(&p)) = true - return cursor, nil - case 'f': - if err := validateFalse(buf, cursor); err != nil { - return 0, err - } - cursor += 5 - **(**interface{})(unsafe.Pointer(&p)) = false - return cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - **(**interface{})(unsafe.Pointer(&p)) = nil - return cursor, nil - } - return cursor, errors.ErrInvalidBeginningOfValue(buf[cursor], cursor) -} - -func NewPathDecoder() Decoder { - ifaceDecoder := &interfaceDecoder{ - typ: emptyInterfaceType, - structName: "", - fieldName: "", - floatDecoder: newFloatDecoder("", "", func(p unsafe.Pointer, v float64) { - *(*interface{})(p) = v - }), - numberDecoder: newNumberDecoder("", "", func(p unsafe.Pointer, v json.Number) { - *(*interface{})(p) = v - }), - stringDecoder: newStringDecoder("", ""), - } - ifaceDecoder.sliceDecoder = newSliceDecoder( - ifaceDecoder, - emptyInterfaceType, - emptyInterfaceType.Size(), - "", "", - ) - ifaceDecoder.mapDecoder = newMapDecoder( - interfaceMapType, - stringType, - ifaceDecoder.stringDecoder, - interfaceMapType.Elem(), - ifaceDecoder, - "", "", - ) - return ifaceDecoder -} - -var ( - truebytes = []byte("true") - falsebytes = []byte("false") -) - -func (d *interfaceDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - switch buf[cursor] { - case '{': - return d.mapDecoder.DecodePath(ctx, cursor, depth) - case '[': - return d.sliceDecoder.DecodePath(ctx, cursor, depth) - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return d.floatDecoder.DecodePath(ctx, cursor, depth) - case '"': - return d.stringDecoder.DecodePath(ctx, cursor, depth) - case 't': - if err := validateTrue(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return [][]byte{truebytes}, cursor, nil - case 'f': - if err := validateFalse(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 5 - return [][]byte{falsebytes}, cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return [][]byte{nullbytes}, cursor, nil - } - return nil, cursor, errors.ErrInvalidBeginningOfValue(buf[cursor], cursor) -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/invalid.go b/vendor/github.com/goccy/go-json/internal/decoder/invalid.go deleted file mode 100644 index 4c9721b0989..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/invalid.go +++ /dev/null @@ -1,55 +0,0 @@ -package decoder - -import ( - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type invalidDecoder struct { - typ *runtime.Type - kind reflect.Kind - structName string - fieldName string -} - -func newInvalidDecoder(typ *runtime.Type, structName, fieldName string) *invalidDecoder { - return &invalidDecoder{ - typ: typ, - kind: typ.Kind(), - structName: structName, - fieldName: fieldName, - } -} - -func (d *invalidDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - return &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - Struct: d.structName, - Field: d.fieldName, - } -} - -func (d *invalidDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - return 0, &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: cursor, - Struct: d.structName, - Field: d.fieldName, - } -} - -func (d *invalidDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: cursor, - Struct: d.structName, - Field: d.fieldName, - } -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/map.go b/vendor/github.com/goccy/go-json/internal/decoder/map.go deleted file mode 100644 index 07a9caea651..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/map.go +++ /dev/null @@ -1,280 +0,0 @@ -package decoder - -import ( - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type mapDecoder struct { - mapType *runtime.Type - keyType *runtime.Type - valueType *runtime.Type - canUseAssignFaststrType bool - keyDecoder Decoder - valueDecoder Decoder - structName string - fieldName string -} - -func newMapDecoder(mapType *runtime.Type, keyType *runtime.Type, keyDec Decoder, valueType *runtime.Type, valueDec Decoder, structName, fieldName string) *mapDecoder { - return &mapDecoder{ - mapType: mapType, - keyDecoder: keyDec, - keyType: keyType, - canUseAssignFaststrType: canUseAssignFaststrType(keyType, valueType), - valueType: valueType, - valueDecoder: valueDec, - structName: structName, - fieldName: fieldName, - } -} - -const ( - mapMaxElemSize = 128 -) - -// See detail: https://github.com/goccy/go-json/pull/283 -func canUseAssignFaststrType(key *runtime.Type, value *runtime.Type) bool { - indirectElem := value.Size() > mapMaxElemSize - if indirectElem { - return false - } - return key.Kind() == reflect.String -} - -//go:linkname makemap reflect.makemap -func makemap(*runtime.Type, int) unsafe.Pointer - -//nolint:golint -//go:linkname mapassign_faststr runtime.mapassign_faststr -//go:noescape -func mapassign_faststr(t *runtime.Type, m unsafe.Pointer, s string) unsafe.Pointer - -//go:linkname mapassign reflect.mapassign -//go:noescape -func mapassign(t *runtime.Type, m unsafe.Pointer, k, v unsafe.Pointer) - -func (d *mapDecoder) mapassign(t *runtime.Type, m, k, v unsafe.Pointer) { - if d.canUseAssignFaststrType { - mapV := mapassign_faststr(t, m, *(*string)(k)) - typedmemmove(d.valueType, mapV, v) - } else { - mapassign(t, m, k, v) - } -} - -func (d *mapDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - - switch s.skipWhiteSpace() { - case 'n': - if err := nullBytes(s); err != nil { - return err - } - **(**unsafe.Pointer)(unsafe.Pointer(&p)) = nil - return nil - case '{': - default: - return errors.ErrExpected("{ character for map value", s.totalOffset()) - } - mapValue := *(*unsafe.Pointer)(p) - if mapValue == nil { - mapValue = makemap(d.mapType, 0) - } - s.cursor++ - if s.skipWhiteSpace() == '}' { - *(*unsafe.Pointer)(p) = mapValue - s.cursor++ - return nil - } - for { - k := unsafe_New(d.keyType) - if err := d.keyDecoder.DecodeStream(s, depth, k); err != nil { - return err - } - s.skipWhiteSpace() - if !s.equalChar(':') { - return errors.ErrExpected("colon after object key", s.totalOffset()) - } - s.cursor++ - v := unsafe_New(d.valueType) - if err := d.valueDecoder.DecodeStream(s, depth, v); err != nil { - return err - } - d.mapassign(d.mapType, mapValue, k, v) - s.skipWhiteSpace() - if s.equalChar('}') { - **(**unsafe.Pointer)(unsafe.Pointer(&p)) = mapValue - s.cursor++ - return nil - } - if !s.equalChar(',') { - return errors.ErrExpected("comma after object value", s.totalOffset()) - } - s.cursor++ - } -} - -func (d *mapDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - - cursor = skipWhiteSpace(buf, cursor) - buflen := int64(len(buf)) - if buflen < 2 { - return 0, errors.ErrExpected("{} for map", cursor) - } - switch buf[cursor] { - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - **(**unsafe.Pointer)(unsafe.Pointer(&p)) = nil - return cursor, nil - case '{': - default: - return 0, errors.ErrExpected("{ character for map value", cursor) - } - cursor++ - cursor = skipWhiteSpace(buf, cursor) - mapValue := *(*unsafe.Pointer)(p) - if mapValue == nil { - mapValue = makemap(d.mapType, 0) - } - if buf[cursor] == '}' { - **(**unsafe.Pointer)(unsafe.Pointer(&p)) = mapValue - cursor++ - return cursor, nil - } - for { - k := unsafe_New(d.keyType) - keyCursor, err := d.keyDecoder.Decode(ctx, cursor, depth, k) - if err != nil { - return 0, err - } - cursor = skipWhiteSpace(buf, keyCursor) - if buf[cursor] != ':' { - return 0, errors.ErrExpected("colon after object key", cursor) - } - cursor++ - v := unsafe_New(d.valueType) - valueCursor, err := d.valueDecoder.Decode(ctx, cursor, depth, v) - if err != nil { - return 0, err - } - d.mapassign(d.mapType, mapValue, k, v) - cursor = skipWhiteSpace(buf, valueCursor) - if buf[cursor] == '}' { - **(**unsafe.Pointer)(unsafe.Pointer(&p)) = mapValue - cursor++ - return cursor, nil - } - if buf[cursor] != ',' { - return 0, errors.ErrExpected("comma after object value", cursor) - } - cursor++ - } -} - -func (d *mapDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - buf := ctx.Buf - depth++ - if depth > maxDecodeNestingDepth { - return nil, 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - - cursor = skipWhiteSpace(buf, cursor) - buflen := int64(len(buf)) - if buflen < 2 { - return nil, 0, errors.ErrExpected("{} for map", cursor) - } - switch buf[cursor] { - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return [][]byte{nullbytes}, cursor, nil - case '{': - default: - return nil, 0, errors.ErrExpected("{ character for map value", cursor) - } - cursor++ - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == '}' { - cursor++ - return nil, cursor, nil - } - keyDecoder, ok := d.keyDecoder.(*stringDecoder) - if !ok { - return nil, 0, &errors.UnmarshalTypeError{ - Value: "string", - Type: reflect.TypeOf(""), - Offset: cursor, - Struct: d.structName, - Field: d.fieldName, - } - } - ret := [][]byte{} - for { - key, keyCursor, err := keyDecoder.decodeByte(buf, cursor) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(buf, keyCursor) - if buf[cursor] != ':' { - return nil, 0, errors.ErrExpected("colon after object key", cursor) - } - cursor++ - child, found, err := ctx.Option.Path.Field(string(key)) - if err != nil { - return nil, 0, err - } - if found { - if child != nil { - oldPath := ctx.Option.Path.node - ctx.Option.Path.node = child - paths, c, err := d.valueDecoder.DecodePath(ctx, cursor, depth) - if err != nil { - return nil, 0, err - } - ctx.Option.Path.node = oldPath - ret = append(ret, paths...) - cursor = c - } else { - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return nil, 0, err - } - ret = append(ret, buf[start:end]) - cursor = end - } - } else { - c, err := skipValue(buf, cursor, depth) - if err != nil { - return nil, 0, err - } - cursor = c - } - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == '}' { - cursor++ - return ret, cursor, nil - } - if buf[cursor] != ',' { - return nil, 0, errors.ErrExpected("comma after object value", cursor) - } - cursor++ - } -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/number.go b/vendor/github.com/goccy/go-json/internal/decoder/number.go deleted file mode 100644 index 10e5435e6ce..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/number.go +++ /dev/null @@ -1,123 +0,0 @@ -package decoder - -import ( - "encoding/json" - "strconv" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -type numberDecoder struct { - stringDecoder *stringDecoder - op func(unsafe.Pointer, json.Number) - structName string - fieldName string -} - -func newNumberDecoder(structName, fieldName string, op func(unsafe.Pointer, json.Number)) *numberDecoder { - return &numberDecoder{ - stringDecoder: newStringDecoder(structName, fieldName), - op: op, - structName: structName, - fieldName: fieldName, - } -} - -func (d *numberDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.decodeStreamByte(s) - if err != nil { - return err - } - if _, err := strconv.ParseFloat(*(*string)(unsafe.Pointer(&bytes)), 64); err != nil { - return errors.ErrSyntax(err.Error(), s.totalOffset()) - } - d.op(p, json.Number(string(bytes))) - s.reset() - return nil -} - -func (d *numberDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - bytes, c, err := d.decodeByte(ctx.Buf, cursor) - if err != nil { - return 0, err - } - if _, err := strconv.ParseFloat(*(*string)(unsafe.Pointer(&bytes)), 64); err != nil { - return 0, errors.ErrSyntax(err.Error(), c) - } - cursor = c - s := *(*string)(unsafe.Pointer(&bytes)) - d.op(p, json.Number(s)) - return cursor, nil -} - -func (d *numberDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - bytes, c, err := d.decodeByte(ctx.Buf, cursor) - if err != nil { - return nil, 0, err - } - if bytes == nil { - return [][]byte{nullbytes}, c, nil - } - return [][]byte{bytes}, c, nil -} - -func (d *numberDecoder) decodeStreamByte(s *Stream) ([]byte, error) { - start := s.cursor - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - s.cursor++ - continue - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return floatBytes(s), nil - case 'n': - if err := nullBytes(s); err != nil { - return nil, err - } - return nil, nil - case '"': - return d.stringDecoder.decodeStreamByte(s) - case nul: - if s.read() { - continue - } - goto ERROR - default: - goto ERROR - } - } -ERROR: - if s.cursor == start { - return nil, errors.ErrInvalidBeginningOfValue(s.char(), s.totalOffset()) - } - return nil, errors.ErrUnexpectedEndOfJSON("json.Number", s.totalOffset()) -} - -func (d *numberDecoder) decodeByte(buf []byte, cursor int64) ([]byte, int64, error) { - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - start := cursor - cursor++ - for floatTable[buf[cursor]] { - cursor++ - } - num := buf[start:cursor] - return num, cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return nil, cursor, nil - case '"': - return d.stringDecoder.decodeByte(buf, cursor) - default: - return nil, 0, errors.ErrUnexpectedEndOfJSON("json.Number", cursor) - } - } -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/option.go b/vendor/github.com/goccy/go-json/internal/decoder/option.go deleted file mode 100644 index 502f772eba0..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/option.go +++ /dev/null @@ -1,17 +0,0 @@ -package decoder - -import "context" - -type OptionFlags uint8 - -const ( - FirstWinOption OptionFlags = 1 << iota - ContextOption - PathOption -) - -type Option struct { - Flags OptionFlags - Context context.Context - Path *Path -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/path.go b/vendor/github.com/goccy/go-json/internal/decoder/path.go deleted file mode 100644 index a15ff69e3cd..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/path.go +++ /dev/null @@ -1,670 +0,0 @@ -package decoder - -import ( - "fmt" - "reflect" - "strconv" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type PathString string - -func (s PathString) Build() (*Path, error) { - builder := new(PathBuilder) - return builder.Build([]rune(s)) -} - -type PathBuilder struct { - root PathNode - node PathNode - singleQuotePathSelector bool - doubleQuotePathSelector bool -} - -func (b *PathBuilder) Build(buf []rune) (*Path, error) { - node, err := b.build(buf) - if err != nil { - return nil, err - } - return &Path{ - node: node, - RootSelectorOnly: node == nil, - SingleQuotePathSelector: b.singleQuotePathSelector, - DoubleQuotePathSelector: b.doubleQuotePathSelector, - }, nil -} - -func (b *PathBuilder) build(buf []rune) (PathNode, error) { - if len(buf) == 0 { - return nil, errors.ErrEmptyPath() - } - if buf[0] != '$' { - return nil, errors.ErrInvalidPath("JSON Path must start with a $ character") - } - if len(buf) == 1 { - return nil, nil - } - buf = buf[1:] - offset, err := b.buildNext(buf) - if err != nil { - return nil, err - } - if len(buf) > offset { - return nil, errors.ErrInvalidPath("remain invalid path %q", buf[offset:]) - } - return b.root, nil -} - -func (b *PathBuilder) buildNextCharIfExists(buf []rune, cursor int) (int, error) { - if len(buf) > cursor { - offset, err := b.buildNext(buf[cursor:]) - if err != nil { - return 0, err - } - return cursor + 1 + offset, nil - } - return cursor, nil -} - -func (b *PathBuilder) buildNext(buf []rune) (int, error) { - switch buf[0] { - case '.': - if len(buf) == 1 { - return 0, errors.ErrInvalidPath("JSON Path ends with dot character") - } - offset, err := b.buildSelector(buf[1:]) - if err != nil { - return 0, err - } - return offset + 1, nil - case '[': - if len(buf) == 1 { - return 0, errors.ErrInvalidPath("JSON Path ends with left bracket character") - } - offset, err := b.buildIndex(buf[1:]) - if err != nil { - return 0, err - } - return offset + 1, nil - default: - return 0, errors.ErrInvalidPath("expect dot or left bracket character. but found %c character", buf[0]) - } -} - -func (b *PathBuilder) buildSelector(buf []rune) (int, error) { - switch buf[0] { - case '.': - if len(buf) == 1 { - return 0, errors.ErrInvalidPath("JSON Path ends with double dot character") - } - offset, err := b.buildPathRecursive(buf[1:]) - if err != nil { - return 0, err - } - return 1 + offset, nil - case '[', ']', '$', '*': - return 0, errors.ErrInvalidPath("found invalid path character %c after dot", buf[0]) - } - for cursor := 0; cursor < len(buf); cursor++ { - switch buf[cursor] { - case '$', '*', ']': - return 0, errors.ErrInvalidPath("found %c character in field selector context", buf[cursor]) - case '.': - if cursor+1 >= len(buf) { - return 0, errors.ErrInvalidPath("JSON Path ends with dot character") - } - selector := buf[:cursor] - b.addSelectorNode(string(selector)) - offset, err := b.buildSelector(buf[cursor+1:]) - if err != nil { - return 0, err - } - return cursor + 1 + offset, nil - case '[': - if cursor+1 >= len(buf) { - return 0, errors.ErrInvalidPath("JSON Path ends with left bracket character") - } - selector := buf[:cursor] - b.addSelectorNode(string(selector)) - offset, err := b.buildIndex(buf[cursor+1:]) - if err != nil { - return 0, err - } - return cursor + 1 + offset, nil - case '"': - if cursor+1 >= len(buf) { - return 0, errors.ErrInvalidPath("JSON Path ends with double quote character") - } - offset, err := b.buildQuoteSelector(buf[cursor+1:], DoubleQuotePathSelector) - if err != nil { - return 0, err - } - return cursor + 1 + offset, nil - } - } - b.addSelectorNode(string(buf)) - return len(buf), nil -} - -func (b *PathBuilder) buildQuoteSelector(buf []rune, sel QuotePathSelector) (int, error) { - switch buf[0] { - case '[', ']', '$', '.', '*', '\'', '"': - return 0, errors.ErrInvalidPath("found invalid path character %c after quote", buf[0]) - } - for cursor := 0; cursor < len(buf); cursor++ { - switch buf[cursor] { - case '\'': - if sel != SingleQuotePathSelector { - return 0, errors.ErrInvalidPath("found double quote character in field selector with single quote context") - } - if len(buf) <= cursor+1 { - return 0, errors.ErrInvalidPath("JSON Path ends with single quote character in field selector context") - } - if buf[cursor+1] != ']' { - return 0, errors.ErrInvalidPath("expect right bracket for field selector with single quote but found %c", buf[cursor+1]) - } - selector := buf[:cursor] - b.addSelectorNode(string(selector)) - b.singleQuotePathSelector = true - return b.buildNextCharIfExists(buf, cursor+2) - case '"': - if sel != DoubleQuotePathSelector { - return 0, errors.ErrInvalidPath("found single quote character in field selector with double quote context") - } - selector := buf[:cursor] - b.addSelectorNode(string(selector)) - b.doubleQuotePathSelector = true - return b.buildNextCharIfExists(buf, cursor+1) - } - } - return 0, errors.ErrInvalidPath("couldn't find quote character in selector quote path context") -} - -func (b *PathBuilder) buildPathRecursive(buf []rune) (int, error) { - switch buf[0] { - case '.', '[', ']', '$', '*': - return 0, errors.ErrInvalidPath("found invalid path character %c after double dot", buf[0]) - } - for cursor := 0; cursor < len(buf); cursor++ { - switch buf[cursor] { - case '$', '*', ']': - return 0, errors.ErrInvalidPath("found %c character in field selector context", buf[cursor]) - case '.': - if cursor+1 >= len(buf) { - return 0, errors.ErrInvalidPath("JSON Path ends with dot character") - } - selector := buf[:cursor] - b.addRecursiveNode(string(selector)) - offset, err := b.buildSelector(buf[cursor+1:]) - if err != nil { - return 0, err - } - return cursor + 1 + offset, nil - case '[': - if cursor+1 >= len(buf) { - return 0, errors.ErrInvalidPath("JSON Path ends with left bracket character") - } - selector := buf[:cursor] - b.addRecursiveNode(string(selector)) - offset, err := b.buildIndex(buf[cursor+1:]) - if err != nil { - return 0, err - } - return cursor + 1 + offset, nil - } - } - b.addRecursiveNode(string(buf)) - return len(buf), nil -} - -func (b *PathBuilder) buildIndex(buf []rune) (int, error) { - switch buf[0] { - case '.', '[', ']', '$': - return 0, errors.ErrInvalidPath("found invalid path character %c after left bracket", buf[0]) - case '\'': - if len(buf) == 1 { - return 0, errors.ErrInvalidPath("JSON Path ends with single quote character") - } - offset, err := b.buildQuoteSelector(buf[1:], SingleQuotePathSelector) - if err != nil { - return 0, err - } - return 1 + offset, nil - case '*': - if len(buf) == 1 { - return 0, errors.ErrInvalidPath("JSON Path ends with star character") - } - if buf[1] != ']' { - return 0, errors.ErrInvalidPath("expect right bracket character for index all path but found %c character", buf[1]) - } - b.addIndexAllNode() - offset := len("*]") - if len(buf) > 2 { - buildOffset, err := b.buildNext(buf[2:]) - if err != nil { - return 0, err - } - return offset + buildOffset, nil - } - return offset, nil - } - - for cursor := 0; cursor < len(buf); cursor++ { - switch buf[cursor] { - case ']': - index, err := strconv.ParseInt(string(buf[:cursor]), 10, 64) - if err != nil { - return 0, errors.ErrInvalidPath("%q is unexpected index path", buf[:cursor]) - } - b.addIndexNode(int(index)) - return b.buildNextCharIfExists(buf, cursor+1) - } - } - return 0, errors.ErrInvalidPath("couldn't find right bracket character in index path context") -} - -func (b *PathBuilder) addIndexAllNode() { - node := newPathIndexAllNode() - if b.root == nil { - b.root = node - b.node = node - } else { - b.node = b.node.chain(node) - } -} - -func (b *PathBuilder) addRecursiveNode(selector string) { - node := newPathRecursiveNode(selector) - if b.root == nil { - b.root = node - b.node = node - } else { - b.node = b.node.chain(node) - } -} - -func (b *PathBuilder) addSelectorNode(name string) { - node := newPathSelectorNode(name) - if b.root == nil { - b.root = node - b.node = node - } else { - b.node = b.node.chain(node) - } -} - -func (b *PathBuilder) addIndexNode(idx int) { - node := newPathIndexNode(idx) - if b.root == nil { - b.root = node - b.node = node - } else { - b.node = b.node.chain(node) - } -} - -type QuotePathSelector int - -const ( - SingleQuotePathSelector QuotePathSelector = 1 - DoubleQuotePathSelector QuotePathSelector = 2 -) - -type Path struct { - node PathNode - RootSelectorOnly bool - SingleQuotePathSelector bool - DoubleQuotePathSelector bool -} - -func (p *Path) Field(sel string) (PathNode, bool, error) { - if p.node == nil { - return nil, false, nil - } - return p.node.Field(sel) -} - -func (p *Path) Get(src, dst reflect.Value) error { - if p.node == nil { - return nil - } - return p.node.Get(src, dst) -} - -func (p *Path) String() string { - if p.node == nil { - return "$" - } - return p.node.String() -} - -type PathNode interface { - fmt.Stringer - Index(idx int) (PathNode, bool, error) - Field(fieldName string) (PathNode, bool, error) - Get(src, dst reflect.Value) error - chain(PathNode) PathNode - target() bool - single() bool -} - -type BasePathNode struct { - child PathNode -} - -func (n *BasePathNode) chain(node PathNode) PathNode { - n.child = node - return node -} - -func (n *BasePathNode) target() bool { - return n.child == nil -} - -func (n *BasePathNode) single() bool { - return true -} - -type PathSelectorNode struct { - *BasePathNode - selector string -} - -func newPathSelectorNode(selector string) *PathSelectorNode { - return &PathSelectorNode{ - BasePathNode: &BasePathNode{}, - selector: selector, - } -} - -func (n *PathSelectorNode) Index(idx int) (PathNode, bool, error) { - return nil, false, &errors.PathError{} -} - -func (n *PathSelectorNode) Field(fieldName string) (PathNode, bool, error) { - if n.selector == fieldName { - return n.child, true, nil - } - return nil, false, nil -} - -func (n *PathSelectorNode) Get(src, dst reflect.Value) error { - switch src.Type().Kind() { - case reflect.Map: - iter := src.MapRange() - for iter.Next() { - key, ok := iter.Key().Interface().(string) - if !ok { - return fmt.Errorf("invalid map key type %T", src.Type().Key()) - } - child, found, err := n.Field(key) - if err != nil { - return err - } - if found { - if child != nil { - return child.Get(iter.Value(), dst) - } - return AssignValue(iter.Value(), dst) - } - } - case reflect.Struct: - typ := src.Type() - for i := 0; i < typ.Len(); i++ { - tag := runtime.StructTagFromField(typ.Field(i)) - child, found, err := n.Field(tag.Key) - if err != nil { - return err - } - if found { - if child != nil { - return child.Get(src.Field(i), dst) - } - return AssignValue(src.Field(i), dst) - } - } - case reflect.Ptr: - return n.Get(src.Elem(), dst) - case reflect.Interface: - return n.Get(reflect.ValueOf(src.Interface()), dst) - case reflect.Float64, reflect.String, reflect.Bool: - return AssignValue(src, dst) - } - return fmt.Errorf("failed to get %s value from %s", n.selector, src.Type()) -} - -func (n *PathSelectorNode) String() string { - s := fmt.Sprintf(".%s", n.selector) - if n.child != nil { - s += n.child.String() - } - return s -} - -type PathIndexNode struct { - *BasePathNode - selector int -} - -func newPathIndexNode(selector int) *PathIndexNode { - return &PathIndexNode{ - BasePathNode: &BasePathNode{}, - selector: selector, - } -} - -func (n *PathIndexNode) Index(idx int) (PathNode, bool, error) { - if n.selector == idx { - return n.child, true, nil - } - return nil, false, nil -} - -func (n *PathIndexNode) Field(fieldName string) (PathNode, bool, error) { - return nil, false, &errors.PathError{} -} - -func (n *PathIndexNode) Get(src, dst reflect.Value) error { - switch src.Type().Kind() { - case reflect.Array, reflect.Slice: - if src.Len() > n.selector { - if n.child != nil { - return n.child.Get(src.Index(n.selector), dst) - } - return AssignValue(src.Index(n.selector), dst) - } - case reflect.Ptr: - return n.Get(src.Elem(), dst) - case reflect.Interface: - return n.Get(reflect.ValueOf(src.Interface()), dst) - } - return fmt.Errorf("failed to get [%d] value from %s", n.selector, src.Type()) -} - -func (n *PathIndexNode) String() string { - s := fmt.Sprintf("[%d]", n.selector) - if n.child != nil { - s += n.child.String() - } - return s -} - -type PathIndexAllNode struct { - *BasePathNode -} - -func newPathIndexAllNode() *PathIndexAllNode { - return &PathIndexAllNode{ - BasePathNode: &BasePathNode{}, - } -} - -func (n *PathIndexAllNode) Index(idx int) (PathNode, bool, error) { - return n.child, true, nil -} - -func (n *PathIndexAllNode) Field(fieldName string) (PathNode, bool, error) { - return nil, false, &errors.PathError{} -} - -func (n *PathIndexAllNode) Get(src, dst reflect.Value) error { - switch src.Type().Kind() { - case reflect.Array, reflect.Slice: - var arr []interface{} - for i := 0; i < src.Len(); i++ { - var v interface{} - rv := reflect.ValueOf(&v) - if n.child != nil { - if err := n.child.Get(src.Index(i), rv); err != nil { - return err - } - } else { - if err := AssignValue(src.Index(i), rv); err != nil { - return err - } - } - arr = append(arr, v) - } - if err := AssignValue(reflect.ValueOf(arr), dst); err != nil { - return err - } - return nil - case reflect.Ptr: - return n.Get(src.Elem(), dst) - case reflect.Interface: - return n.Get(reflect.ValueOf(src.Interface()), dst) - } - return fmt.Errorf("failed to get all value from %s", src.Type()) -} - -func (n *PathIndexAllNode) String() string { - s := "[*]" - if n.child != nil { - s += n.child.String() - } - return s -} - -type PathRecursiveNode struct { - *BasePathNode - selector string -} - -func newPathRecursiveNode(selector string) *PathRecursiveNode { - node := newPathSelectorNode(selector) - return &PathRecursiveNode{ - BasePathNode: &BasePathNode{ - child: node, - }, - selector: selector, - } -} - -func (n *PathRecursiveNode) Field(fieldName string) (PathNode, bool, error) { - if n.selector == fieldName { - return n.child, true, nil - } - return nil, false, nil -} - -func (n *PathRecursiveNode) Index(_ int) (PathNode, bool, error) { - return n, true, nil -} - -func valueToSliceValue(v interface{}) []interface{} { - rv := reflect.ValueOf(v) - ret := []interface{}{} - if rv.Type().Kind() == reflect.Slice || rv.Type().Kind() == reflect.Array { - for i := 0; i < rv.Len(); i++ { - ret = append(ret, rv.Index(i).Interface()) - } - return ret - } - return []interface{}{v} -} - -func (n *PathRecursiveNode) Get(src, dst reflect.Value) error { - if n.child == nil { - return fmt.Errorf("failed to get by recursive path ..%s", n.selector) - } - var arr []interface{} - switch src.Type().Kind() { - case reflect.Map: - iter := src.MapRange() - for iter.Next() { - key, ok := iter.Key().Interface().(string) - if !ok { - return fmt.Errorf("invalid map key type %T", src.Type().Key()) - } - child, found, err := n.Field(key) - if err != nil { - return err - } - if found { - var v interface{} - rv := reflect.ValueOf(&v) - _ = child.Get(iter.Value(), rv) - arr = append(arr, valueToSliceValue(v)...) - } else { - var v interface{} - rv := reflect.ValueOf(&v) - _ = n.Get(iter.Value(), rv) - if v != nil { - arr = append(arr, valueToSliceValue(v)...) - } - } - } - _ = AssignValue(reflect.ValueOf(arr), dst) - return nil - case reflect.Struct: - typ := src.Type() - for i := 0; i < typ.Len(); i++ { - tag := runtime.StructTagFromField(typ.Field(i)) - child, found, err := n.Field(tag.Key) - if err != nil { - return err - } - if found { - var v interface{} - rv := reflect.ValueOf(&v) - _ = child.Get(src.Field(i), rv) - arr = append(arr, valueToSliceValue(v)...) - } else { - var v interface{} - rv := reflect.ValueOf(&v) - _ = n.Get(src.Field(i), rv) - if v != nil { - arr = append(arr, valueToSliceValue(v)...) - } - } - } - _ = AssignValue(reflect.ValueOf(arr), dst) - return nil - case reflect.Array, reflect.Slice: - for i := 0; i < src.Len(); i++ { - var v interface{} - rv := reflect.ValueOf(&v) - _ = n.Get(src.Index(i), rv) - if v != nil { - arr = append(arr, valueToSliceValue(v)...) - } - } - _ = AssignValue(reflect.ValueOf(arr), dst) - return nil - case reflect.Ptr: - return n.Get(src.Elem(), dst) - case reflect.Interface: - return n.Get(reflect.ValueOf(src.Interface()), dst) - } - return fmt.Errorf("failed to get %s value from %s", n.selector, src.Type()) -} - -func (n *PathRecursiveNode) String() string { - s := fmt.Sprintf("..%s", n.selector) - if n.child != nil { - s += n.child.String() - } - return s -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/ptr.go b/vendor/github.com/goccy/go-json/internal/decoder/ptr.go deleted file mode 100644 index ae2299466af..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/ptr.go +++ /dev/null @@ -1,97 +0,0 @@ -package decoder - -import ( - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -type ptrDecoder struct { - dec Decoder - typ *runtime.Type - structName string - fieldName string -} - -func newPtrDecoder(dec Decoder, typ *runtime.Type, structName, fieldName string) *ptrDecoder { - return &ptrDecoder{ - dec: dec, - typ: typ, - structName: structName, - fieldName: fieldName, - } -} - -func (d *ptrDecoder) contentDecoder() Decoder { - dec, ok := d.dec.(*ptrDecoder) - if !ok { - return d.dec - } - return dec.contentDecoder() -} - -//nolint:golint -//go:linkname unsafe_New reflect.unsafe_New -func unsafe_New(*runtime.Type) unsafe.Pointer - -func UnsafeNew(t *runtime.Type) unsafe.Pointer { - return unsafe_New(t) -} - -func (d *ptrDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - if s.skipWhiteSpace() == nul { - s.read() - } - if s.char() == 'n' { - if err := nullBytes(s); err != nil { - return err - } - *(*unsafe.Pointer)(p) = nil - return nil - } - var newptr unsafe.Pointer - if *(*unsafe.Pointer)(p) == nil { - newptr = unsafe_New(d.typ) - *(*unsafe.Pointer)(p) = newptr - } else { - newptr = *(*unsafe.Pointer)(p) - } - if err := d.dec.DecodeStream(s, depth, newptr); err != nil { - return err - } - return nil -} - -func (d *ptrDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == 'n' { - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - if p != nil { - *(*unsafe.Pointer)(p) = nil - } - cursor += 4 - return cursor, nil - } - var newptr unsafe.Pointer - if *(*unsafe.Pointer)(p) == nil { - newptr = unsafe_New(d.typ) - *(*unsafe.Pointer)(p) = newptr - } else { - newptr = *(*unsafe.Pointer)(p) - } - c, err := d.dec.Decode(ctx, cursor, depth, newptr) - if err != nil { - *(*unsafe.Pointer)(p) = nil - return 0, err - } - cursor = c - return cursor, nil -} - -func (d *ptrDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: ptr decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/slice.go b/vendor/github.com/goccy/go-json/internal/decoder/slice.go deleted file mode 100644 index 30a23e4b51e..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/slice.go +++ /dev/null @@ -1,380 +0,0 @@ -package decoder - -import ( - "reflect" - "sync" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -var ( - sliceType = runtime.Type2RType( - reflect.TypeOf((*sliceHeader)(nil)).Elem(), - ) - nilSlice = unsafe.Pointer(&sliceHeader{}) -) - -type sliceDecoder struct { - elemType *runtime.Type - isElemPointerType bool - valueDecoder Decoder - size uintptr - arrayPool sync.Pool - structName string - fieldName string -} - -// If use reflect.SliceHeader, data type is uintptr. -// In this case, Go compiler cannot trace reference created by newArray(). -// So, define using unsafe.Pointer as data type -type sliceHeader struct { - data unsafe.Pointer - len int - cap int -} - -const ( - defaultSliceCapacity = 2 -) - -func newSliceDecoder(dec Decoder, elemType *runtime.Type, size uintptr, structName, fieldName string) *sliceDecoder { - return &sliceDecoder{ - valueDecoder: dec, - elemType: elemType, - isElemPointerType: elemType.Kind() == reflect.Ptr || elemType.Kind() == reflect.Map, - size: size, - arrayPool: sync.Pool{ - New: func() interface{} { - return &sliceHeader{ - data: newArray(elemType, defaultSliceCapacity), - len: 0, - cap: defaultSliceCapacity, - } - }, - }, - structName: structName, - fieldName: fieldName, - } -} - -func (d *sliceDecoder) newSlice(src *sliceHeader) *sliceHeader { - slice := d.arrayPool.Get().(*sliceHeader) - if src.len > 0 { - // copy original elem - if slice.cap < src.cap { - data := newArray(d.elemType, src.cap) - slice = &sliceHeader{data: data, len: src.len, cap: src.cap} - } else { - slice.len = src.len - } - copySlice(d.elemType, *slice, *src) - } else { - slice.len = 0 - } - return slice -} - -func (d *sliceDecoder) releaseSlice(p *sliceHeader) { - d.arrayPool.Put(p) -} - -//go:linkname copySlice reflect.typedslicecopy -func copySlice(elemType *runtime.Type, dst, src sliceHeader) int - -//go:linkname newArray reflect.unsafe_NewArray -func newArray(*runtime.Type, int) unsafe.Pointer - -//go:linkname typedmemmove reflect.typedmemmove -func typedmemmove(t *runtime.Type, dst, src unsafe.Pointer) - -func (d *sliceDecoder) errNumber(offset int64) *errors.UnmarshalTypeError { - return &errors.UnmarshalTypeError{ - Value: "number", - Type: reflect.SliceOf(runtime.RType2Type(d.elemType)), - Struct: d.structName, - Field: d.fieldName, - Offset: offset, - } -} - -func (d *sliceDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - s.cursor++ - continue - case 'n': - if err := nullBytes(s); err != nil { - return err - } - typedmemmove(sliceType, p, nilSlice) - return nil - case '[': - s.cursor++ - if s.skipWhiteSpace() == ']' { - dst := (*sliceHeader)(p) - if dst.data == nil { - dst.data = newArray(d.elemType, 0) - } else { - dst.len = 0 - } - s.cursor++ - return nil - } - idx := 0 - slice := d.newSlice((*sliceHeader)(p)) - srcLen := slice.len - capacity := slice.cap - data := slice.data - for { - if capacity <= idx { - src := sliceHeader{data: data, len: idx, cap: capacity} - capacity *= 2 - data = newArray(d.elemType, capacity) - dst := sliceHeader{data: data, len: idx, cap: capacity} - copySlice(d.elemType, dst, src) - } - ep := unsafe.Pointer(uintptr(data) + uintptr(idx)*d.size) - - // if srcLen is greater than idx, keep the original reference - if srcLen <= idx { - if d.isElemPointerType { - **(**unsafe.Pointer)(unsafe.Pointer(&ep)) = nil // initialize elem pointer - } else { - // assign new element to the slice - typedmemmove(d.elemType, ep, unsafe_New(d.elemType)) - } - } - - if err := d.valueDecoder.DecodeStream(s, depth, ep); err != nil { - return err - } - s.skipWhiteSpace() - RETRY: - switch s.char() { - case ']': - slice.cap = capacity - slice.len = idx + 1 - slice.data = data - dst := (*sliceHeader)(p) - dst.len = idx + 1 - if dst.len > dst.cap { - dst.data = newArray(d.elemType, dst.len) - dst.cap = dst.len - } - copySlice(d.elemType, *dst, *slice) - d.releaseSlice(slice) - s.cursor++ - return nil - case ',': - idx++ - case nul: - if s.read() { - goto RETRY - } - slice.cap = capacity - slice.data = data - d.releaseSlice(slice) - goto ERROR - default: - slice.cap = capacity - slice.data = data - d.releaseSlice(slice) - goto ERROR - } - s.cursor++ - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return d.errNumber(s.totalOffset()) - case nul: - if s.read() { - continue - } - goto ERROR - default: - goto ERROR - } - } -ERROR: - return errors.ErrUnexpectedEndOfJSON("slice", s.totalOffset()) -} - -func (d *sliceDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - typedmemmove(sliceType, p, nilSlice) - return cursor, nil - case '[': - cursor++ - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == ']' { - dst := (*sliceHeader)(p) - if dst.data == nil { - dst.data = newArray(d.elemType, 0) - } else { - dst.len = 0 - } - cursor++ - return cursor, nil - } - idx := 0 - slice := d.newSlice((*sliceHeader)(p)) - srcLen := slice.len - capacity := slice.cap - data := slice.data - for { - if capacity <= idx { - src := sliceHeader{data: data, len: idx, cap: capacity} - capacity *= 2 - data = newArray(d.elemType, capacity) - dst := sliceHeader{data: data, len: idx, cap: capacity} - copySlice(d.elemType, dst, src) - } - ep := unsafe.Pointer(uintptr(data) + uintptr(idx)*d.size) - // if srcLen is greater than idx, keep the original reference - if srcLen <= idx { - if d.isElemPointerType { - **(**unsafe.Pointer)(unsafe.Pointer(&ep)) = nil // initialize elem pointer - } else { - // assign new element to the slice - typedmemmove(d.elemType, ep, unsafe_New(d.elemType)) - } - } - c, err := d.valueDecoder.Decode(ctx, cursor, depth, ep) - if err != nil { - return 0, err - } - cursor = c - cursor = skipWhiteSpace(buf, cursor) - switch buf[cursor] { - case ']': - slice.cap = capacity - slice.len = idx + 1 - slice.data = data - dst := (*sliceHeader)(p) - dst.len = idx + 1 - if dst.len > dst.cap { - dst.data = newArray(d.elemType, dst.len) - dst.cap = dst.len - } - copySlice(d.elemType, *dst, *slice) - d.releaseSlice(slice) - cursor++ - return cursor, nil - case ',': - idx++ - default: - slice.cap = capacity - slice.data = data - d.releaseSlice(slice) - return 0, errors.ErrInvalidCharacter(buf[cursor], "slice", cursor) - } - cursor++ - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return 0, d.errNumber(cursor) - default: - return 0, errors.ErrUnexpectedEndOfJSON("slice", cursor) - } - } -} - -func (d *sliceDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - buf := ctx.Buf - depth++ - if depth > maxDecodeNestingDepth { - return nil, 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - - ret := [][]byte{} - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return [][]byte{nullbytes}, cursor, nil - case '[': - cursor++ - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == ']' { - cursor++ - return ret, cursor, nil - } - idx := 0 - for { - child, found, err := ctx.Option.Path.node.Index(idx) - if err != nil { - return nil, 0, err - } - if found { - if child != nil { - oldPath := ctx.Option.Path.node - ctx.Option.Path.node = child - paths, c, err := d.valueDecoder.DecodePath(ctx, cursor, depth) - if err != nil { - return nil, 0, err - } - ctx.Option.Path.node = oldPath - ret = append(ret, paths...) - cursor = c - } else { - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return nil, 0, err - } - ret = append(ret, buf[start:end]) - cursor = end - } - } else { - c, err := skipValue(buf, cursor, depth) - if err != nil { - return nil, 0, err - } - cursor = c - } - cursor = skipWhiteSpace(buf, cursor) - switch buf[cursor] { - case ']': - cursor++ - return ret, cursor, nil - case ',': - idx++ - default: - return nil, 0, errors.ErrInvalidCharacter(buf[cursor], "slice", cursor) - } - cursor++ - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return nil, 0, d.errNumber(cursor) - default: - return nil, 0, errors.ErrUnexpectedEndOfJSON("slice", cursor) - } - } -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/stream.go b/vendor/github.com/goccy/go-json/internal/decoder/stream.go deleted file mode 100644 index a383f725969..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/stream.go +++ /dev/null @@ -1,556 +0,0 @@ -package decoder - -import ( - "bytes" - "encoding/json" - "io" - "strconv" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -const ( - initBufSize = 512 -) - -type Stream struct { - buf []byte - bufSize int64 - length int64 - r io.Reader - offset int64 - cursor int64 - filledBuffer bool - allRead bool - UseNumber bool - DisallowUnknownFields bool - Option *Option -} - -func NewStream(r io.Reader) *Stream { - return &Stream{ - r: r, - bufSize: initBufSize, - buf: make([]byte, initBufSize), - Option: &Option{}, - } -} - -func (s *Stream) TotalOffset() int64 { - return s.totalOffset() -} - -func (s *Stream) Buffered() io.Reader { - buflen := int64(len(s.buf)) - for i := s.cursor; i < buflen; i++ { - if s.buf[i] == nul { - return bytes.NewReader(s.buf[s.cursor:i]) - } - } - return bytes.NewReader(s.buf[s.cursor:]) -} - -func (s *Stream) PrepareForDecode() error { - for { - switch s.char() { - case ' ', '\t', '\r', '\n': - s.cursor++ - continue - case ',', ':': - s.cursor++ - return nil - case nul: - if s.read() { - continue - } - return io.EOF - } - break - } - return nil -} - -func (s *Stream) totalOffset() int64 { - return s.offset + s.cursor -} - -func (s *Stream) char() byte { - return s.buf[s.cursor] -} - -func (s *Stream) equalChar(c byte) bool { - cur := s.buf[s.cursor] - if cur == nul { - s.read() - cur = s.buf[s.cursor] - } - return cur == c -} - -func (s *Stream) stat() ([]byte, int64, unsafe.Pointer) { - return s.buf, s.cursor, (*sliceHeader)(unsafe.Pointer(&s.buf)).data -} - -func (s *Stream) bufptr() unsafe.Pointer { - return (*sliceHeader)(unsafe.Pointer(&s.buf)).data -} - -func (s *Stream) statForRetry() ([]byte, int64, unsafe.Pointer) { - s.cursor-- // for retry ( because caller progress cursor position in each loop ) - return s.buf, s.cursor, (*sliceHeader)(unsafe.Pointer(&s.buf)).data -} - -func (s *Stream) Reset() { - s.reset() - s.bufSize = int64(len(s.buf)) -} - -func (s *Stream) More() bool { - for { - switch s.char() { - case ' ', '\n', '\r', '\t': - s.cursor++ - continue - case '}', ']': - return false - case nul: - if s.read() { - continue - } - return false - } - break - } - return true -} - -func (s *Stream) Token() (interface{}, error) { - for { - c := s.char() - switch c { - case ' ', '\n', '\r', '\t': - s.cursor++ - case '{', '[', ']', '}': - s.cursor++ - return json.Delim(c), nil - case ',', ':': - s.cursor++ - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - bytes := floatBytes(s) - str := *(*string)(unsafe.Pointer(&bytes)) - if s.UseNumber { - return json.Number(str), nil - } - f64, err := strconv.ParseFloat(str, 64) - if err != nil { - return nil, err - } - return f64, nil - case '"': - bytes, err := stringBytes(s) - if err != nil { - return nil, err - } - return string(bytes), nil - case 't': - if err := trueBytes(s); err != nil { - return nil, err - } - return true, nil - case 'f': - if err := falseBytes(s); err != nil { - return nil, err - } - return false, nil - case 'n': - if err := nullBytes(s); err != nil { - return nil, err - } - return nil, nil - case nul: - if s.read() { - continue - } - goto END - default: - return nil, errors.ErrInvalidCharacter(s.char(), "token", s.totalOffset()) - } - } -END: - return nil, io.EOF -} - -func (s *Stream) reset() { - s.offset += s.cursor - s.buf = s.buf[s.cursor:] - s.length -= s.cursor - s.cursor = 0 -} - -func (s *Stream) readBuf() []byte { - if s.filledBuffer { - s.bufSize *= 2 - remainBuf := s.buf - s.buf = make([]byte, s.bufSize) - copy(s.buf, remainBuf) - } - remainLen := s.length - s.cursor - remainNotNulCharNum := int64(0) - for i := int64(0); i < remainLen; i++ { - if s.buf[s.cursor+i] == nul { - break - } - remainNotNulCharNum++ - } - s.length = s.cursor + remainNotNulCharNum - return s.buf[s.cursor+remainNotNulCharNum:] -} - -func (s *Stream) read() bool { - if s.allRead { - return false - } - buf := s.readBuf() - last := len(buf) - 1 - buf[last] = nul - n, err := s.r.Read(buf[:last]) - s.length += int64(n) - if n == last { - s.filledBuffer = true - } else { - s.filledBuffer = false - } - if err == io.EOF { - s.allRead = true - } else if err != nil { - return false - } - return true -} - -func (s *Stream) skipWhiteSpace() byte { - p := s.bufptr() -LOOP: - c := char(p, s.cursor) - switch c { - case ' ', '\n', '\t', '\r': - s.cursor++ - goto LOOP - case nul: - if s.read() { - p = s.bufptr() - goto LOOP - } - } - return c -} - -func (s *Stream) skipObject(depth int64) error { - braceCount := 1 - _, cursor, p := s.stat() - for { - switch char(p, cursor) { - case '{': - braceCount++ - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - case '}': - braceCount-- - depth-- - if braceCount == 0 { - s.cursor = cursor + 1 - return nil - } - case '[': - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - case ']': - depth-- - case '"': - for { - cursor++ - switch char(p, cursor) { - case '\\': - cursor++ - if char(p, cursor) == nul { - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - case '"': - goto SWITCH_OUT - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.statForRetry() - continue - } - return errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - } - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return errors.ErrUnexpectedEndOfJSON("object of object", cursor) - } - SWITCH_OUT: - cursor++ - } -} - -func (s *Stream) skipArray(depth int64) error { - bracketCount := 1 - _, cursor, p := s.stat() - for { - switch char(p, cursor) { - case '[': - bracketCount++ - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - case ']': - bracketCount-- - depth-- - if bracketCount == 0 { - s.cursor = cursor + 1 - return nil - } - case '{': - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - case '}': - depth-- - case '"': - for { - cursor++ - switch char(p, cursor) { - case '\\': - cursor++ - if char(p, cursor) == nul { - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - case '"': - goto SWITCH_OUT - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.statForRetry() - continue - } - return errors.ErrUnexpectedEndOfJSON("string of object", cursor) - } - } - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return errors.ErrUnexpectedEndOfJSON("array of object", cursor) - } - SWITCH_OUT: - cursor++ - } -} - -func (s *Stream) skipValue(depth int64) error { - _, cursor, p := s.stat() - for { - switch char(p, cursor) { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return errors.ErrUnexpectedEndOfJSON("value of object", s.totalOffset()) - case '{': - s.cursor = cursor + 1 - return s.skipObject(depth + 1) - case '[': - s.cursor = cursor + 1 - return s.skipArray(depth + 1) - case '"': - for { - cursor++ - switch char(p, cursor) { - case '\\': - cursor++ - if char(p, cursor) == nul { - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return errors.ErrUnexpectedEndOfJSON("value of string", s.totalOffset()) - } - case '"': - s.cursor = cursor + 1 - return nil - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.statForRetry() - continue - } - return errors.ErrUnexpectedEndOfJSON("value of string", s.totalOffset()) - } - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - for { - cursor++ - c := char(p, cursor) - if floatTable[c] { - continue - } else if c == nul { - if s.read() { - _, cursor, p = s.stat() - continue - } - } - s.cursor = cursor - return nil - } - case 't': - s.cursor = cursor - if err := trueBytes(s); err != nil { - return err - } - return nil - case 'f': - s.cursor = cursor - if err := falseBytes(s); err != nil { - return err - } - return nil - case 'n': - s.cursor = cursor - if err := nullBytes(s); err != nil { - return err - } - return nil - } - cursor++ - } -} - -func nullBytes(s *Stream) error { - // current cursor's character is 'n' - s.cursor++ - if s.char() != 'u' { - if err := retryReadNull(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 'l' { - if err := retryReadNull(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 'l' { - if err := retryReadNull(s); err != nil { - return err - } - } - s.cursor++ - return nil -} - -func retryReadNull(s *Stream) error { - if s.char() == nul && s.read() { - return nil - } - return errors.ErrInvalidCharacter(s.char(), "null", s.totalOffset()) -} - -func trueBytes(s *Stream) error { - // current cursor's character is 't' - s.cursor++ - if s.char() != 'r' { - if err := retryReadTrue(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 'u' { - if err := retryReadTrue(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 'e' { - if err := retryReadTrue(s); err != nil { - return err - } - } - s.cursor++ - return nil -} - -func retryReadTrue(s *Stream) error { - if s.char() == nul && s.read() { - return nil - } - return errors.ErrInvalidCharacter(s.char(), "bool(true)", s.totalOffset()) -} - -func falseBytes(s *Stream) error { - // current cursor's character is 'f' - s.cursor++ - if s.char() != 'a' { - if err := retryReadFalse(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 'l' { - if err := retryReadFalse(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 's' { - if err := retryReadFalse(s); err != nil { - return err - } - } - s.cursor++ - if s.char() != 'e' { - if err := retryReadFalse(s); err != nil { - return err - } - } - s.cursor++ - return nil -} - -func retryReadFalse(s *Stream) error { - if s.char() == nul && s.read() { - return nil - } - return errors.ErrInvalidCharacter(s.char(), "bool(false)", s.totalOffset()) -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/string.go b/vendor/github.com/goccy/go-json/internal/decoder/string.go deleted file mode 100644 index 32602c908ae..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/string.go +++ /dev/null @@ -1,452 +0,0 @@ -package decoder - -import ( - "bytes" - "fmt" - "reflect" - "unicode" - "unicode/utf16" - "unicode/utf8" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -type stringDecoder struct { - structName string - fieldName string -} - -func newStringDecoder(structName, fieldName string) *stringDecoder { - return &stringDecoder{ - structName: structName, - fieldName: fieldName, - } -} - -func (d *stringDecoder) errUnmarshalType(typeName string, offset int64) *errors.UnmarshalTypeError { - return &errors.UnmarshalTypeError{ - Value: typeName, - Type: reflect.TypeOf(""), - Offset: offset, - Struct: d.structName, - Field: d.fieldName, - } -} - -func (d *stringDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.decodeStreamByte(s) - if err != nil { - return err - } - if bytes == nil { - return nil - } - **(**string)(unsafe.Pointer(&p)) = *(*string)(unsafe.Pointer(&bytes)) - s.reset() - return nil -} - -func (d *stringDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - bytes, c, err := d.decodeByte(ctx.Buf, cursor) - if err != nil { - return 0, err - } - if bytes == nil { - return c, nil - } - cursor = c - **(**string)(unsafe.Pointer(&p)) = *(*string)(unsafe.Pointer(&bytes)) - return cursor, nil -} - -func (d *stringDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - bytes, c, err := d.decodeByte(ctx.Buf, cursor) - if err != nil { - return nil, 0, err - } - if bytes == nil { - return [][]byte{nullbytes}, c, nil - } - return [][]byte{bytes}, c, nil -} - -var ( - hexToInt = [256]int{ - '0': 0, - '1': 1, - '2': 2, - '3': 3, - '4': 4, - '5': 5, - '6': 6, - '7': 7, - '8': 8, - '9': 9, - 'A': 10, - 'B': 11, - 'C': 12, - 'D': 13, - 'E': 14, - 'F': 15, - 'a': 10, - 'b': 11, - 'c': 12, - 'd': 13, - 'e': 14, - 'f': 15, - } -) - -func unicodeToRune(code []byte) rune { - var r rune - for i := 0; i < len(code); i++ { - r = r*16 + rune(hexToInt[code[i]]) - } - return r -} - -func readAtLeast(s *Stream, n int64, p *unsafe.Pointer) bool { - for s.cursor+n >= s.length { - if !s.read() { - return false - } - *p = s.bufptr() - } - return true -} - -func decodeUnicodeRune(s *Stream, p unsafe.Pointer) (rune, int64, unsafe.Pointer, error) { - const defaultOffset = 5 - const surrogateOffset = 11 - - if !readAtLeast(s, defaultOffset, &p) { - return rune(0), 0, nil, errors.ErrInvalidCharacter(s.char(), "escaped string", s.totalOffset()) - } - - r := unicodeToRune(s.buf[s.cursor+1 : s.cursor+defaultOffset]) - if utf16.IsSurrogate(r) { - if !readAtLeast(s, surrogateOffset, &p) { - return unicode.ReplacementChar, defaultOffset, p, nil - } - if s.buf[s.cursor+defaultOffset] != '\\' || s.buf[s.cursor+defaultOffset+1] != 'u' { - return unicode.ReplacementChar, defaultOffset, p, nil - } - r2 := unicodeToRune(s.buf[s.cursor+defaultOffset+2 : s.cursor+surrogateOffset]) - if r := utf16.DecodeRune(r, r2); r != unicode.ReplacementChar { - return r, surrogateOffset, p, nil - } - } - return r, defaultOffset, p, nil -} - -func decodeUnicode(s *Stream, p unsafe.Pointer) (unsafe.Pointer, error) { - const backSlashAndULen = 2 // length of \u - - r, offset, pp, err := decodeUnicodeRune(s, p) - if err != nil { - return nil, err - } - unicode := []byte(string(r)) - unicodeLen := int64(len(unicode)) - s.buf = append(append(s.buf[:s.cursor-1], unicode...), s.buf[s.cursor+offset:]...) - unicodeOrgLen := offset - 1 - s.length = s.length - (backSlashAndULen + (unicodeOrgLen - unicodeLen)) - s.cursor = s.cursor - backSlashAndULen + unicodeLen - return pp, nil -} - -func decodeEscapeString(s *Stream, p unsafe.Pointer) (unsafe.Pointer, error) { - s.cursor++ -RETRY: - switch s.buf[s.cursor] { - case '"': - s.buf[s.cursor] = '"' - case '\\': - s.buf[s.cursor] = '\\' - case '/': - s.buf[s.cursor] = '/' - case 'b': - s.buf[s.cursor] = '\b' - case 'f': - s.buf[s.cursor] = '\f' - case 'n': - s.buf[s.cursor] = '\n' - case 'r': - s.buf[s.cursor] = '\r' - case 't': - s.buf[s.cursor] = '\t' - case 'u': - return decodeUnicode(s, p) - case nul: - if !s.read() { - return nil, errors.ErrInvalidCharacter(s.char(), "escaped string", s.totalOffset()) - } - p = s.bufptr() - goto RETRY - default: - return nil, errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - } - s.buf = append(s.buf[:s.cursor-1], s.buf[s.cursor:]...) - s.length-- - s.cursor-- - p = s.bufptr() - return p, nil -} - -var ( - runeErrBytes = []byte(string(utf8.RuneError)) - runeErrBytesLen = int64(len(runeErrBytes)) -) - -func stringBytes(s *Stream) ([]byte, error) { - _, cursor, p := s.stat() - cursor++ // skip double quote char - start := cursor - for { - switch char(p, cursor) { - case '\\': - s.cursor = cursor - pp, err := decodeEscapeString(s, p) - if err != nil { - return nil, err - } - p = pp - cursor = s.cursor - case '"': - literal := s.buf[start:cursor] - cursor++ - s.cursor = cursor - return literal, nil - case - // 0x00 is nul, 0x5c is '\\', 0x22 is '"' . - 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, // 0x00-0x0F - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, // 0x10-0x1F - 0x20, 0x21 /*0x22,*/, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, // 0x20-0x2F - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, // 0x30-0x3F - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, // 0x40-0x4F - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B /*0x5C,*/, 0x5D, 0x5E, 0x5F, // 0x50-0x5F - 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, // 0x60-0x6F - 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F: // 0x70-0x7F - // character is ASCII. skip to next char - case - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, // 0x80-0x8F - 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B, 0x9C, 0x9D, 0x9E, 0x9F, // 0x90-0x9F - 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, // 0xA0-0xAF - 0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB, 0xBC, 0xBD, 0xBE, 0xBF, // 0xB0-0xBF - 0xC0, 0xC1, // 0xC0-0xC1 - 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF: // 0xF5-0xFE - // character is invalid - s.buf = append(append(append([]byte{}, s.buf[:cursor]...), runeErrBytes...), s.buf[cursor+1:]...) - _, _, p = s.stat() - cursor += runeErrBytesLen - s.length += runeErrBytesLen - continue - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - goto ERROR - case 0xEF: - // RuneError is {0xEF, 0xBF, 0xBD} - if s.buf[cursor+1] == 0xBF && s.buf[cursor+2] == 0xBD { - // found RuneError: skip - cursor += 2 - break - } - fallthrough - default: - // multi bytes character - if !utf8.FullRune(s.buf[cursor : len(s.buf)-1]) { - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - goto ERROR - } - r, size := utf8.DecodeRune(s.buf[cursor:]) - if r == utf8.RuneError { - s.buf = append(append(append([]byte{}, s.buf[:cursor]...), runeErrBytes...), s.buf[cursor+1:]...) - cursor += runeErrBytesLen - s.length += runeErrBytesLen - _, _, p = s.stat() - } else { - cursor += int64(size) - } - continue - } - cursor++ - } -ERROR: - return nil, errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) -} - -func (d *stringDecoder) decodeStreamByte(s *Stream) ([]byte, error) { - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - s.cursor++ - continue - case '[': - return nil, d.errUnmarshalType("array", s.totalOffset()) - case '{': - return nil, d.errUnmarshalType("object", s.totalOffset()) - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return nil, d.errUnmarshalType("number", s.totalOffset()) - case '"': - return stringBytes(s) - case 'n': - if err := nullBytes(s); err != nil { - return nil, err - } - return nil, nil - case nul: - if s.read() { - continue - } - } - break - } - return nil, errors.ErrInvalidBeginningOfValue(s.char(), s.totalOffset()) -} - -func (d *stringDecoder) decodeByte(buf []byte, cursor int64) ([]byte, int64, error) { - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - case '[': - return nil, 0, d.errUnmarshalType("array", cursor) - case '{': - return nil, 0, d.errUnmarshalType("object", cursor) - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return nil, 0, d.errUnmarshalType("number", cursor) - case '"': - cursor++ - start := cursor - b := (*sliceHeader)(unsafe.Pointer(&buf)).data - escaped := 0 - for { - switch char(b, cursor) { - case '\\': - escaped++ - cursor++ - switch char(b, cursor) { - case '"', '\\', '/', 'b', 'f', 'n', 'r', 't': - cursor++ - case 'u': - buflen := int64(len(buf)) - if cursor+5 >= buflen { - return nil, 0, errors.ErrUnexpectedEndOfJSON("escaped string", cursor) - } - for i := int64(1); i <= 4; i++ { - c := char(b, cursor+i) - if !(('0' <= c && c <= '9') || ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F')) { - return nil, 0, errors.ErrSyntax(fmt.Sprintf("json: invalid character %c in \\u hexadecimal character escape", c), cursor+i) - } - } - cursor += 5 - default: - return nil, 0, errors.ErrUnexpectedEndOfJSON("escaped string", cursor) - } - continue - case '"': - literal := buf[start:cursor] - if escaped > 0 { - literal = literal[:unescapeString(literal)] - } - cursor++ - return literal, cursor, nil - case nul: - return nil, 0, errors.ErrUnexpectedEndOfJSON("string", cursor) - } - cursor++ - } - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return nil, cursor, nil - default: - return nil, 0, errors.ErrInvalidBeginningOfValue(buf[cursor], cursor) - } - } -} - -var unescapeMap = [256]byte{ - '"': '"', - '\\': '\\', - '/': '/', - 'b': '\b', - 'f': '\f', - 'n': '\n', - 'r': '\r', - 't': '\t', -} - -func unsafeAdd(ptr unsafe.Pointer, offset int) unsafe.Pointer { - return unsafe.Pointer(uintptr(ptr) + uintptr(offset)) -} - -func unescapeString(buf []byte) int { - p := (*sliceHeader)(unsafe.Pointer(&buf)).data - end := unsafeAdd(p, len(buf)) - src := unsafeAdd(p, bytes.IndexByte(buf, '\\')) - dst := src - for src != end { - c := char(src, 0) - if c == '\\' { - escapeChar := char(src, 1) - if escapeChar != 'u' { - *(*byte)(dst) = unescapeMap[escapeChar] - src = unsafeAdd(src, 2) - dst = unsafeAdd(dst, 1) - } else { - v1 := hexToInt[char(src, 2)] - v2 := hexToInt[char(src, 3)] - v3 := hexToInt[char(src, 4)] - v4 := hexToInt[char(src, 5)] - code := rune((v1 << 12) | (v2 << 8) | (v3 << 4) | v4) - if code >= 0xd800 && code < 0xdc00 && uintptr(unsafeAdd(src, 11)) < uintptr(end) { - if char(src, 6) == '\\' && char(src, 7) == 'u' { - v1 := hexToInt[char(src, 8)] - v2 := hexToInt[char(src, 9)] - v3 := hexToInt[char(src, 10)] - v4 := hexToInt[char(src, 11)] - lo := rune((v1 << 12) | (v2 << 8) | (v3 << 4) | v4) - if lo >= 0xdc00 && lo < 0xe000 { - code = (code-0xd800)<<10 | (lo - 0xdc00) + 0x10000 - src = unsafeAdd(src, 6) - } - } - } - var b [utf8.UTFMax]byte - n := utf8.EncodeRune(b[:], code) - switch n { - case 4: - *(*byte)(unsafeAdd(dst, 3)) = b[3] - fallthrough - case 3: - *(*byte)(unsafeAdd(dst, 2)) = b[2] - fallthrough - case 2: - *(*byte)(unsafeAdd(dst, 1)) = b[1] - fallthrough - case 1: - *(*byte)(unsafeAdd(dst, 0)) = b[0] - } - src = unsafeAdd(src, 6) - dst = unsafeAdd(dst, n) - } - } else { - *(*byte)(dst) = c - src = unsafeAdd(src, 1) - dst = unsafeAdd(dst, 1) - } - } - return int(uintptr(dst) - uintptr(p)) -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/struct.go b/vendor/github.com/goccy/go-json/internal/decoder/struct.go deleted file mode 100644 index 313da153b36..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/struct.go +++ /dev/null @@ -1,845 +0,0 @@ -package decoder - -import ( - "fmt" - "math" - "math/bits" - "sort" - "strings" - "unicode" - "unicode/utf16" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -type structFieldSet struct { - dec Decoder - offset uintptr - isTaggedKey bool - fieldIdx int - key string - keyLen int64 - err error -} - -type structDecoder struct { - fieldMap map[string]*structFieldSet - fieldUniqueNameNum int - stringDecoder *stringDecoder - structName string - fieldName string - isTriedOptimize bool - keyBitmapUint8 [][256]uint8 - keyBitmapUint16 [][256]uint16 - sortedFieldSets []*structFieldSet - keyDecoder func(*structDecoder, []byte, int64) (int64, *structFieldSet, error) - keyStreamDecoder func(*structDecoder, *Stream) (*structFieldSet, string, error) -} - -var ( - largeToSmallTable [256]byte -) - -func init() { - for i := 0; i < 256; i++ { - c := i - if 'A' <= c && c <= 'Z' { - c += 'a' - 'A' - } - largeToSmallTable[i] = byte(c) - } -} - -func toASCIILower(s string) string { - b := []byte(s) - for i := range b { - b[i] = largeToSmallTable[b[i]] - } - return string(b) -} - -func newStructDecoder(structName, fieldName string, fieldMap map[string]*structFieldSet) *structDecoder { - return &structDecoder{ - fieldMap: fieldMap, - stringDecoder: newStringDecoder(structName, fieldName), - structName: structName, - fieldName: fieldName, - keyDecoder: decodeKey, - keyStreamDecoder: decodeKeyStream, - } -} - -const ( - allowOptimizeMaxKeyLen = 64 - allowOptimizeMaxFieldLen = 16 -) - -func (d *structDecoder) tryOptimize() { - fieldUniqueNameMap := map[string]int{} - fieldIdx := -1 - for k, v := range d.fieldMap { - lower := strings.ToLower(k) - idx, exists := fieldUniqueNameMap[lower] - if exists { - v.fieldIdx = idx - } else { - fieldIdx++ - v.fieldIdx = fieldIdx - } - fieldUniqueNameMap[lower] = fieldIdx - } - d.fieldUniqueNameNum = len(fieldUniqueNameMap) - - if d.isTriedOptimize { - return - } - fieldMap := map[string]*structFieldSet{} - conflicted := map[string]struct{}{} - for k, v := range d.fieldMap { - key := strings.ToLower(k) - if key != k { - if key != toASCIILower(k) { - d.isTriedOptimize = true - return - } - // already exists same key (e.g. Hello and HELLO has same lower case key - if _, exists := conflicted[key]; exists { - d.isTriedOptimize = true - return - } - conflicted[key] = struct{}{} - } - if field, exists := fieldMap[key]; exists { - if field != v { - d.isTriedOptimize = true - return - } - } - fieldMap[key] = v - } - - if len(fieldMap) > allowOptimizeMaxFieldLen { - d.isTriedOptimize = true - return - } - - var maxKeyLen int - sortedKeys := []string{} - for key := range fieldMap { - keyLen := len(key) - if keyLen > allowOptimizeMaxKeyLen { - d.isTriedOptimize = true - return - } - if maxKeyLen < keyLen { - maxKeyLen = keyLen - } - sortedKeys = append(sortedKeys, key) - } - sort.Strings(sortedKeys) - - // By allocating one extra capacity than `maxKeyLen`, - // it is possible to avoid the process of comparing the index of the key with the length of the bitmap each time. - bitmapLen := maxKeyLen + 1 - if len(sortedKeys) <= 8 { - keyBitmap := make([][256]uint8, bitmapLen) - for i, key := range sortedKeys { - for j := 0; j < len(key); j++ { - c := key[j] - keyBitmap[j][c] |= (1 << uint(i)) - } - d.sortedFieldSets = append(d.sortedFieldSets, fieldMap[key]) - } - d.keyBitmapUint8 = keyBitmap - d.keyDecoder = decodeKeyByBitmapUint8 - d.keyStreamDecoder = decodeKeyByBitmapUint8Stream - } else { - keyBitmap := make([][256]uint16, bitmapLen) - for i, key := range sortedKeys { - for j := 0; j < len(key); j++ { - c := key[j] - keyBitmap[j][c] |= (1 << uint(i)) - } - d.sortedFieldSets = append(d.sortedFieldSets, fieldMap[key]) - } - d.keyBitmapUint16 = keyBitmap - d.keyDecoder = decodeKeyByBitmapUint16 - d.keyStreamDecoder = decodeKeyByBitmapUint16Stream - } -} - -// decode from '\uXXXX' -func decodeKeyCharByUnicodeRune(buf []byte, cursor int64) ([]byte, int64, error) { - const defaultOffset = 4 - const surrogateOffset = 6 - - if cursor+defaultOffset >= int64(len(buf)) { - return nil, 0, errors.ErrUnexpectedEndOfJSON("escaped string", cursor) - } - - r := unicodeToRune(buf[cursor : cursor+defaultOffset]) - if utf16.IsSurrogate(r) { - cursor += defaultOffset - if cursor+surrogateOffset >= int64(len(buf)) || buf[cursor] != '\\' || buf[cursor+1] != 'u' { - return []byte(string(unicode.ReplacementChar)), cursor + defaultOffset - 1, nil - } - cursor += 2 - r2 := unicodeToRune(buf[cursor : cursor+defaultOffset]) - if r := utf16.DecodeRune(r, r2); r != unicode.ReplacementChar { - return []byte(string(r)), cursor + defaultOffset - 1, nil - } - } - return []byte(string(r)), cursor + defaultOffset - 1, nil -} - -func decodeKeyCharByEscapedChar(buf []byte, cursor int64) ([]byte, int64, error) { - c := buf[cursor] - cursor++ - switch c { - case '"': - return []byte{'"'}, cursor, nil - case '\\': - return []byte{'\\'}, cursor, nil - case '/': - return []byte{'/'}, cursor, nil - case 'b': - return []byte{'\b'}, cursor, nil - case 'f': - return []byte{'\f'}, cursor, nil - case 'n': - return []byte{'\n'}, cursor, nil - case 'r': - return []byte{'\r'}, cursor, nil - case 't': - return []byte{'\t'}, cursor, nil - case 'u': - return decodeKeyCharByUnicodeRune(buf, cursor) - } - return nil, cursor, nil -} - -func decodeKeyByBitmapUint8(d *structDecoder, buf []byte, cursor int64) (int64, *structFieldSet, error) { - var ( - curBit uint8 = math.MaxUint8 - ) - b := (*sliceHeader)(unsafe.Pointer(&buf)).data - for { - switch char(b, cursor) { - case ' ', '\n', '\t', '\r': - cursor++ - case '"': - cursor++ - c := char(b, cursor) - switch c { - case '"': - cursor++ - return cursor, nil, nil - case nul: - return 0, nil, errors.ErrUnexpectedEndOfJSON("string", cursor) - } - keyIdx := 0 - bitmap := d.keyBitmapUint8 - start := cursor - for { - c := char(b, cursor) - switch c { - case '"': - fieldSetIndex := bits.TrailingZeros8(curBit) - field := d.sortedFieldSets[fieldSetIndex] - keyLen := cursor - start - cursor++ - if keyLen < field.keyLen { - // early match - return cursor, nil, nil - } - return cursor, field, nil - case nul: - return 0, nil, errors.ErrUnexpectedEndOfJSON("string", cursor) - case '\\': - cursor++ - chars, nextCursor, err := decodeKeyCharByEscapedChar(buf, cursor) - if err != nil { - return 0, nil, err - } - for _, c := range chars { - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - return decodeKeyNotFound(b, cursor) - } - keyIdx++ - } - cursor = nextCursor - default: - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - return decodeKeyNotFound(b, cursor) - } - keyIdx++ - } - cursor++ - } - default: - return cursor, nil, errors.ErrInvalidBeginningOfValue(char(b, cursor), cursor) - } - } -} - -func decodeKeyByBitmapUint16(d *structDecoder, buf []byte, cursor int64) (int64, *structFieldSet, error) { - var ( - curBit uint16 = math.MaxUint16 - ) - b := (*sliceHeader)(unsafe.Pointer(&buf)).data - for { - switch char(b, cursor) { - case ' ', '\n', '\t', '\r': - cursor++ - case '"': - cursor++ - c := char(b, cursor) - switch c { - case '"': - cursor++ - return cursor, nil, nil - case nul: - return 0, nil, errors.ErrUnexpectedEndOfJSON("string", cursor) - } - keyIdx := 0 - bitmap := d.keyBitmapUint16 - start := cursor - for { - c := char(b, cursor) - switch c { - case '"': - fieldSetIndex := bits.TrailingZeros16(curBit) - field := d.sortedFieldSets[fieldSetIndex] - keyLen := cursor - start - cursor++ - if keyLen < field.keyLen { - // early match - return cursor, nil, nil - } - return cursor, field, nil - case nul: - return 0, nil, errors.ErrUnexpectedEndOfJSON("string", cursor) - case '\\': - cursor++ - chars, nextCursor, err := decodeKeyCharByEscapedChar(buf, cursor) - if err != nil { - return 0, nil, err - } - for _, c := range chars { - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - return decodeKeyNotFound(b, cursor) - } - keyIdx++ - } - cursor = nextCursor - default: - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - return decodeKeyNotFound(b, cursor) - } - keyIdx++ - } - cursor++ - } - default: - return cursor, nil, errors.ErrInvalidBeginningOfValue(char(b, cursor), cursor) - } - } -} - -func decodeKeyNotFound(b unsafe.Pointer, cursor int64) (int64, *structFieldSet, error) { - for { - cursor++ - switch char(b, cursor) { - case '"': - cursor++ - return cursor, nil, nil - case '\\': - cursor++ - if char(b, cursor) == nul { - return 0, nil, errors.ErrUnexpectedEndOfJSON("string", cursor) - } - case nul: - return 0, nil, errors.ErrUnexpectedEndOfJSON("string", cursor) - } - } -} - -func decodeKey(d *structDecoder, buf []byte, cursor int64) (int64, *structFieldSet, error) { - key, c, err := d.stringDecoder.decodeByte(buf, cursor) - if err != nil { - return 0, nil, err - } - cursor = c - k := *(*string)(unsafe.Pointer(&key)) - field, exists := d.fieldMap[k] - if !exists { - return cursor, nil, nil - } - return cursor, field, nil -} - -func decodeKeyByBitmapUint8Stream(d *structDecoder, s *Stream) (*structFieldSet, string, error) { - var ( - curBit uint8 = math.MaxUint8 - ) - _, cursor, p := s.stat() - for { - switch char(p, cursor) { - case ' ', '\n', '\t', '\r': - cursor++ - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return nil, "", errors.ErrInvalidBeginningOfValue(char(p, cursor), s.totalOffset()) - case '"': - cursor++ - FIRST_CHAR: - start := cursor - switch char(p, cursor) { - case '"': - cursor++ - s.cursor = cursor - return nil, "", nil - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - goto FIRST_CHAR - } - return nil, "", errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - } - keyIdx := 0 - bitmap := d.keyBitmapUint8 - for { - c := char(p, cursor) - switch c { - case '"': - fieldSetIndex := bits.TrailingZeros8(curBit) - field := d.sortedFieldSets[fieldSetIndex] - keyLen := cursor - start - cursor++ - s.cursor = cursor - if keyLen < field.keyLen { - // early match - return nil, field.key, nil - } - return field, field.key, nil - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return nil, "", errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - case '\\': - s.cursor = cursor + 1 // skip '\' char - chars, err := decodeKeyCharByEscapeCharStream(s) - if err != nil { - return nil, "", err - } - cursor = s.cursor - for _, c := range chars { - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - s.cursor = cursor - return decodeKeyNotFoundStream(s, start) - } - keyIdx++ - } - default: - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - s.cursor = cursor - return decodeKeyNotFoundStream(s, start) - } - keyIdx++ - } - cursor++ - } - default: - return nil, "", errors.ErrInvalidBeginningOfValue(char(p, cursor), s.totalOffset()) - } - } -} - -func decodeKeyByBitmapUint16Stream(d *structDecoder, s *Stream) (*structFieldSet, string, error) { - var ( - curBit uint16 = math.MaxUint16 - ) - _, cursor, p := s.stat() - for { - switch char(p, cursor) { - case ' ', '\n', '\t', '\r': - cursor++ - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return nil, "", errors.ErrInvalidBeginningOfValue(char(p, cursor), s.totalOffset()) - case '"': - cursor++ - FIRST_CHAR: - start := cursor - switch char(p, cursor) { - case '"': - cursor++ - s.cursor = cursor - return nil, "", nil - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - goto FIRST_CHAR - } - return nil, "", errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - } - keyIdx := 0 - bitmap := d.keyBitmapUint16 - for { - c := char(p, cursor) - switch c { - case '"': - fieldSetIndex := bits.TrailingZeros16(curBit) - field := d.sortedFieldSets[fieldSetIndex] - keyLen := cursor - start - cursor++ - s.cursor = cursor - if keyLen < field.keyLen { - // early match - return nil, field.key, nil - } - return field, field.key, nil - case nul: - s.cursor = cursor - if s.read() { - _, cursor, p = s.stat() - continue - } - return nil, "", errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - case '\\': - s.cursor = cursor + 1 // skip '\' char - chars, err := decodeKeyCharByEscapeCharStream(s) - if err != nil { - return nil, "", err - } - cursor = s.cursor - for _, c := range chars { - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - s.cursor = cursor - return decodeKeyNotFoundStream(s, start) - } - keyIdx++ - } - default: - curBit &= bitmap[keyIdx][largeToSmallTable[c]] - if curBit == 0 { - s.cursor = cursor - return decodeKeyNotFoundStream(s, start) - } - keyIdx++ - } - cursor++ - } - default: - return nil, "", errors.ErrInvalidBeginningOfValue(char(p, cursor), s.totalOffset()) - } - } -} - -// decode from '\uXXXX' -func decodeKeyCharByUnicodeRuneStream(s *Stream) ([]byte, error) { - const defaultOffset = 4 - const surrogateOffset = 6 - - if s.cursor+defaultOffset >= s.length { - if !s.read() { - return nil, errors.ErrInvalidCharacter(s.char(), "escaped unicode char", s.totalOffset()) - } - } - - r := unicodeToRune(s.buf[s.cursor : s.cursor+defaultOffset]) - if utf16.IsSurrogate(r) { - s.cursor += defaultOffset - if s.cursor+surrogateOffset >= s.length { - s.read() - } - if s.cursor+surrogateOffset >= s.length || s.buf[s.cursor] != '\\' || s.buf[s.cursor+1] != 'u' { - s.cursor += defaultOffset - 1 - return []byte(string(unicode.ReplacementChar)), nil - } - r2 := unicodeToRune(s.buf[s.cursor+defaultOffset+2 : s.cursor+surrogateOffset]) - if r := utf16.DecodeRune(r, r2); r != unicode.ReplacementChar { - s.cursor += defaultOffset - 1 - return []byte(string(r)), nil - } - } - s.cursor += defaultOffset - 1 - return []byte(string(r)), nil -} - -func decodeKeyCharByEscapeCharStream(s *Stream) ([]byte, error) { - c := s.buf[s.cursor] - s.cursor++ -RETRY: - switch c { - case '"': - return []byte{'"'}, nil - case '\\': - return []byte{'\\'}, nil - case '/': - return []byte{'/'}, nil - case 'b': - return []byte{'\b'}, nil - case 'f': - return []byte{'\f'}, nil - case 'n': - return []byte{'\n'}, nil - case 'r': - return []byte{'\r'}, nil - case 't': - return []byte{'\t'}, nil - case 'u': - return decodeKeyCharByUnicodeRuneStream(s) - case nul: - if !s.read() { - return nil, errors.ErrInvalidCharacter(s.char(), "escaped char", s.totalOffset()) - } - goto RETRY - default: - return nil, errors.ErrUnexpectedEndOfJSON("struct field", s.totalOffset()) - } -} - -func decodeKeyNotFoundStream(s *Stream, start int64) (*structFieldSet, string, error) { - buf, cursor, p := s.stat() - for { - cursor++ - switch char(p, cursor) { - case '"': - b := buf[start:cursor] - key := *(*string)(unsafe.Pointer(&b)) - cursor++ - s.cursor = cursor - return nil, key, nil - case '\\': - cursor++ - if char(p, cursor) == nul { - s.cursor = cursor - if !s.read() { - return nil, "", errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - } - buf, cursor, p = s.statForRetry() - } - case nul: - s.cursor = cursor - if !s.read() { - return nil, "", errors.ErrUnexpectedEndOfJSON("string", s.totalOffset()) - } - buf, cursor, p = s.statForRetry() - } - } -} - -func decodeKeyStream(d *structDecoder, s *Stream) (*structFieldSet, string, error) { - key, err := d.stringDecoder.decodeStreamByte(s) - if err != nil { - return nil, "", err - } - k := *(*string)(unsafe.Pointer(&key)) - return d.fieldMap[k], k, nil -} - -func (d *structDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - depth++ - if depth > maxDecodeNestingDepth { - return errors.ErrExceededMaxDepth(s.char(), s.cursor) - } - - c := s.skipWhiteSpace() - switch c { - case 'n': - if err := nullBytes(s); err != nil { - return err - } - return nil - default: - if s.char() != '{' { - return errors.ErrInvalidBeginningOfValue(s.char(), s.totalOffset()) - } - } - s.cursor++ - if s.skipWhiteSpace() == '}' { - s.cursor++ - return nil - } - var ( - seenFields map[int]struct{} - seenFieldNum int - ) - firstWin := (s.Option.Flags & FirstWinOption) != 0 - if firstWin { - seenFields = make(map[int]struct{}, d.fieldUniqueNameNum) - } - for { - s.reset() - field, key, err := d.keyStreamDecoder(d, s) - if err != nil { - return err - } - if s.skipWhiteSpace() != ':' { - return errors.ErrExpected("colon after object key", s.totalOffset()) - } - s.cursor++ - if field != nil { - if field.err != nil { - return field.err - } - if firstWin { - if _, exists := seenFields[field.fieldIdx]; exists { - if err := s.skipValue(depth); err != nil { - return err - } - } else { - if err := field.dec.DecodeStream(s, depth, unsafe.Pointer(uintptr(p)+field.offset)); err != nil { - return err - } - seenFieldNum++ - if d.fieldUniqueNameNum <= seenFieldNum { - return s.skipObject(depth) - } - seenFields[field.fieldIdx] = struct{}{} - } - } else { - if err := field.dec.DecodeStream(s, depth, unsafe.Pointer(uintptr(p)+field.offset)); err != nil { - return err - } - } - } else if s.DisallowUnknownFields { - return fmt.Errorf("json: unknown field %q", key) - } else { - if err := s.skipValue(depth); err != nil { - return err - } - } - c := s.skipWhiteSpace() - if c == '}' { - s.cursor++ - return nil - } - if c != ',' { - return errors.ErrExpected("comma after object element", s.totalOffset()) - } - s.cursor++ - } -} - -func (d *structDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - depth++ - if depth > maxDecodeNestingDepth { - return 0, errors.ErrExceededMaxDepth(buf[cursor], cursor) - } - buflen := int64(len(buf)) - cursor = skipWhiteSpace(buf, cursor) - b := (*sliceHeader)(unsafe.Pointer(&buf)).data - switch char(b, cursor) { - case 'n': - if err := validateNull(buf, cursor); err != nil { - return 0, err - } - cursor += 4 - return cursor, nil - case '{': - default: - return 0, errors.ErrInvalidBeginningOfValue(char(b, cursor), cursor) - } - cursor++ - cursor = skipWhiteSpace(buf, cursor) - if buf[cursor] == '}' { - cursor++ - return cursor, nil - } - var ( - seenFields map[int]struct{} - seenFieldNum int - ) - firstWin := (ctx.Option.Flags & FirstWinOption) != 0 - if firstWin { - seenFields = make(map[int]struct{}, d.fieldUniqueNameNum) - } - for { - c, field, err := d.keyDecoder(d, buf, cursor) - if err != nil { - return 0, err - } - cursor = skipWhiteSpace(buf, c) - if char(b, cursor) != ':' { - return 0, errors.ErrExpected("colon after object key", cursor) - } - cursor++ - if cursor >= buflen { - return 0, errors.ErrExpected("object value after colon", cursor) - } - if field != nil { - if field.err != nil { - return 0, field.err - } - if firstWin { - if _, exists := seenFields[field.fieldIdx]; exists { - c, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - cursor = c - } else { - c, err := field.dec.Decode(ctx, cursor, depth, unsafe.Pointer(uintptr(p)+field.offset)) - if err != nil { - return 0, err - } - cursor = c - seenFieldNum++ - if d.fieldUniqueNameNum <= seenFieldNum { - return skipObject(buf, cursor, depth) - } - seenFields[field.fieldIdx] = struct{}{} - } - } else { - c, err := field.dec.Decode(ctx, cursor, depth, unsafe.Pointer(uintptr(p)+field.offset)) - if err != nil { - return 0, err - } - cursor = c - } - } else { - c, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - cursor = c - } - cursor = skipWhiteSpace(buf, cursor) - if char(b, cursor) == '}' { - cursor++ - return cursor, nil - } - if char(b, cursor) != ',' { - return 0, errors.ErrExpected("comma after object element", cursor) - } - cursor++ - } -} - -func (d *structDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: struct decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/type.go b/vendor/github.com/goccy/go-json/internal/decoder/type.go deleted file mode 100644 index beaf3ab866b..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/type.go +++ /dev/null @@ -1,30 +0,0 @@ -package decoder - -import ( - "context" - "encoding" - "encoding/json" - "reflect" - "unsafe" -) - -type Decoder interface { - Decode(*RuntimeContext, int64, int64, unsafe.Pointer) (int64, error) - DecodePath(*RuntimeContext, int64, int64) ([][]byte, int64, error) - DecodeStream(*Stream, int64, unsafe.Pointer) error -} - -const ( - nul = '\000' - maxDecodeNestingDepth = 10000 -) - -type unmarshalerContext interface { - UnmarshalJSON(context.Context, []byte) error -} - -var ( - unmarshalJSONType = reflect.TypeOf((*json.Unmarshaler)(nil)).Elem() - unmarshalJSONContextType = reflect.TypeOf((*unmarshalerContext)(nil)).Elem() - unmarshalTextType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() -) diff --git a/vendor/github.com/goccy/go-json/internal/decoder/uint.go b/vendor/github.com/goccy/go-json/internal/decoder/uint.go deleted file mode 100644 index 4131731b8e4..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/uint.go +++ /dev/null @@ -1,194 +0,0 @@ -package decoder - -import ( - "fmt" - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type uintDecoder struct { - typ *runtime.Type - kind reflect.Kind - op func(unsafe.Pointer, uint64) - structName string - fieldName string -} - -func newUintDecoder(typ *runtime.Type, structName, fieldName string, op func(unsafe.Pointer, uint64)) *uintDecoder { - return &uintDecoder{ - typ: typ, - kind: typ.Kind(), - op: op, - structName: structName, - fieldName: fieldName, - } -} - -func (d *uintDecoder) typeError(buf []byte, offset int64) *errors.UnmarshalTypeError { - return &errors.UnmarshalTypeError{ - Value: fmt.Sprintf("number %s", string(buf)), - Type: runtime.RType2Type(d.typ), - Offset: offset, - } -} - -var ( - pow10u64 = [...]uint64{ - 1e00, 1e01, 1e02, 1e03, 1e04, 1e05, 1e06, 1e07, 1e08, 1e09, - 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, - } - pow10u64Len = len(pow10u64) -) - -func (d *uintDecoder) parseUint(b []byte) (uint64, error) { - maxDigit := len(b) - if maxDigit > pow10u64Len { - return 0, fmt.Errorf("invalid length of number") - } - sum := uint64(0) - for i := 0; i < maxDigit; i++ { - c := uint64(b[i]) - 48 - digitValue := pow10u64[maxDigit-i-1] - sum += c * digitValue - } - return sum, nil -} - -func (d *uintDecoder) decodeStreamByte(s *Stream) ([]byte, error) { - for { - switch s.char() { - case ' ', '\n', '\t', '\r': - s.cursor++ - continue - case '0': - s.cursor++ - return numZeroBuf, nil - case '1', '2', '3', '4', '5', '6', '7', '8', '9': - start := s.cursor - for { - s.cursor++ - if numTable[s.char()] { - continue - } else if s.char() == nul { - if s.read() { - s.cursor-- // for retry current character - continue - } - } - break - } - num := s.buf[start:s.cursor] - return num, nil - case 'n': - if err := nullBytes(s); err != nil { - return nil, err - } - return nil, nil - case nul: - if s.read() { - continue - } - default: - return nil, d.typeError([]byte{s.char()}, s.totalOffset()) - } - break - } - return nil, errors.ErrUnexpectedEndOfJSON("number(unsigned integer)", s.totalOffset()) -} - -func (d *uintDecoder) decodeByte(buf []byte, cursor int64) ([]byte, int64, error) { - for { - switch buf[cursor] { - case ' ', '\n', '\t', '\r': - cursor++ - continue - case '0': - cursor++ - return numZeroBuf, cursor, nil - case '1', '2', '3', '4', '5', '6', '7', '8', '9': - start := cursor - cursor++ - for numTable[buf[cursor]] { - cursor++ - } - num := buf[start:cursor] - return num, cursor, nil - case 'n': - if err := validateNull(buf, cursor); err != nil { - return nil, 0, err - } - cursor += 4 - return nil, cursor, nil - default: - return nil, 0, d.typeError([]byte{buf[cursor]}, cursor) - } - } -} - -func (d *uintDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.decodeStreamByte(s) - if err != nil { - return err - } - if bytes == nil { - return nil - } - u64, err := d.parseUint(bytes) - if err != nil { - return d.typeError(bytes, s.totalOffset()) - } - switch d.kind { - case reflect.Uint8: - if (1 << 8) <= u64 { - return d.typeError(bytes, s.totalOffset()) - } - case reflect.Uint16: - if (1 << 16) <= u64 { - return d.typeError(bytes, s.totalOffset()) - } - case reflect.Uint32: - if (1 << 32) <= u64 { - return d.typeError(bytes, s.totalOffset()) - } - } - d.op(p, u64) - return nil -} - -func (d *uintDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - bytes, c, err := d.decodeByte(ctx.Buf, cursor) - if err != nil { - return 0, err - } - if bytes == nil { - return c, nil - } - cursor = c - u64, err := d.parseUint(bytes) - if err != nil { - return 0, d.typeError(bytes, cursor) - } - switch d.kind { - case reflect.Uint8: - if (1 << 8) <= u64 { - return 0, d.typeError(bytes, cursor) - } - case reflect.Uint16: - if (1 << 16) <= u64 { - return 0, d.typeError(bytes, cursor) - } - case reflect.Uint32: - if (1 << 32) <= u64 { - return 0, d.typeError(bytes, cursor) - } - } - d.op(p, u64) - return cursor, nil -} - -func (d *uintDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: uint decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/unmarshal_json.go b/vendor/github.com/goccy/go-json/internal/decoder/unmarshal_json.go deleted file mode 100644 index 4cd6dbd573f..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/unmarshal_json.go +++ /dev/null @@ -1,104 +0,0 @@ -package decoder - -import ( - "context" - "encoding/json" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type unmarshalJSONDecoder struct { - typ *runtime.Type - structName string - fieldName string -} - -func newUnmarshalJSONDecoder(typ *runtime.Type, structName, fieldName string) *unmarshalJSONDecoder { - return &unmarshalJSONDecoder{ - typ: typ, - structName: structName, - fieldName: fieldName, - } -} - -func (d *unmarshalJSONDecoder) annotateError(cursor int64, err error) { - switch e := err.(type) { - case *errors.UnmarshalTypeError: - e.Struct = d.structName - e.Field = d.fieldName - case *errors.SyntaxError: - e.Offset = cursor - } -} - -func (d *unmarshalJSONDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - s.skipWhiteSpace() - start := s.cursor - if err := s.skipValue(depth); err != nil { - return err - } - src := s.buf[start:s.cursor] - dst := make([]byte, len(src)) - copy(dst, src) - - v := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: d.typ, - ptr: p, - })) - switch v := v.(type) { - case unmarshalerContext: - var ctx context.Context - if (s.Option.Flags & ContextOption) != 0 { - ctx = s.Option.Context - } else { - ctx = context.Background() - } - if err := v.UnmarshalJSON(ctx, dst); err != nil { - d.annotateError(s.cursor, err) - return err - } - case json.Unmarshaler: - if err := v.UnmarshalJSON(dst); err != nil { - d.annotateError(s.cursor, err) - return err - } - } - return nil -} - -func (d *unmarshalJSONDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - src := buf[start:end] - dst := make([]byte, len(src)) - copy(dst, src) - - v := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: d.typ, - ptr: p, - })) - if (ctx.Option.Flags & ContextOption) != 0 { - if err := v.(unmarshalerContext).UnmarshalJSON(ctx.Option.Context, dst); err != nil { - d.annotateError(cursor, err) - return 0, err - } - } else { - if err := v.(json.Unmarshaler).UnmarshalJSON(dst); err != nil { - d.annotateError(cursor, err) - return 0, err - } - } - return end, nil -} - -func (d *unmarshalJSONDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: unmarshal json decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/unmarshal_text.go b/vendor/github.com/goccy/go-json/internal/decoder/unmarshal_text.go deleted file mode 100644 index d711d0f85f0..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/unmarshal_text.go +++ /dev/null @@ -1,285 +0,0 @@ -package decoder - -import ( - "bytes" - "encoding" - "fmt" - "unicode" - "unicode/utf16" - "unicode/utf8" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type unmarshalTextDecoder struct { - typ *runtime.Type - structName string - fieldName string -} - -func newUnmarshalTextDecoder(typ *runtime.Type, structName, fieldName string) *unmarshalTextDecoder { - return &unmarshalTextDecoder{ - typ: typ, - structName: structName, - fieldName: fieldName, - } -} - -func (d *unmarshalTextDecoder) annotateError(cursor int64, err error) { - switch e := err.(type) { - case *errors.UnmarshalTypeError: - e.Struct = d.structName - e.Field = d.fieldName - case *errors.SyntaxError: - e.Offset = cursor - } -} - -var ( - nullbytes = []byte(`null`) -) - -func (d *unmarshalTextDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - s.skipWhiteSpace() - start := s.cursor - if err := s.skipValue(depth); err != nil { - return err - } - src := s.buf[start:s.cursor] - if len(src) > 0 { - switch src[0] { - case '[': - return &errors.UnmarshalTypeError{ - Value: "array", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case '{': - return &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return &errors.UnmarshalTypeError{ - Value: "number", - Type: runtime.RType2Type(d.typ), - Offset: s.totalOffset(), - } - case 'n': - if bytes.Equal(src, nullbytes) { - *(*unsafe.Pointer)(p) = nil - return nil - } - } - } - dst := make([]byte, len(src)) - copy(dst, src) - - if b, ok := unquoteBytes(dst); ok { - dst = b - } - v := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: d.typ, - ptr: p, - })) - if err := v.(encoding.TextUnmarshaler).UnmarshalText(dst); err != nil { - d.annotateError(s.cursor, err) - return err - } - return nil -} - -func (d *unmarshalTextDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - buf := ctx.Buf - cursor = skipWhiteSpace(buf, cursor) - start := cursor - end, err := skipValue(buf, cursor, depth) - if err != nil { - return 0, err - } - src := buf[start:end] - if len(src) > 0 { - switch src[0] { - case '[': - return 0, &errors.UnmarshalTypeError{ - Value: "array", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case '{': - return 0, &errors.UnmarshalTypeError{ - Value: "object", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return 0, &errors.UnmarshalTypeError{ - Value: "number", - Type: runtime.RType2Type(d.typ), - Offset: start, - } - case 'n': - if bytes.Equal(src, nullbytes) { - *(*unsafe.Pointer)(p) = nil - return end, nil - } - } - } - - if s, ok := unquoteBytes(src); ok { - src = s - } - v := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: d.typ, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&p)), - })) - if err := v.(encoding.TextUnmarshaler).UnmarshalText(src); err != nil { - d.annotateError(cursor, err) - return 0, err - } - return end, nil -} - -func (d *unmarshalTextDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: unmarshal text decoder does not support decode path") -} - -func unquoteBytes(s []byte) (t []byte, ok bool) { //nolint: nonamedreturns - length := len(s) - if length < 2 || s[0] != '"' || s[length-1] != '"' { - return - } - s = s[1 : length-1] - length -= 2 - - // Check for unusual characters. If there are none, - // then no unquoting is needed, so return a slice of the - // original bytes. - r := 0 - for r < length { - c := s[r] - if c == '\\' || c == '"' || c < ' ' { - break - } - if c < utf8.RuneSelf { - r++ - continue - } - rr, size := utf8.DecodeRune(s[r:]) - if rr == utf8.RuneError && size == 1 { - break - } - r += size - } - if r == length { - return s, true - } - - b := make([]byte, length+2*utf8.UTFMax) - w := copy(b, s[0:r]) - for r < length { - // Out of room? Can only happen if s is full of - // malformed UTF-8 and we're replacing each - // byte with RuneError. - if w >= len(b)-2*utf8.UTFMax { - nb := make([]byte, (len(b)+utf8.UTFMax)*2) - copy(nb, b[0:w]) - b = nb - } - switch c := s[r]; { - case c == '\\': - r++ - if r >= length { - return - } - switch s[r] { - default: - return - case '"', '\\', '/', '\'': - b[w] = s[r] - r++ - w++ - case 'b': - b[w] = '\b' - r++ - w++ - case 'f': - b[w] = '\f' - r++ - w++ - case 'n': - b[w] = '\n' - r++ - w++ - case 'r': - b[w] = '\r' - r++ - w++ - case 't': - b[w] = '\t' - r++ - w++ - case 'u': - r-- - rr := getu4(s[r:]) - if rr < 0 { - return - } - r += 6 - if utf16.IsSurrogate(rr) { - rr1 := getu4(s[r:]) - if dec := utf16.DecodeRune(rr, rr1); dec != unicode.ReplacementChar { - // A valid pair; consume. - r += 6 - w += utf8.EncodeRune(b[w:], dec) - break - } - // Invalid surrogate; fall back to replacement rune. - rr = unicode.ReplacementChar - } - w += utf8.EncodeRune(b[w:], rr) - } - - // Quote, control characters are invalid. - case c == '"', c < ' ': - return - - // ASCII - case c < utf8.RuneSelf: - b[w] = c - r++ - w++ - - // Coerce to well-formed UTF-8. - default: - rr, size := utf8.DecodeRune(s[r:]) - r += size - w += utf8.EncodeRune(b[w:], rr) - } - } - return b[0:w], true -} - -func getu4(s []byte) rune { - if len(s) < 6 || s[0] != '\\' || s[1] != 'u' { - return -1 - } - var r rune - for _, c := range s[2:6] { - switch { - case '0' <= c && c <= '9': - c = c - '0' - case 'a' <= c && c <= 'f': - c = c - 'a' + 10 - case 'A' <= c && c <= 'F': - c = c - 'A' + 10 - default: - return -1 - } - r = r*16 + rune(c) - } - return r -} diff --git a/vendor/github.com/goccy/go-json/internal/decoder/wrapped_string.go b/vendor/github.com/goccy/go-json/internal/decoder/wrapped_string.go deleted file mode 100644 index 0c4e2e6eacf..00000000000 --- a/vendor/github.com/goccy/go-json/internal/decoder/wrapped_string.go +++ /dev/null @@ -1,73 +0,0 @@ -package decoder - -import ( - "fmt" - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -type wrappedStringDecoder struct { - typ *runtime.Type - dec Decoder - stringDecoder *stringDecoder - structName string - fieldName string - isPtrType bool -} - -func newWrappedStringDecoder(typ *runtime.Type, dec Decoder, structName, fieldName string) *wrappedStringDecoder { - return &wrappedStringDecoder{ - typ: typ, - dec: dec, - stringDecoder: newStringDecoder(structName, fieldName), - structName: structName, - fieldName: fieldName, - isPtrType: typ.Kind() == reflect.Ptr, - } -} - -func (d *wrappedStringDecoder) DecodeStream(s *Stream, depth int64, p unsafe.Pointer) error { - bytes, err := d.stringDecoder.decodeStreamByte(s) - if err != nil { - return err - } - if bytes == nil { - if d.isPtrType { - *(*unsafe.Pointer)(p) = nil - } - return nil - } - b := make([]byte, len(bytes)+1) - copy(b, bytes) - if _, err := d.dec.Decode(&RuntimeContext{Buf: b}, 0, depth, p); err != nil { - return err - } - return nil -} - -func (d *wrappedStringDecoder) Decode(ctx *RuntimeContext, cursor, depth int64, p unsafe.Pointer) (int64, error) { - bytes, c, err := d.stringDecoder.decodeByte(ctx.Buf, cursor) - if err != nil { - return 0, err - } - if bytes == nil { - if d.isPtrType { - *(*unsafe.Pointer)(p) = nil - } - return c, nil - } - bytes = append(bytes, nul) - oldBuf := ctx.Buf - ctx.Buf = bytes - if _, err := d.dec.Decode(ctx, 0, depth, p); err != nil { - return 0, err - } - ctx.Buf = oldBuf - return c, nil -} - -func (d *wrappedStringDecoder) DecodePath(ctx *RuntimeContext, cursor, depth int64) ([][]byte, int64, error) { - return nil, 0, fmt.Errorf("json: wrapped string decoder does not support decode path") -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/code.go b/vendor/github.com/goccy/go-json/internal/encoder/code.go deleted file mode 100644 index 5b08faefc73..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/code.go +++ /dev/null @@ -1,1023 +0,0 @@ -package encoder - -import ( - "fmt" - "reflect" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -type Code interface { - Kind() CodeKind - ToOpcode(*compileContext) Opcodes - Filter(*FieldQuery) Code -} - -type AnonymousCode interface { - ToAnonymousOpcode(*compileContext) Opcodes -} - -type Opcodes []*Opcode - -func (o Opcodes) First() *Opcode { - if len(o) == 0 { - return nil - } - return o[0] -} - -func (o Opcodes) Last() *Opcode { - if len(o) == 0 { - return nil - } - return o[len(o)-1] -} - -func (o Opcodes) Add(codes ...*Opcode) Opcodes { - return append(o, codes...) -} - -type CodeKind int - -const ( - CodeKindInterface CodeKind = iota - CodeKindPtr - CodeKindInt - CodeKindUint - CodeKindFloat - CodeKindString - CodeKindBool - CodeKindStruct - CodeKindMap - CodeKindSlice - CodeKindArray - CodeKindBytes - CodeKindMarshalJSON - CodeKindMarshalText - CodeKindRecursive -) - -type IntCode struct { - typ *runtime.Type - bitSize uint8 - isString bool - isPtr bool -} - -func (c *IntCode) Kind() CodeKind { - return CodeKindInt -} - -func (c *IntCode) ToOpcode(ctx *compileContext) Opcodes { - var code *Opcode - switch { - case c.isPtr: - code = newOpCode(ctx, c.typ, OpIntPtr) - case c.isString: - code = newOpCode(ctx, c.typ, OpIntString) - default: - code = newOpCode(ctx, c.typ, OpInt) - } - code.NumBitSize = c.bitSize - ctx.incIndex() - return Opcodes{code} -} - -func (c *IntCode) Filter(_ *FieldQuery) Code { - return c -} - -type UintCode struct { - typ *runtime.Type - bitSize uint8 - isString bool - isPtr bool -} - -func (c *UintCode) Kind() CodeKind { - return CodeKindUint -} - -func (c *UintCode) ToOpcode(ctx *compileContext) Opcodes { - var code *Opcode - switch { - case c.isPtr: - code = newOpCode(ctx, c.typ, OpUintPtr) - case c.isString: - code = newOpCode(ctx, c.typ, OpUintString) - default: - code = newOpCode(ctx, c.typ, OpUint) - } - code.NumBitSize = c.bitSize - ctx.incIndex() - return Opcodes{code} -} - -func (c *UintCode) Filter(_ *FieldQuery) Code { - return c -} - -type FloatCode struct { - typ *runtime.Type - bitSize uint8 - isPtr bool -} - -func (c *FloatCode) Kind() CodeKind { - return CodeKindFloat -} - -func (c *FloatCode) ToOpcode(ctx *compileContext) Opcodes { - var code *Opcode - switch { - case c.isPtr: - switch c.bitSize { - case 32: - code = newOpCode(ctx, c.typ, OpFloat32Ptr) - default: - code = newOpCode(ctx, c.typ, OpFloat64Ptr) - } - default: - switch c.bitSize { - case 32: - code = newOpCode(ctx, c.typ, OpFloat32) - default: - code = newOpCode(ctx, c.typ, OpFloat64) - } - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *FloatCode) Filter(_ *FieldQuery) Code { - return c -} - -type StringCode struct { - typ *runtime.Type - isPtr bool -} - -func (c *StringCode) Kind() CodeKind { - return CodeKindString -} - -func (c *StringCode) ToOpcode(ctx *compileContext) Opcodes { - isJSONNumberType := c.typ == runtime.Type2RType(jsonNumberType) - var code *Opcode - if c.isPtr { - if isJSONNumberType { - code = newOpCode(ctx, c.typ, OpNumberPtr) - } else { - code = newOpCode(ctx, c.typ, OpStringPtr) - } - } else { - if isJSONNumberType { - code = newOpCode(ctx, c.typ, OpNumber) - } else { - code = newOpCode(ctx, c.typ, OpString) - } - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *StringCode) Filter(_ *FieldQuery) Code { - return c -} - -type BoolCode struct { - typ *runtime.Type - isPtr bool -} - -func (c *BoolCode) Kind() CodeKind { - return CodeKindBool -} - -func (c *BoolCode) ToOpcode(ctx *compileContext) Opcodes { - var code *Opcode - switch { - case c.isPtr: - code = newOpCode(ctx, c.typ, OpBoolPtr) - default: - code = newOpCode(ctx, c.typ, OpBool) - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *BoolCode) Filter(_ *FieldQuery) Code { - return c -} - -type BytesCode struct { - typ *runtime.Type - isPtr bool -} - -func (c *BytesCode) Kind() CodeKind { - return CodeKindBytes -} - -func (c *BytesCode) ToOpcode(ctx *compileContext) Opcodes { - var code *Opcode - switch { - case c.isPtr: - code = newOpCode(ctx, c.typ, OpBytesPtr) - default: - code = newOpCode(ctx, c.typ, OpBytes) - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *BytesCode) Filter(_ *FieldQuery) Code { - return c -} - -type SliceCode struct { - typ *runtime.Type - value Code -} - -func (c *SliceCode) Kind() CodeKind { - return CodeKindSlice -} - -func (c *SliceCode) ToOpcode(ctx *compileContext) Opcodes { - // header => opcode => elem => end - // ^ | - // |________| - size := c.typ.Elem().Size() - header := newSliceHeaderCode(ctx, c.typ) - ctx.incIndex() - - ctx.incIndent() - codes := c.value.ToOpcode(ctx) - ctx.decIndent() - - codes.First().Flags |= IndirectFlags - elemCode := newSliceElemCode(ctx, c.typ.Elem(), header, size) - ctx.incIndex() - end := newOpCode(ctx, c.typ, OpSliceEnd) - ctx.incIndex() - header.End = end - header.Next = codes.First() - codes.Last().Next = elemCode - elemCode.Next = codes.First() - elemCode.End = end - return Opcodes{header}.Add(codes...).Add(elemCode).Add(end) -} - -func (c *SliceCode) Filter(_ *FieldQuery) Code { - return c -} - -type ArrayCode struct { - typ *runtime.Type - value Code -} - -func (c *ArrayCode) Kind() CodeKind { - return CodeKindArray -} - -func (c *ArrayCode) ToOpcode(ctx *compileContext) Opcodes { - // header => opcode => elem => end - // ^ | - // |________| - elem := c.typ.Elem() - alen := c.typ.Len() - size := elem.Size() - - header := newArrayHeaderCode(ctx, c.typ, alen) - ctx.incIndex() - - ctx.incIndent() - codes := c.value.ToOpcode(ctx) - ctx.decIndent() - - codes.First().Flags |= IndirectFlags - - elemCode := newArrayElemCode(ctx, elem, header, alen, size) - ctx.incIndex() - - end := newOpCode(ctx, c.typ, OpArrayEnd) - ctx.incIndex() - - header.End = end - header.Next = codes.First() - codes.Last().Next = elemCode - elemCode.Next = codes.First() - elemCode.End = end - - return Opcodes{header}.Add(codes...).Add(elemCode).Add(end) -} - -func (c *ArrayCode) Filter(_ *FieldQuery) Code { - return c -} - -type MapCode struct { - typ *runtime.Type - key Code - value Code -} - -func (c *MapCode) Kind() CodeKind { - return CodeKindMap -} - -func (c *MapCode) ToOpcode(ctx *compileContext) Opcodes { - // header => code => value => code => key => code => value => code => end - // ^ | - // |_______________________| - header := newMapHeaderCode(ctx, c.typ) - ctx.incIndex() - - keyCodes := c.key.ToOpcode(ctx) - - value := newMapValueCode(ctx, c.typ.Elem(), header) - ctx.incIndex() - - ctx.incIndent() - valueCodes := c.value.ToOpcode(ctx) - ctx.decIndent() - - valueCodes.First().Flags |= IndirectFlags - - key := newMapKeyCode(ctx, c.typ.Key(), header) - ctx.incIndex() - - end := newMapEndCode(ctx, c.typ, header) - ctx.incIndex() - - header.Next = keyCodes.First() - keyCodes.Last().Next = value - value.Next = valueCodes.First() - valueCodes.Last().Next = key - key.Next = keyCodes.First() - - header.End = end - key.End = end - value.End = end - return Opcodes{header}.Add(keyCodes...).Add(value).Add(valueCodes...).Add(key).Add(end) -} - -func (c *MapCode) Filter(_ *FieldQuery) Code { - return c -} - -type StructCode struct { - typ *runtime.Type - fields []*StructFieldCode - isPtr bool - disableIndirectConversion bool - isIndirect bool - isRecursive bool -} - -func (c *StructCode) Kind() CodeKind { - return CodeKindStruct -} - -func (c *StructCode) lastFieldCode(field *StructFieldCode, firstField *Opcode) *Opcode { - if isEmbeddedStruct(field) { - return c.lastAnonymousFieldCode(firstField) - } - lastField := firstField - for lastField.NextField != nil { - lastField = lastField.NextField - } - return lastField -} - -func (c *StructCode) lastAnonymousFieldCode(firstField *Opcode) *Opcode { - // firstField is special StructHead operation for anonymous structure. - // So, StructHead's next operation is truly struct head operation. - for firstField.Op == OpStructHead || firstField.Op == OpStructField { - firstField = firstField.Next - } - lastField := firstField - for lastField.NextField != nil { - lastField = lastField.NextField - } - return lastField -} - -func (c *StructCode) ToOpcode(ctx *compileContext) Opcodes { - // header => code => structField => code => end - // ^ | - // |__________| - if c.isRecursive { - recursive := newRecursiveCode(ctx, c.typ, &CompiledCode{}) - recursive.Type = c.typ - ctx.incIndex() - *ctx.recursiveCodes = append(*ctx.recursiveCodes, recursive) - return Opcodes{recursive} - } - codes := Opcodes{} - var prevField *Opcode - ctx.incIndent() - for idx, field := range c.fields { - isFirstField := idx == 0 - isEndField := idx == len(c.fields)-1 - fieldCodes := field.ToOpcode(ctx, isFirstField, isEndField) - for _, code := range fieldCodes { - if c.isIndirect { - code.Flags |= IndirectFlags - } - } - firstField := fieldCodes.First() - if len(codes) > 0 { - codes.Last().Next = firstField - firstField.Idx = codes.First().Idx - } - if prevField != nil { - prevField.NextField = firstField - } - if isEndField { - endField := fieldCodes.Last() - if len(codes) > 0 { - codes.First().End = endField - } else { - firstField.End = endField - } - codes = codes.Add(fieldCodes...) - break - } - prevField = c.lastFieldCode(field, firstField) - codes = codes.Add(fieldCodes...) - } - if len(codes) == 0 { - head := &Opcode{ - Op: OpStructHead, - Idx: opcodeOffset(ctx.ptrIndex), - Type: c.typ, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } - ctx.incOpcodeIndex() - end := &Opcode{ - Op: OpStructEnd, - Idx: opcodeOffset(ctx.ptrIndex), - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } - head.NextField = end - head.Next = end - head.End = end - codes = codes.Add(head, end) - ctx.incIndex() - } - ctx.decIndent() - ctx.structTypeToCodes[uintptr(unsafe.Pointer(c.typ))] = codes - return codes -} - -func (c *StructCode) ToAnonymousOpcode(ctx *compileContext) Opcodes { - // header => code => structField => code => end - // ^ | - // |__________| - if c.isRecursive { - recursive := newRecursiveCode(ctx, c.typ, &CompiledCode{}) - recursive.Type = c.typ - ctx.incIndex() - *ctx.recursiveCodes = append(*ctx.recursiveCodes, recursive) - return Opcodes{recursive} - } - codes := Opcodes{} - var prevField *Opcode - for idx, field := range c.fields { - isFirstField := idx == 0 - isEndField := idx == len(c.fields)-1 - fieldCodes := field.ToAnonymousOpcode(ctx, isFirstField, isEndField) - for _, code := range fieldCodes { - if c.isIndirect { - code.Flags |= IndirectFlags - } - } - firstField := fieldCodes.First() - if len(codes) > 0 { - codes.Last().Next = firstField - firstField.Idx = codes.First().Idx - } - if prevField != nil { - prevField.NextField = firstField - } - if isEndField { - lastField := fieldCodes.Last() - if len(codes) > 0 { - codes.First().End = lastField - } else { - firstField.End = lastField - } - } - prevField = firstField - codes = codes.Add(fieldCodes...) - } - return codes -} - -func (c *StructCode) removeFieldsByTags(tags runtime.StructTags) { - fields := make([]*StructFieldCode, 0, len(c.fields)) - for _, field := range c.fields { - if field.isAnonymous { - structCode := field.getAnonymousStruct() - if structCode != nil && !structCode.isRecursive { - structCode.removeFieldsByTags(tags) - if len(structCode.fields) > 0 { - fields = append(fields, field) - } - continue - } - } - if tags.ExistsKey(field.key) { - continue - } - fields = append(fields, field) - } - c.fields = fields -} - -func (c *StructCode) enableIndirect() { - if c.isIndirect { - return - } - c.isIndirect = true - if len(c.fields) == 0 { - return - } - structCode := c.fields[0].getStruct() - if structCode == nil { - return - } - structCode.enableIndirect() -} - -func (c *StructCode) Filter(query *FieldQuery) Code { - fieldMap := map[string]*FieldQuery{} - for _, field := range query.Fields { - fieldMap[field.Name] = field - } - fields := make([]*StructFieldCode, 0, len(c.fields)) - for _, field := range c.fields { - query, exists := fieldMap[field.key] - if !exists { - continue - } - fieldCode := &StructFieldCode{ - typ: field.typ, - key: field.key, - tag: field.tag, - value: field.value, - offset: field.offset, - isAnonymous: field.isAnonymous, - isTaggedKey: field.isTaggedKey, - isNilableType: field.isNilableType, - isNilCheck: field.isNilCheck, - isAddrForMarshaler: field.isAddrForMarshaler, - isNextOpPtrType: field.isNextOpPtrType, - } - if len(query.Fields) > 0 { - fieldCode.value = fieldCode.value.Filter(query) - } - fields = append(fields, fieldCode) - } - return &StructCode{ - typ: c.typ, - fields: fields, - isPtr: c.isPtr, - disableIndirectConversion: c.disableIndirectConversion, - isIndirect: c.isIndirect, - isRecursive: c.isRecursive, - } -} - -type StructFieldCode struct { - typ *runtime.Type - key string - tag *runtime.StructTag - value Code - offset uintptr - isAnonymous bool - isTaggedKey bool - isNilableType bool - isNilCheck bool - isAddrForMarshaler bool - isNextOpPtrType bool - isMarshalerContext bool -} - -func (c *StructFieldCode) getStruct() *StructCode { - value := c.value - ptr, ok := value.(*PtrCode) - if ok { - value = ptr.value - } - structCode, ok := value.(*StructCode) - if ok { - return structCode - } - return nil -} - -func (c *StructFieldCode) getAnonymousStruct() *StructCode { - if !c.isAnonymous { - return nil - } - return c.getStruct() -} - -func optimizeStructHeader(code *Opcode, tag *runtime.StructTag) OpType { - headType := code.ToHeaderType(tag.IsString) - if tag.IsOmitEmpty { - headType = headType.HeadToOmitEmptyHead() - } - return headType -} - -func optimizeStructField(code *Opcode, tag *runtime.StructTag) OpType { - fieldType := code.ToFieldType(tag.IsString) - if tag.IsOmitEmpty { - fieldType = fieldType.FieldToOmitEmptyField() - } - return fieldType -} - -func (c *StructFieldCode) headerOpcodes(ctx *compileContext, field *Opcode, valueCodes Opcodes) Opcodes { - value := valueCodes.First() - op := optimizeStructHeader(value, c.tag) - field.Op = op - if value.Flags&MarshalerContextFlags != 0 { - field.Flags |= MarshalerContextFlags - } - field.NumBitSize = value.NumBitSize - field.PtrNum = value.PtrNum - field.FieldQuery = value.FieldQuery - fieldCodes := Opcodes{field} - if op.IsMultipleOpHead() { - field.Next = value - fieldCodes = fieldCodes.Add(valueCodes...) - } else { - ctx.decIndex() - } - return fieldCodes -} - -func (c *StructFieldCode) fieldOpcodes(ctx *compileContext, field *Opcode, valueCodes Opcodes) Opcodes { - value := valueCodes.First() - op := optimizeStructField(value, c.tag) - field.Op = op - if value.Flags&MarshalerContextFlags != 0 { - field.Flags |= MarshalerContextFlags - } - field.NumBitSize = value.NumBitSize - field.PtrNum = value.PtrNum - field.FieldQuery = value.FieldQuery - - fieldCodes := Opcodes{field} - if op.IsMultipleOpField() { - field.Next = value - fieldCodes = fieldCodes.Add(valueCodes...) - } else { - ctx.decIndex() - } - return fieldCodes -} - -func (c *StructFieldCode) addStructEndCode(ctx *compileContext, codes Opcodes) Opcodes { - end := &Opcode{ - Op: OpStructEnd, - Idx: opcodeOffset(ctx.ptrIndex), - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } - codes.Last().Next = end - code := codes.First() - for code.Op == OpStructField || code.Op == OpStructHead { - code = code.Next - } - for code.NextField != nil { - code = code.NextField - } - code.NextField = end - - codes = codes.Add(end) - ctx.incOpcodeIndex() - return codes -} - -func (c *StructFieldCode) structKey(ctx *compileContext) string { - if ctx.escapeKey { - rctx := &RuntimeContext{Option: &Option{Flag: HTMLEscapeOption}} - return fmt.Sprintf(`%s:`, string(AppendString(rctx, []byte{}, c.key))) - } - return fmt.Sprintf(`"%s":`, c.key) -} - -func (c *StructFieldCode) flags() OpFlags { - var flags OpFlags - if c.isTaggedKey { - flags |= IsTaggedKeyFlags - } - if c.isNilableType { - flags |= IsNilableTypeFlags - } - if c.isNilCheck { - flags |= NilCheckFlags - } - if c.isAddrForMarshaler { - flags |= AddrForMarshalerFlags - } - if c.isNextOpPtrType { - flags |= IsNextOpPtrTypeFlags - } - if c.isAnonymous { - flags |= AnonymousKeyFlags - } - if c.isMarshalerContext { - flags |= MarshalerContextFlags - } - return flags -} - -func (c *StructFieldCode) toValueOpcodes(ctx *compileContext) Opcodes { - if c.isAnonymous { - anonymCode, ok := c.value.(AnonymousCode) - if ok { - return anonymCode.ToAnonymousOpcode(ctx) - } - } - return c.value.ToOpcode(ctx) -} - -func (c *StructFieldCode) ToOpcode(ctx *compileContext, isFirstField, isEndField bool) Opcodes { - field := &Opcode{ - Idx: opcodeOffset(ctx.ptrIndex), - Flags: c.flags(), - Key: c.structKey(ctx), - Offset: uint32(c.offset), - Type: c.typ, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - DisplayKey: c.key, - } - ctx.incIndex() - valueCodes := c.toValueOpcodes(ctx) - if isFirstField { - codes := c.headerOpcodes(ctx, field, valueCodes) - if isEndField { - codes = c.addStructEndCode(ctx, codes) - } - return codes - } - codes := c.fieldOpcodes(ctx, field, valueCodes) - if isEndField { - if isEnableStructEndOptimization(c.value) { - field.Op = field.Op.FieldToEnd() - } else { - codes = c.addStructEndCode(ctx, codes) - } - } - return codes -} - -func (c *StructFieldCode) ToAnonymousOpcode(ctx *compileContext, isFirstField, isEndField bool) Opcodes { - field := &Opcode{ - Idx: opcodeOffset(ctx.ptrIndex), - Flags: c.flags() | AnonymousHeadFlags, - Key: c.structKey(ctx), - Offset: uint32(c.offset), - Type: c.typ, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - DisplayKey: c.key, - } - ctx.incIndex() - valueCodes := c.toValueOpcodes(ctx) - if isFirstField { - return c.headerOpcodes(ctx, field, valueCodes) - } - return c.fieldOpcodes(ctx, field, valueCodes) -} - -func isEnableStructEndOptimization(value Code) bool { - switch value.Kind() { - case CodeKindInt, - CodeKindUint, - CodeKindFloat, - CodeKindString, - CodeKindBool, - CodeKindBytes: - return true - case CodeKindPtr: - return isEnableStructEndOptimization(value.(*PtrCode).value) - default: - return false - } -} - -type InterfaceCode struct { - typ *runtime.Type - fieldQuery *FieldQuery - isPtr bool -} - -func (c *InterfaceCode) Kind() CodeKind { - return CodeKindInterface -} - -func (c *InterfaceCode) ToOpcode(ctx *compileContext) Opcodes { - var code *Opcode - switch { - case c.isPtr: - code = newOpCode(ctx, c.typ, OpInterfacePtr) - default: - code = newOpCode(ctx, c.typ, OpInterface) - } - code.FieldQuery = c.fieldQuery - if c.typ.NumMethod() > 0 { - code.Flags |= NonEmptyInterfaceFlags - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *InterfaceCode) Filter(query *FieldQuery) Code { - return &InterfaceCode{ - typ: c.typ, - fieldQuery: query, - isPtr: c.isPtr, - } -} - -type MarshalJSONCode struct { - typ *runtime.Type - fieldQuery *FieldQuery - isAddrForMarshaler bool - isNilableType bool - isMarshalerContext bool -} - -func (c *MarshalJSONCode) Kind() CodeKind { - return CodeKindMarshalJSON -} - -func (c *MarshalJSONCode) ToOpcode(ctx *compileContext) Opcodes { - code := newOpCode(ctx, c.typ, OpMarshalJSON) - code.FieldQuery = c.fieldQuery - if c.isAddrForMarshaler { - code.Flags |= AddrForMarshalerFlags - } - if c.isMarshalerContext { - code.Flags |= MarshalerContextFlags - } - if c.isNilableType { - code.Flags |= IsNilableTypeFlags - } else { - code.Flags &= ^IsNilableTypeFlags - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *MarshalJSONCode) Filter(query *FieldQuery) Code { - return &MarshalJSONCode{ - typ: c.typ, - fieldQuery: query, - isAddrForMarshaler: c.isAddrForMarshaler, - isNilableType: c.isNilableType, - isMarshalerContext: c.isMarshalerContext, - } -} - -type MarshalTextCode struct { - typ *runtime.Type - fieldQuery *FieldQuery - isAddrForMarshaler bool - isNilableType bool -} - -func (c *MarshalTextCode) Kind() CodeKind { - return CodeKindMarshalText -} - -func (c *MarshalTextCode) ToOpcode(ctx *compileContext) Opcodes { - code := newOpCode(ctx, c.typ, OpMarshalText) - code.FieldQuery = c.fieldQuery - if c.isAddrForMarshaler { - code.Flags |= AddrForMarshalerFlags - } - if c.isNilableType { - code.Flags |= IsNilableTypeFlags - } else { - code.Flags &= ^IsNilableTypeFlags - } - ctx.incIndex() - return Opcodes{code} -} - -func (c *MarshalTextCode) Filter(query *FieldQuery) Code { - return &MarshalTextCode{ - typ: c.typ, - fieldQuery: query, - isAddrForMarshaler: c.isAddrForMarshaler, - isNilableType: c.isNilableType, - } -} - -type PtrCode struct { - typ *runtime.Type - value Code - ptrNum uint8 -} - -func (c *PtrCode) Kind() CodeKind { - return CodeKindPtr -} - -func (c *PtrCode) ToOpcode(ctx *compileContext) Opcodes { - codes := c.value.ToOpcode(ctx) - codes.First().Op = convertPtrOp(codes.First()) - codes.First().PtrNum = c.ptrNum - return codes -} - -func (c *PtrCode) ToAnonymousOpcode(ctx *compileContext) Opcodes { - var codes Opcodes - anonymCode, ok := c.value.(AnonymousCode) - if ok { - codes = anonymCode.ToAnonymousOpcode(ctx) - } else { - codes = c.value.ToOpcode(ctx) - } - codes.First().Op = convertPtrOp(codes.First()) - codes.First().PtrNum = c.ptrNum - return codes -} - -func (c *PtrCode) Filter(query *FieldQuery) Code { - return &PtrCode{ - typ: c.typ, - value: c.value.Filter(query), - ptrNum: c.ptrNum, - } -} - -func convertPtrOp(code *Opcode) OpType { - ptrHeadOp := code.Op.HeadToPtrHead() - if code.Op != ptrHeadOp { - if code.PtrNum > 0 { - // ptr field and ptr head - code.PtrNum-- - } - return ptrHeadOp - } - switch code.Op { - case OpInt: - return OpIntPtr - case OpUint: - return OpUintPtr - case OpFloat32: - return OpFloat32Ptr - case OpFloat64: - return OpFloat64Ptr - case OpString: - return OpStringPtr - case OpBool: - return OpBoolPtr - case OpBytes: - return OpBytesPtr - case OpNumber: - return OpNumberPtr - case OpArray: - return OpArrayPtr - case OpSlice: - return OpSlicePtr - case OpMap: - return OpMapPtr - case OpMarshalJSON: - return OpMarshalJSONPtr - case OpMarshalText: - return OpMarshalTextPtr - case OpInterface: - return OpInterfacePtr - case OpRecursive: - return OpRecursivePtr - } - return code.Op -} - -func isEmbeddedStruct(field *StructFieldCode) bool { - if !field.isAnonymous { - return false - } - t := field.typ - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - return t.Kind() == reflect.Struct -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/compact.go b/vendor/github.com/goccy/go-json/internal/encoder/compact.go deleted file mode 100644 index e287a6c03f4..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/compact.go +++ /dev/null @@ -1,286 +0,0 @@ -package encoder - -import ( - "bytes" - "fmt" - "strconv" - "unsafe" - - "github.com/goccy/go-json/internal/errors" -) - -var ( - isWhiteSpace = [256]bool{ - ' ': true, - '\n': true, - '\t': true, - '\r': true, - } - isHTMLEscapeChar = [256]bool{ - '<': true, - '>': true, - '&': true, - } - nul = byte('\000') -) - -func Compact(buf *bytes.Buffer, src []byte, escape bool) error { - if len(src) == 0 { - return errors.ErrUnexpectedEndOfJSON("", 0) - } - buf.Grow(len(src)) - dst := buf.Bytes() - - ctx := TakeRuntimeContext() - ctxBuf := ctx.Buf[:0] - ctxBuf = append(append(ctxBuf, src...), nul) - ctx.Buf = ctxBuf - - if err := compactAndWrite(buf, dst, ctxBuf, escape); err != nil { - ReleaseRuntimeContext(ctx) - return err - } - ReleaseRuntimeContext(ctx) - return nil -} - -func compactAndWrite(buf *bytes.Buffer, dst []byte, src []byte, escape bool) error { - dst, err := compact(dst, src, escape) - if err != nil { - return err - } - if _, err := buf.Write(dst); err != nil { - return err - } - return nil -} - -func compact(dst, src []byte, escape bool) ([]byte, error) { - buf, cursor, err := compactValue(dst, src, 0, escape) - if err != nil { - return nil, err - } - if err := validateEndBuf(src, cursor); err != nil { - return nil, err - } - return buf, nil -} - -func validateEndBuf(src []byte, cursor int64) error { - for { - switch src[cursor] { - case ' ', '\t', '\n', '\r': - cursor++ - continue - case nul: - return nil - } - return errors.ErrSyntax( - fmt.Sprintf("invalid character '%c' after top-level value", src[cursor]), - cursor+1, - ) - } -} - -func skipWhiteSpace(buf []byte, cursor int64) int64 { -LOOP: - if isWhiteSpace[buf[cursor]] { - cursor++ - goto LOOP - } - return cursor -} - -func compactValue(dst, src []byte, cursor int64, escape bool) ([]byte, int64, error) { - for { - switch src[cursor] { - case ' ', '\t', '\n', '\r': - cursor++ - continue - case '{': - return compactObject(dst, src, cursor, escape) - case '}': - return nil, 0, errors.ErrSyntax("unexpected character '}'", cursor) - case '[': - return compactArray(dst, src, cursor, escape) - case ']': - return nil, 0, errors.ErrSyntax("unexpected character ']'", cursor) - case '"': - return compactString(dst, src, cursor, escape) - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return compactNumber(dst, src, cursor) - case 't': - return compactTrue(dst, src, cursor) - case 'f': - return compactFalse(dst, src, cursor) - case 'n': - return compactNull(dst, src, cursor) - default: - return nil, 0, errors.ErrSyntax(fmt.Sprintf("unexpected character '%c'", src[cursor]), cursor) - } - } -} - -func compactObject(dst, src []byte, cursor int64, escape bool) ([]byte, int64, error) { - if src[cursor] == '{' { - dst = append(dst, '{') - } else { - return nil, 0, errors.ErrExpected("expected { character for object value", cursor) - } - cursor = skipWhiteSpace(src, cursor+1) - if src[cursor] == '}' { - dst = append(dst, '}') - return dst, cursor + 1, nil - } - var err error - for { - cursor = skipWhiteSpace(src, cursor) - dst, cursor, err = compactString(dst, src, cursor, escape) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(src, cursor) - if src[cursor] != ':' { - return nil, 0, errors.ErrExpected("colon after object key", cursor) - } - dst = append(dst, ':') - dst, cursor, err = compactValue(dst, src, cursor+1, escape) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(src, cursor) - switch src[cursor] { - case '}': - dst = append(dst, '}') - cursor++ - return dst, cursor, nil - case ',': - dst = append(dst, ',') - default: - return nil, 0, errors.ErrExpected("comma after object value", cursor) - } - cursor++ - } -} - -func compactArray(dst, src []byte, cursor int64, escape bool) ([]byte, int64, error) { - if src[cursor] == '[' { - dst = append(dst, '[') - } else { - return nil, 0, errors.ErrExpected("expected [ character for array value", cursor) - } - cursor = skipWhiteSpace(src, cursor+1) - if src[cursor] == ']' { - dst = append(dst, ']') - return dst, cursor + 1, nil - } - var err error - for { - dst, cursor, err = compactValue(dst, src, cursor, escape) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(src, cursor) - switch src[cursor] { - case ']': - dst = append(dst, ']') - cursor++ - return dst, cursor, nil - case ',': - dst = append(dst, ',') - default: - return nil, 0, errors.ErrExpected("comma after array value", cursor) - } - cursor++ - } -} - -func compactString(dst, src []byte, cursor int64, escape bool) ([]byte, int64, error) { - if src[cursor] != '"' { - return nil, 0, errors.ErrInvalidCharacter(src[cursor], "string", cursor) - } - start := cursor - for { - cursor++ - c := src[cursor] - if escape { - if isHTMLEscapeChar[c] { - dst = append(dst, src[start:cursor]...) - dst = append(dst, `\u00`...) - dst = append(dst, hex[c>>4], hex[c&0xF]) - start = cursor + 1 - } else if c == 0xE2 && cursor+2 < int64(len(src)) && src[cursor+1] == 0x80 && src[cursor+2]&^1 == 0xA8 { - dst = append(dst, src[start:cursor]...) - dst = append(dst, `\u202`...) - dst = append(dst, hex[src[cursor+2]&0xF]) - start = cursor + 3 - cursor += 2 - } - } - switch c { - case '\\': - cursor++ - if src[cursor] == nul { - return nil, 0, errors.ErrUnexpectedEndOfJSON("string", int64(len(src))) - } - case '"': - cursor++ - return append(dst, src[start:cursor]...), cursor, nil - case nul: - return nil, 0, errors.ErrUnexpectedEndOfJSON("string", int64(len(src))) - } - } -} - -func compactNumber(dst, src []byte, cursor int64) ([]byte, int64, error) { - start := cursor - for { - cursor++ - if floatTable[src[cursor]] { - continue - } - break - } - num := src[start:cursor] - if _, err := strconv.ParseFloat(*(*string)(unsafe.Pointer(&num)), 64); err != nil { - return nil, 0, err - } - dst = append(dst, num...) - return dst, cursor, nil -} - -func compactTrue(dst, src []byte, cursor int64) ([]byte, int64, error) { - if cursor+3 >= int64(len(src)) { - return nil, 0, errors.ErrUnexpectedEndOfJSON("true", cursor) - } - if !bytes.Equal(src[cursor:cursor+4], []byte(`true`)) { - return nil, 0, errors.ErrInvalidCharacter(src[cursor], "true", cursor) - } - dst = append(dst, "true"...) - cursor += 4 - return dst, cursor, nil -} - -func compactFalse(dst, src []byte, cursor int64) ([]byte, int64, error) { - if cursor+4 >= int64(len(src)) { - return nil, 0, errors.ErrUnexpectedEndOfJSON("false", cursor) - } - if !bytes.Equal(src[cursor:cursor+5], []byte(`false`)) { - return nil, 0, errors.ErrInvalidCharacter(src[cursor], "false", cursor) - } - dst = append(dst, "false"...) - cursor += 5 - return dst, cursor, nil -} - -func compactNull(dst, src []byte, cursor int64) ([]byte, int64, error) { - if cursor+3 >= int64(len(src)) { - return nil, 0, errors.ErrUnexpectedEndOfJSON("null", cursor) - } - if !bytes.Equal(src[cursor:cursor+4], []byte(`null`)) { - return nil, 0, errors.ErrInvalidCharacter(src[cursor], "null", cursor) - } - dst = append(dst, "null"...) - cursor += 4 - return dst, cursor, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/compiler.go b/vendor/github.com/goccy/go-json/internal/encoder/compiler.go deleted file mode 100644 index b107636890a..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/compiler.go +++ /dev/null @@ -1,939 +0,0 @@ -package encoder - -import ( - "context" - "encoding" - "encoding/json" - "reflect" - "sync" - "sync/atomic" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -type marshalerContext interface { - MarshalJSON(context.Context) ([]byte, error) -} - -var ( - marshalJSONType = reflect.TypeOf((*json.Marshaler)(nil)).Elem() - marshalJSONContextType = reflect.TypeOf((*marshalerContext)(nil)).Elem() - marshalTextType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() - jsonNumberType = reflect.TypeOf(json.Number("")) - cachedOpcodeSets []*OpcodeSet - cachedOpcodeMap unsafe.Pointer // map[uintptr]*OpcodeSet - typeAddr *runtime.TypeAddr - initEncoderOnce sync.Once -) - -func initEncoder() { - initEncoderOnce.Do(func() { - typeAddr = runtime.AnalyzeTypeAddr() - if typeAddr == nil { - typeAddr = &runtime.TypeAddr{} - } - cachedOpcodeSets = make([]*OpcodeSet, typeAddr.AddrRange>>typeAddr.AddrShift+1) - }) -} - -func loadOpcodeMap() map[uintptr]*OpcodeSet { - p := atomic.LoadPointer(&cachedOpcodeMap) - return *(*map[uintptr]*OpcodeSet)(unsafe.Pointer(&p)) -} - -func storeOpcodeSet(typ uintptr, set *OpcodeSet, m map[uintptr]*OpcodeSet) { - newOpcodeMap := make(map[uintptr]*OpcodeSet, len(m)+1) - newOpcodeMap[typ] = set - - for k, v := range m { - newOpcodeMap[k] = v - } - - atomic.StorePointer(&cachedOpcodeMap, *(*unsafe.Pointer)(unsafe.Pointer(&newOpcodeMap))) -} - -func compileToGetCodeSetSlowPath(typeptr uintptr) (*OpcodeSet, error) { - opcodeMap := loadOpcodeMap() - if codeSet, exists := opcodeMap[typeptr]; exists { - return codeSet, nil - } - codeSet, err := newCompiler().compile(typeptr) - if err != nil { - return nil, err - } - storeOpcodeSet(typeptr, codeSet, opcodeMap) - return codeSet, nil -} - -func getFilteredCodeSetIfNeeded(ctx *RuntimeContext, codeSet *OpcodeSet) (*OpcodeSet, error) { - if (ctx.Option.Flag & ContextOption) == 0 { - return codeSet, nil - } - query := FieldQueryFromContext(ctx.Option.Context) - if query == nil { - return codeSet, nil - } - ctx.Option.Flag |= FieldQueryOption - cacheCodeSet := codeSet.getQueryCache(query.Hash()) - if cacheCodeSet != nil { - return cacheCodeSet, nil - } - queryCodeSet, err := newCompiler().codeToOpcodeSet(codeSet.Type, codeSet.Code.Filter(query)) - if err != nil { - return nil, err - } - codeSet.setQueryCache(query.Hash(), queryCodeSet) - return queryCodeSet, nil -} - -type Compiler struct { - structTypeToCode map[uintptr]*StructCode -} - -func newCompiler() *Compiler { - return &Compiler{ - structTypeToCode: map[uintptr]*StructCode{}, - } -} - -func (c *Compiler) compile(typeptr uintptr) (*OpcodeSet, error) { - // noescape trick for header.typ ( reflect.*rtype ) - typ := *(**runtime.Type)(unsafe.Pointer(&typeptr)) - code, err := c.typeToCode(typ) - if err != nil { - return nil, err - } - return c.codeToOpcodeSet(typ, code) -} - -func (c *Compiler) codeToOpcodeSet(typ *runtime.Type, code Code) (*OpcodeSet, error) { - noescapeKeyCode := c.codeToOpcode(&compileContext{ - structTypeToCodes: map[uintptr]Opcodes{}, - recursiveCodes: &Opcodes{}, - }, typ, code) - if err := noescapeKeyCode.Validate(); err != nil { - return nil, err - } - escapeKeyCode := c.codeToOpcode(&compileContext{ - structTypeToCodes: map[uintptr]Opcodes{}, - recursiveCodes: &Opcodes{}, - escapeKey: true, - }, typ, code) - noescapeKeyCode = copyOpcode(noescapeKeyCode) - escapeKeyCode = copyOpcode(escapeKeyCode) - setTotalLengthToInterfaceOp(noescapeKeyCode) - setTotalLengthToInterfaceOp(escapeKeyCode) - interfaceNoescapeKeyCode := copyToInterfaceOpcode(noescapeKeyCode) - interfaceEscapeKeyCode := copyToInterfaceOpcode(escapeKeyCode) - codeLength := noescapeKeyCode.TotalLength() - return &OpcodeSet{ - Type: typ, - NoescapeKeyCode: noescapeKeyCode, - EscapeKeyCode: escapeKeyCode, - InterfaceNoescapeKeyCode: interfaceNoescapeKeyCode, - InterfaceEscapeKeyCode: interfaceEscapeKeyCode, - CodeLength: codeLength, - EndCode: ToEndCode(interfaceNoescapeKeyCode), - Code: code, - QueryCache: map[string]*OpcodeSet{}, - }, nil -} - -func (c *Compiler) typeToCode(typ *runtime.Type) (Code, error) { - switch { - case c.implementsMarshalJSON(typ): - return c.marshalJSONCode(typ) - case c.implementsMarshalText(typ): - return c.marshalTextCode(typ) - } - - isPtr := false - orgType := typ - if typ.Kind() == reflect.Ptr { - typ = typ.Elem() - isPtr = true - } - switch { - case c.implementsMarshalJSON(typ): - return c.marshalJSONCode(orgType) - case c.implementsMarshalText(typ): - return c.marshalTextCode(orgType) - } - switch typ.Kind() { - case reflect.Slice: - elem := typ.Elem() - if elem.Kind() == reflect.Uint8 { - p := runtime.PtrTo(elem) - if !c.implementsMarshalJSONType(p) && !p.Implements(marshalTextType) { - return c.bytesCode(typ, isPtr) - } - } - return c.sliceCode(typ) - case reflect.Map: - if isPtr { - return c.ptrCode(runtime.PtrTo(typ)) - } - return c.mapCode(typ) - case reflect.Struct: - return c.structCode(typ, isPtr) - case reflect.Int: - return c.intCode(typ, isPtr) - case reflect.Int8: - return c.int8Code(typ, isPtr) - case reflect.Int16: - return c.int16Code(typ, isPtr) - case reflect.Int32: - return c.int32Code(typ, isPtr) - case reflect.Int64: - return c.int64Code(typ, isPtr) - case reflect.Uint, reflect.Uintptr: - return c.uintCode(typ, isPtr) - case reflect.Uint8: - return c.uint8Code(typ, isPtr) - case reflect.Uint16: - return c.uint16Code(typ, isPtr) - case reflect.Uint32: - return c.uint32Code(typ, isPtr) - case reflect.Uint64: - return c.uint64Code(typ, isPtr) - case reflect.Float32: - return c.float32Code(typ, isPtr) - case reflect.Float64: - return c.float64Code(typ, isPtr) - case reflect.String: - return c.stringCode(typ, isPtr) - case reflect.Bool: - return c.boolCode(typ, isPtr) - case reflect.Interface: - return c.interfaceCode(typ, isPtr) - default: - if isPtr && typ.Implements(marshalTextType) { - typ = orgType - } - return c.typeToCodeWithPtr(typ, isPtr) - } -} - -func (c *Compiler) typeToCodeWithPtr(typ *runtime.Type, isPtr bool) (Code, error) { - switch { - case c.implementsMarshalJSON(typ): - return c.marshalJSONCode(typ) - case c.implementsMarshalText(typ): - return c.marshalTextCode(typ) - } - switch typ.Kind() { - case reflect.Ptr: - return c.ptrCode(typ) - case reflect.Slice: - elem := typ.Elem() - if elem.Kind() == reflect.Uint8 { - p := runtime.PtrTo(elem) - if !c.implementsMarshalJSONType(p) && !p.Implements(marshalTextType) { - return c.bytesCode(typ, false) - } - } - return c.sliceCode(typ) - case reflect.Array: - return c.arrayCode(typ) - case reflect.Map: - return c.mapCode(typ) - case reflect.Struct: - return c.structCode(typ, isPtr) - case reflect.Interface: - return c.interfaceCode(typ, false) - case reflect.Int: - return c.intCode(typ, false) - case reflect.Int8: - return c.int8Code(typ, false) - case reflect.Int16: - return c.int16Code(typ, false) - case reflect.Int32: - return c.int32Code(typ, false) - case reflect.Int64: - return c.int64Code(typ, false) - case reflect.Uint: - return c.uintCode(typ, false) - case reflect.Uint8: - return c.uint8Code(typ, false) - case reflect.Uint16: - return c.uint16Code(typ, false) - case reflect.Uint32: - return c.uint32Code(typ, false) - case reflect.Uint64: - return c.uint64Code(typ, false) - case reflect.Uintptr: - return c.uintCode(typ, false) - case reflect.Float32: - return c.float32Code(typ, false) - case reflect.Float64: - return c.float64Code(typ, false) - case reflect.String: - return c.stringCode(typ, false) - case reflect.Bool: - return c.boolCode(typ, false) - } - return nil, &errors.UnsupportedTypeError{Type: runtime.RType2Type(typ)} -} - -const intSize = 32 << (^uint(0) >> 63) - -//nolint:unparam -func (c *Compiler) intCode(typ *runtime.Type, isPtr bool) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: intSize, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) int8Code(typ *runtime.Type, isPtr bool) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 8, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) int16Code(typ *runtime.Type, isPtr bool) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 16, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) int32Code(typ *runtime.Type, isPtr bool) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 32, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) int64Code(typ *runtime.Type, isPtr bool) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 64, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) uintCode(typ *runtime.Type, isPtr bool) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: intSize, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) uint8Code(typ *runtime.Type, isPtr bool) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 8, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) uint16Code(typ *runtime.Type, isPtr bool) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 16, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) uint32Code(typ *runtime.Type, isPtr bool) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 32, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) uint64Code(typ *runtime.Type, isPtr bool) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 64, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) float32Code(typ *runtime.Type, isPtr bool) (*FloatCode, error) { - return &FloatCode{typ: typ, bitSize: 32, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) float64Code(typ *runtime.Type, isPtr bool) (*FloatCode, error) { - return &FloatCode{typ: typ, bitSize: 64, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) stringCode(typ *runtime.Type, isPtr bool) (*StringCode, error) { - return &StringCode{typ: typ, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) boolCode(typ *runtime.Type, isPtr bool) (*BoolCode, error) { - return &BoolCode{typ: typ, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) intStringCode(typ *runtime.Type) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: intSize, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) int8StringCode(typ *runtime.Type) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 8, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) int16StringCode(typ *runtime.Type) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 16, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) int32StringCode(typ *runtime.Type) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 32, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) int64StringCode(typ *runtime.Type) (*IntCode, error) { - return &IntCode{typ: typ, bitSize: 64, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) uintStringCode(typ *runtime.Type) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: intSize, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) uint8StringCode(typ *runtime.Type) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 8, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) uint16StringCode(typ *runtime.Type) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 16, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) uint32StringCode(typ *runtime.Type) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 32, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) uint64StringCode(typ *runtime.Type) (*UintCode, error) { - return &UintCode{typ: typ, bitSize: 64, isString: true}, nil -} - -//nolint:unparam -func (c *Compiler) bytesCode(typ *runtime.Type, isPtr bool) (*BytesCode, error) { - return &BytesCode{typ: typ, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) interfaceCode(typ *runtime.Type, isPtr bool) (*InterfaceCode, error) { - return &InterfaceCode{typ: typ, isPtr: isPtr}, nil -} - -//nolint:unparam -func (c *Compiler) marshalJSONCode(typ *runtime.Type) (*MarshalJSONCode, error) { - return &MarshalJSONCode{ - typ: typ, - isAddrForMarshaler: c.isPtrMarshalJSONType(typ), - isNilableType: c.isNilableType(typ), - isMarshalerContext: typ.Implements(marshalJSONContextType) || runtime.PtrTo(typ).Implements(marshalJSONContextType), - }, nil -} - -//nolint:unparam -func (c *Compiler) marshalTextCode(typ *runtime.Type) (*MarshalTextCode, error) { - return &MarshalTextCode{ - typ: typ, - isAddrForMarshaler: c.isPtrMarshalTextType(typ), - isNilableType: c.isNilableType(typ), - }, nil -} - -func (c *Compiler) ptrCode(typ *runtime.Type) (*PtrCode, error) { - code, err := c.typeToCodeWithPtr(typ.Elem(), true) - if err != nil { - return nil, err - } - ptr, ok := code.(*PtrCode) - if ok { - return &PtrCode{typ: typ, value: ptr.value, ptrNum: ptr.ptrNum + 1}, nil - } - return &PtrCode{typ: typ, value: code, ptrNum: 1}, nil -} - -func (c *Compiler) sliceCode(typ *runtime.Type) (*SliceCode, error) { - elem := typ.Elem() - code, err := c.listElemCode(elem) - if err != nil { - return nil, err - } - if code.Kind() == CodeKindStruct { - structCode := code.(*StructCode) - structCode.enableIndirect() - } - return &SliceCode{typ: typ, value: code}, nil -} - -func (c *Compiler) arrayCode(typ *runtime.Type) (*ArrayCode, error) { - elem := typ.Elem() - code, err := c.listElemCode(elem) - if err != nil { - return nil, err - } - if code.Kind() == CodeKindStruct { - structCode := code.(*StructCode) - structCode.enableIndirect() - } - return &ArrayCode{typ: typ, value: code}, nil -} - -func (c *Compiler) mapCode(typ *runtime.Type) (*MapCode, error) { - keyCode, err := c.mapKeyCode(typ.Key()) - if err != nil { - return nil, err - } - valueCode, err := c.mapValueCode(typ.Elem()) - if err != nil { - return nil, err - } - if valueCode.Kind() == CodeKindStruct { - structCode := valueCode.(*StructCode) - structCode.enableIndirect() - } - return &MapCode{typ: typ, key: keyCode, value: valueCode}, nil -} - -func (c *Compiler) listElemCode(typ *runtime.Type) (Code, error) { - switch { - case c.implementsMarshalJSONType(typ) || c.implementsMarshalJSONType(runtime.PtrTo(typ)): - return c.marshalJSONCode(typ) - case !typ.Implements(marshalTextType) && runtime.PtrTo(typ).Implements(marshalTextType): - return c.marshalTextCode(typ) - case typ.Kind() == reflect.Map: - return c.ptrCode(runtime.PtrTo(typ)) - default: - // isPtr was originally used to indicate whether the type of top level is pointer. - // However, since the slice/array element is a specification that can get the pointer address, explicitly set isPtr to true. - // See here for related issues: https://github.com/goccy/go-json/issues/370 - code, err := c.typeToCodeWithPtr(typ, true) - if err != nil { - return nil, err - } - ptr, ok := code.(*PtrCode) - if ok { - if ptr.value.Kind() == CodeKindMap { - ptr.ptrNum++ - } - } - return code, nil - } -} - -func (c *Compiler) mapKeyCode(typ *runtime.Type) (Code, error) { - switch { - case c.implementsMarshalText(typ): - return c.marshalTextCode(typ) - } - switch typ.Kind() { - case reflect.Ptr: - return c.ptrCode(typ) - case reflect.String: - return c.stringCode(typ, false) - case reflect.Int: - return c.intStringCode(typ) - case reflect.Int8: - return c.int8StringCode(typ) - case reflect.Int16: - return c.int16StringCode(typ) - case reflect.Int32: - return c.int32StringCode(typ) - case reflect.Int64: - return c.int64StringCode(typ) - case reflect.Uint: - return c.uintStringCode(typ) - case reflect.Uint8: - return c.uint8StringCode(typ) - case reflect.Uint16: - return c.uint16StringCode(typ) - case reflect.Uint32: - return c.uint32StringCode(typ) - case reflect.Uint64: - return c.uint64StringCode(typ) - case reflect.Uintptr: - return c.uintStringCode(typ) - } - return nil, &errors.UnsupportedTypeError{Type: runtime.RType2Type(typ)} -} - -func (c *Compiler) mapValueCode(typ *runtime.Type) (Code, error) { - switch typ.Kind() { - case reflect.Map: - return c.ptrCode(runtime.PtrTo(typ)) - default: - code, err := c.typeToCodeWithPtr(typ, false) - if err != nil { - return nil, err - } - ptr, ok := code.(*PtrCode) - if ok { - if ptr.value.Kind() == CodeKindMap { - ptr.ptrNum++ - } - } - return code, nil - } -} - -func (c *Compiler) structCode(typ *runtime.Type, isPtr bool) (*StructCode, error) { - typeptr := uintptr(unsafe.Pointer(typ)) - if code, exists := c.structTypeToCode[typeptr]; exists { - derefCode := *code - derefCode.isRecursive = true - return &derefCode, nil - } - indirect := runtime.IfaceIndir(typ) - code := &StructCode{typ: typ, isPtr: isPtr, isIndirect: indirect} - c.structTypeToCode[typeptr] = code - - fieldNum := typ.NumField() - tags := c.typeToStructTags(typ) - fields := []*StructFieldCode{} - for i, tag := range tags { - isOnlyOneFirstField := i == 0 && fieldNum == 1 - field, err := c.structFieldCode(code, tag, isPtr, isOnlyOneFirstField) - if err != nil { - return nil, err - } - if field.isAnonymous { - structCode := field.getAnonymousStruct() - if structCode != nil { - structCode.removeFieldsByTags(tags) - if c.isAssignableIndirect(field, isPtr) { - if indirect { - structCode.isIndirect = true - } else { - structCode.isIndirect = false - } - } - } - } else { - structCode := field.getStruct() - if structCode != nil { - if indirect { - // if parent is indirect type, set child indirect property to true - structCode.isIndirect = true - } else { - // if parent is not indirect type, set child indirect property to false. - // but if parent's indirect is false and isPtr is true, then indirect must be true. - // Do this only if indirectConversion is enabled at the end of compileStruct. - structCode.isIndirect = false - } - } - } - fields = append(fields, field) - } - fieldMap := c.getFieldMap(fields) - duplicatedFieldMap := c.getDuplicatedFieldMap(fieldMap) - code.fields = c.filteredDuplicatedFields(fields, duplicatedFieldMap) - if !code.disableIndirectConversion && !indirect && isPtr { - code.enableIndirect() - } - delete(c.structTypeToCode, typeptr) - return code, nil -} - -func toElemType(t *runtime.Type) *runtime.Type { - for t.Kind() == reflect.Ptr { - t = t.Elem() - } - return t -} - -func (c *Compiler) structFieldCode(structCode *StructCode, tag *runtime.StructTag, isPtr, isOnlyOneFirstField bool) (*StructFieldCode, error) { - field := tag.Field - fieldType := runtime.Type2RType(field.Type) - isIndirectSpecialCase := isPtr && isOnlyOneFirstField - fieldCode := &StructFieldCode{ - typ: fieldType, - key: tag.Key, - tag: tag, - offset: field.Offset, - isAnonymous: field.Anonymous && !tag.IsTaggedKey && toElemType(fieldType).Kind() == reflect.Struct, - isTaggedKey: tag.IsTaggedKey, - isNilableType: c.isNilableType(fieldType), - isNilCheck: true, - } - switch { - case c.isMovePointerPositionFromHeadToFirstMarshalJSONFieldCase(fieldType, isIndirectSpecialCase): - code, err := c.marshalJSONCode(fieldType) - if err != nil { - return nil, err - } - fieldCode.value = code - fieldCode.isAddrForMarshaler = true - fieldCode.isNilCheck = false - structCode.isIndirect = false - structCode.disableIndirectConversion = true - case c.isMovePointerPositionFromHeadToFirstMarshalTextFieldCase(fieldType, isIndirectSpecialCase): - code, err := c.marshalTextCode(fieldType) - if err != nil { - return nil, err - } - fieldCode.value = code - fieldCode.isAddrForMarshaler = true - fieldCode.isNilCheck = false - structCode.isIndirect = false - structCode.disableIndirectConversion = true - case isPtr && c.isPtrMarshalJSONType(fieldType): - // *struct{ field T } - // func (*T) MarshalJSON() ([]byte, error) - code, err := c.marshalJSONCode(fieldType) - if err != nil { - return nil, err - } - fieldCode.value = code - fieldCode.isAddrForMarshaler = true - fieldCode.isNilCheck = false - case isPtr && c.isPtrMarshalTextType(fieldType): - // *struct{ field T } - // func (*T) MarshalText() ([]byte, error) - code, err := c.marshalTextCode(fieldType) - if err != nil { - return nil, err - } - fieldCode.value = code - fieldCode.isAddrForMarshaler = true - fieldCode.isNilCheck = false - default: - code, err := c.typeToCodeWithPtr(fieldType, isPtr) - if err != nil { - return nil, err - } - switch code.Kind() { - case CodeKindPtr, CodeKindInterface: - fieldCode.isNextOpPtrType = true - } - fieldCode.value = code - } - return fieldCode, nil -} - -func (c *Compiler) isAssignableIndirect(fieldCode *StructFieldCode, isPtr bool) bool { - if isPtr { - return false - } - codeType := fieldCode.value.Kind() - if codeType == CodeKindMarshalJSON { - return false - } - if codeType == CodeKindMarshalText { - return false - } - return true -} - -func (c *Compiler) getFieldMap(fields []*StructFieldCode) map[string][]*StructFieldCode { - fieldMap := map[string][]*StructFieldCode{} - for _, field := range fields { - if field.isAnonymous { - for k, v := range c.getAnonymousFieldMap(field) { - fieldMap[k] = append(fieldMap[k], v...) - } - continue - } - fieldMap[field.key] = append(fieldMap[field.key], field) - } - return fieldMap -} - -func (c *Compiler) getAnonymousFieldMap(field *StructFieldCode) map[string][]*StructFieldCode { - fieldMap := map[string][]*StructFieldCode{} - structCode := field.getAnonymousStruct() - if structCode == nil || structCode.isRecursive { - fieldMap[field.key] = append(fieldMap[field.key], field) - return fieldMap - } - for k, v := range c.getFieldMapFromAnonymousParent(structCode.fields) { - fieldMap[k] = append(fieldMap[k], v...) - } - return fieldMap -} - -func (c *Compiler) getFieldMapFromAnonymousParent(fields []*StructFieldCode) map[string][]*StructFieldCode { - fieldMap := map[string][]*StructFieldCode{} - for _, field := range fields { - if field.isAnonymous { - for k, v := range c.getAnonymousFieldMap(field) { - // Do not handle tagged key when embedding more than once - for _, vv := range v { - vv.isTaggedKey = false - } - fieldMap[k] = append(fieldMap[k], v...) - } - continue - } - fieldMap[field.key] = append(fieldMap[field.key], field) - } - return fieldMap -} - -func (c *Compiler) getDuplicatedFieldMap(fieldMap map[string][]*StructFieldCode) map[*StructFieldCode]struct{} { - duplicatedFieldMap := map[*StructFieldCode]struct{}{} - for _, fields := range fieldMap { - if len(fields) == 1 { - continue - } - if c.isTaggedKeyOnly(fields) { - for _, field := range fields { - if field.isTaggedKey { - continue - } - duplicatedFieldMap[field] = struct{}{} - } - } else { - for _, field := range fields { - duplicatedFieldMap[field] = struct{}{} - } - } - } - return duplicatedFieldMap -} - -func (c *Compiler) filteredDuplicatedFields(fields []*StructFieldCode, duplicatedFieldMap map[*StructFieldCode]struct{}) []*StructFieldCode { - filteredFields := make([]*StructFieldCode, 0, len(fields)) - for _, field := range fields { - if field.isAnonymous { - structCode := field.getAnonymousStruct() - if structCode != nil && !structCode.isRecursive { - structCode.fields = c.filteredDuplicatedFields(structCode.fields, duplicatedFieldMap) - if len(structCode.fields) > 0 { - filteredFields = append(filteredFields, field) - } - continue - } - } - if _, exists := duplicatedFieldMap[field]; exists { - continue - } - filteredFields = append(filteredFields, field) - } - return filteredFields -} - -func (c *Compiler) isTaggedKeyOnly(fields []*StructFieldCode) bool { - var taggedKeyFieldCount int - for _, field := range fields { - if field.isTaggedKey { - taggedKeyFieldCount++ - } - } - return taggedKeyFieldCount == 1 -} - -func (c *Compiler) typeToStructTags(typ *runtime.Type) runtime.StructTags { - tags := runtime.StructTags{} - fieldNum := typ.NumField() - for i := 0; i < fieldNum; i++ { - field := typ.Field(i) - if runtime.IsIgnoredStructField(field) { - continue - } - tags = append(tags, runtime.StructTagFromField(field)) - } - return tags -} - -// *struct{ field T } => struct { field *T } -// func (*T) MarshalJSON() ([]byte, error) -func (c *Compiler) isMovePointerPositionFromHeadToFirstMarshalJSONFieldCase(typ *runtime.Type, isIndirectSpecialCase bool) bool { - return isIndirectSpecialCase && !c.isNilableType(typ) && c.isPtrMarshalJSONType(typ) -} - -// *struct{ field T } => struct { field *T } -// func (*T) MarshalText() ([]byte, error) -func (c *Compiler) isMovePointerPositionFromHeadToFirstMarshalTextFieldCase(typ *runtime.Type, isIndirectSpecialCase bool) bool { - return isIndirectSpecialCase && !c.isNilableType(typ) && c.isPtrMarshalTextType(typ) -} - -func (c *Compiler) implementsMarshalJSON(typ *runtime.Type) bool { - if !c.implementsMarshalJSONType(typ) { - return false - } - if typ.Kind() != reflect.Ptr { - return true - } - // type kind is reflect.Ptr - if !c.implementsMarshalJSONType(typ.Elem()) { - return true - } - // needs to dereference - return false -} - -func (c *Compiler) implementsMarshalText(typ *runtime.Type) bool { - if !typ.Implements(marshalTextType) { - return false - } - if typ.Kind() != reflect.Ptr { - return true - } - // type kind is reflect.Ptr - if !typ.Elem().Implements(marshalTextType) { - return true - } - // needs to dereference - return false -} - -func (c *Compiler) isNilableType(typ *runtime.Type) bool { - if !runtime.IfaceIndir(typ) { - return true - } - switch typ.Kind() { - case reflect.Ptr: - return true - case reflect.Map: - return true - case reflect.Func: - return true - default: - return false - } -} - -func (c *Compiler) implementsMarshalJSONType(typ *runtime.Type) bool { - return typ.Implements(marshalJSONType) || typ.Implements(marshalJSONContextType) -} - -func (c *Compiler) isPtrMarshalJSONType(typ *runtime.Type) bool { - return !c.implementsMarshalJSONType(typ) && c.implementsMarshalJSONType(runtime.PtrTo(typ)) -} - -func (c *Compiler) isPtrMarshalTextType(typ *runtime.Type) bool { - return !typ.Implements(marshalTextType) && runtime.PtrTo(typ).Implements(marshalTextType) -} - -func (c *Compiler) codeToOpcode(ctx *compileContext, typ *runtime.Type, code Code) *Opcode { - codes := code.ToOpcode(ctx) - codes.Last().Next = newEndOp(ctx, typ) - c.linkRecursiveCode(ctx) - return codes.First() -} - -func (c *Compiler) linkRecursiveCode(ctx *compileContext) { - recursiveCodes := map[uintptr]*CompiledCode{} - for _, recursive := range *ctx.recursiveCodes { - typeptr := uintptr(unsafe.Pointer(recursive.Type)) - codes := ctx.structTypeToCodes[typeptr] - if recursiveCode, ok := recursiveCodes[typeptr]; ok { - *recursive.Jmp = *recursiveCode - continue - } - - code := copyOpcode(codes.First()) - code.Op = code.Op.PtrHeadToHead() - lastCode := newEndOp(&compileContext{}, recursive.Type) - lastCode.Op = OpRecursiveEnd - - // OpRecursiveEnd must set before call TotalLength - code.End.Next = lastCode - - totalLength := code.TotalLength() - - // Idx, ElemIdx, Length must set after call TotalLength - lastCode.Idx = uint32((totalLength + 1) * uintptrSize) - lastCode.ElemIdx = lastCode.Idx + uintptrSize - lastCode.Length = lastCode.Idx + 2*uintptrSize - - // extend length to alloc slot for elemIdx + length - curTotalLength := uintptr(recursive.TotalLength()) + 3 - nextTotalLength := uintptr(totalLength) + 3 - - compiled := recursive.Jmp - compiled.Code = code - compiled.CurLen = curTotalLength - compiled.NextLen = nextTotalLength - compiled.Linked = true - - recursiveCodes[typeptr] = compiled - } -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/compiler_norace.go b/vendor/github.com/goccy/go-json/internal/encoder/compiler_norace.go deleted file mode 100644 index b6f45a49b0e..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/compiler_norace.go +++ /dev/null @@ -1,33 +0,0 @@ -//go:build !race -// +build !race - -package encoder - -func CompileToGetCodeSet(ctx *RuntimeContext, typeptr uintptr) (*OpcodeSet, error) { - initEncoder() - if typeptr > typeAddr.MaxTypeAddr || typeptr < typeAddr.BaseTypeAddr { - codeSet, err := compileToGetCodeSetSlowPath(typeptr) - if err != nil { - return nil, err - } - return getFilteredCodeSetIfNeeded(ctx, codeSet) - } - index := (typeptr - typeAddr.BaseTypeAddr) >> typeAddr.AddrShift - if codeSet := cachedOpcodeSets[index]; codeSet != nil { - filtered, err := getFilteredCodeSetIfNeeded(ctx, codeSet) - if err != nil { - return nil, err - } - return filtered, nil - } - codeSet, err := newCompiler().compile(typeptr) - if err != nil { - return nil, err - } - filtered, err := getFilteredCodeSetIfNeeded(ctx, codeSet) - if err != nil { - return nil, err - } - cachedOpcodeSets[index] = codeSet - return filtered, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/compiler_race.go b/vendor/github.com/goccy/go-json/internal/encoder/compiler_race.go deleted file mode 100644 index 47b482f7fb6..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/compiler_race.go +++ /dev/null @@ -1,46 +0,0 @@ -//go:build race -// +build race - -package encoder - -import ( - "sync" -) - -var setsMu sync.RWMutex - -func CompileToGetCodeSet(ctx *RuntimeContext, typeptr uintptr) (*OpcodeSet, error) { - initEncoder() - if typeptr > typeAddr.MaxTypeAddr || typeptr < typeAddr.BaseTypeAddr { - codeSet, err := compileToGetCodeSetSlowPath(typeptr) - if err != nil { - return nil, err - } - return getFilteredCodeSetIfNeeded(ctx, codeSet) - } - index := (typeptr - typeAddr.BaseTypeAddr) >> typeAddr.AddrShift - setsMu.RLock() - if codeSet := cachedOpcodeSets[index]; codeSet != nil { - filtered, err := getFilteredCodeSetIfNeeded(ctx, codeSet) - if err != nil { - setsMu.RUnlock() - return nil, err - } - setsMu.RUnlock() - return filtered, nil - } - setsMu.RUnlock() - - codeSet, err := newCompiler().compile(typeptr) - if err != nil { - return nil, err - } - filtered, err := getFilteredCodeSetIfNeeded(ctx, codeSet) - if err != nil { - return nil, err - } - setsMu.Lock() - cachedOpcodeSets[index] = codeSet - setsMu.Unlock() - return filtered, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/context.go b/vendor/github.com/goccy/go-json/internal/encoder/context.go deleted file mode 100644 index 3833d0c86db..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/context.go +++ /dev/null @@ -1,105 +0,0 @@ -package encoder - -import ( - "context" - "sync" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -type compileContext struct { - opcodeIndex uint32 - ptrIndex int - indent uint32 - escapeKey bool - structTypeToCodes map[uintptr]Opcodes - recursiveCodes *Opcodes -} - -func (c *compileContext) incIndent() { - c.indent++ -} - -func (c *compileContext) decIndent() { - c.indent-- -} - -func (c *compileContext) incIndex() { - c.incOpcodeIndex() - c.incPtrIndex() -} - -func (c *compileContext) decIndex() { - c.decOpcodeIndex() - c.decPtrIndex() -} - -func (c *compileContext) incOpcodeIndex() { - c.opcodeIndex++ -} - -func (c *compileContext) decOpcodeIndex() { - c.opcodeIndex-- -} - -func (c *compileContext) incPtrIndex() { - c.ptrIndex++ -} - -func (c *compileContext) decPtrIndex() { - c.ptrIndex-- -} - -const ( - bufSize = 1024 -) - -var ( - runtimeContextPool = sync.Pool{ - New: func() interface{} { - return &RuntimeContext{ - Buf: make([]byte, 0, bufSize), - Ptrs: make([]uintptr, 128), - KeepRefs: make([]unsafe.Pointer, 0, 8), - Option: &Option{}, - } - }, - } -) - -type RuntimeContext struct { - Context context.Context - Buf []byte - MarshalBuf []byte - Ptrs []uintptr - KeepRefs []unsafe.Pointer - SeenPtr []uintptr - BaseIndent uint32 - Prefix []byte - IndentStr []byte - Option *Option -} - -func (c *RuntimeContext) Init(p uintptr, codelen int) { - if len(c.Ptrs) < codelen { - c.Ptrs = make([]uintptr, codelen) - } - c.Ptrs[0] = p - c.KeepRefs = c.KeepRefs[:0] - c.SeenPtr = c.SeenPtr[:0] - c.BaseIndent = 0 -} - -func (c *RuntimeContext) Ptr() uintptr { - header := (*runtime.SliceHeader)(unsafe.Pointer(&c.Ptrs)) - return uintptr(header.Data) -} - -func TakeRuntimeContext() *RuntimeContext { - return runtimeContextPool.Get().(*RuntimeContext) -} - -func ReleaseRuntimeContext(ctx *RuntimeContext) { - runtimeContextPool.Put(ctx) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/decode_rune.go b/vendor/github.com/goccy/go-json/internal/encoder/decode_rune.go deleted file mode 100644 index 35c959d4818..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/decode_rune.go +++ /dev/null @@ -1,126 +0,0 @@ -package encoder - -import "unicode/utf8" - -const ( - // The default lowest and highest continuation byte. - locb = 128 //0b10000000 - hicb = 191 //0b10111111 - - // These names of these constants are chosen to give nice alignment in the - // table below. The first nibble is an index into acceptRanges or F for - // special one-byte cases. The second nibble is the Rune length or the - // Status for the special one-byte case. - xx = 0xF1 // invalid: size 1 - as = 0xF0 // ASCII: size 1 - s1 = 0x02 // accept 0, size 2 - s2 = 0x13 // accept 1, size 3 - s3 = 0x03 // accept 0, size 3 - s4 = 0x23 // accept 2, size 3 - s5 = 0x34 // accept 3, size 4 - s6 = 0x04 // accept 0, size 4 - s7 = 0x44 // accept 4, size 4 -) - -// first is information about the first byte in a UTF-8 sequence. -var first = [256]uint8{ - // 1 2 3 4 5 6 7 8 9 A B C D E F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x00-0x0F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x10-0x1F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x20-0x2F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x30-0x3F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x40-0x4F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x50-0x5F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x60-0x6F - as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, as, // 0x70-0x7F - // 1 2 3 4 5 6 7 8 9 A B C D E F - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0x80-0x8F - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0x90-0x9F - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0xA0-0xAF - xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0xB0-0xBF - xx, xx, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, // 0xC0-0xCF - s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, s1, // 0xD0-0xDF - s2, s3, s3, s3, s3, s3, s3, s3, s3, s3, s3, s3, s3, s4, s3, s3, // 0xE0-0xEF - s5, s6, s6, s6, s7, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, xx, // 0xF0-0xFF -} - -const ( - lineSep = byte(168) //'\u2028' - paragraphSep = byte(169) //'\u2029' -) - -type decodeRuneState int - -const ( - validUTF8State decodeRuneState = iota - runeErrorState - lineSepState - paragraphSepState -) - -func decodeRuneInString(s string) (decodeRuneState, int) { - n := len(s) - s0 := s[0] - x := first[s0] - if x >= as { - // The following code simulates an additional check for x == xx and - // handling the ASCII and invalid cases accordingly. This mask-and-or - // approach prevents an additional branch. - mask := rune(x) << 31 >> 31 // Create 0x0000 or 0xFFFF. - if rune(s[0])&^mask|utf8.RuneError&mask == utf8.RuneError { - return runeErrorState, 1 - } - return validUTF8State, 1 - } - sz := int(x & 7) - if n < sz { - return runeErrorState, 1 - } - s1 := s[1] - switch x >> 4 { - case 0: - if s1 < locb || hicb < s1 { - return runeErrorState, 1 - } - case 1: - if s1 < 0xA0 || hicb < s1 { - return runeErrorState, 1 - } - case 2: - if s1 < locb || 0x9F < s1 { - return runeErrorState, 1 - } - case 3: - if s1 < 0x90 || hicb < s1 { - return runeErrorState, 1 - } - case 4: - if s1 < locb || 0x8F < s1 { - return runeErrorState, 1 - } - } - if sz <= 2 { - return validUTF8State, 2 - } - s2 := s[2] - if s2 < locb || hicb < s2 { - return runeErrorState, 1 - } - if sz <= 3 { - // separator character prefixes: [2]byte{226, 128} - if s0 == 226 && s1 == 128 { - switch s2 { - case lineSep: - return lineSepState, 3 - case paragraphSep: - return paragraphSepState, 3 - } - } - return validUTF8State, 3 - } - s3 := s[3] - if s3 < locb || hicb < s3 { - return runeErrorState, 1 - } - return validUTF8State, 4 -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/encoder.go b/vendor/github.com/goccy/go-json/internal/encoder/encoder.go deleted file mode 100644 index b436f5b21ff..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/encoder.go +++ /dev/null @@ -1,601 +0,0 @@ -package encoder - -import ( - "bytes" - "encoding" - "encoding/base64" - "encoding/json" - "fmt" - "math" - "reflect" - "strconv" - "strings" - "sync" - "unsafe" - - "github.com/goccy/go-json/internal/errors" - "github.com/goccy/go-json/internal/runtime" -) - -func (t OpType) IsMultipleOpHead() bool { - switch t { - case OpStructHead: - return true - case OpStructHeadSlice: - return true - case OpStructHeadArray: - return true - case OpStructHeadMap: - return true - case OpStructHeadStruct: - return true - case OpStructHeadOmitEmpty: - return true - case OpStructHeadOmitEmptySlice: - return true - case OpStructHeadOmitEmptyArray: - return true - case OpStructHeadOmitEmptyMap: - return true - case OpStructHeadOmitEmptyStruct: - return true - case OpStructHeadSlicePtr: - return true - case OpStructHeadOmitEmptySlicePtr: - return true - case OpStructHeadArrayPtr: - return true - case OpStructHeadOmitEmptyArrayPtr: - return true - case OpStructHeadMapPtr: - return true - case OpStructHeadOmitEmptyMapPtr: - return true - } - return false -} - -func (t OpType) IsMultipleOpField() bool { - switch t { - case OpStructField: - return true - case OpStructFieldSlice: - return true - case OpStructFieldArray: - return true - case OpStructFieldMap: - return true - case OpStructFieldStruct: - return true - case OpStructFieldOmitEmpty: - return true - case OpStructFieldOmitEmptySlice: - return true - case OpStructFieldOmitEmptyArray: - return true - case OpStructFieldOmitEmptyMap: - return true - case OpStructFieldOmitEmptyStruct: - return true - case OpStructFieldSlicePtr: - return true - case OpStructFieldOmitEmptySlicePtr: - return true - case OpStructFieldArrayPtr: - return true - case OpStructFieldOmitEmptyArrayPtr: - return true - case OpStructFieldMapPtr: - return true - case OpStructFieldOmitEmptyMapPtr: - return true - } - return false -} - -type OpcodeSet struct { - Type *runtime.Type - NoescapeKeyCode *Opcode - EscapeKeyCode *Opcode - InterfaceNoescapeKeyCode *Opcode - InterfaceEscapeKeyCode *Opcode - CodeLength int - EndCode *Opcode - Code Code - QueryCache map[string]*OpcodeSet - cacheMu sync.RWMutex -} - -func (s *OpcodeSet) getQueryCache(hash string) *OpcodeSet { - s.cacheMu.RLock() - codeSet := s.QueryCache[hash] - s.cacheMu.RUnlock() - return codeSet -} - -func (s *OpcodeSet) setQueryCache(hash string, codeSet *OpcodeSet) { - s.cacheMu.Lock() - s.QueryCache[hash] = codeSet - s.cacheMu.Unlock() -} - -type CompiledCode struct { - Code *Opcode - Linked bool // whether recursive code already have linked - CurLen uintptr - NextLen uintptr -} - -const StartDetectingCyclesAfter = 1000 - -func Load(base uintptr, idx uintptr) uintptr { - addr := base + idx - return **(**uintptr)(unsafe.Pointer(&addr)) -} - -func Store(base uintptr, idx uintptr, p uintptr) { - addr := base + idx - **(**uintptr)(unsafe.Pointer(&addr)) = p -} - -func LoadNPtr(base uintptr, idx uintptr, ptrNum int) uintptr { - addr := base + idx - p := **(**uintptr)(unsafe.Pointer(&addr)) - if p == 0 { - return 0 - } - return PtrToPtr(p) - /* - for i := 0; i < ptrNum; i++ { - if p == 0 { - return p - } - p = PtrToPtr(p) - } - return p - */ -} - -func PtrToUint64(p uintptr) uint64 { return **(**uint64)(unsafe.Pointer(&p)) } -func PtrToFloat32(p uintptr) float32 { return **(**float32)(unsafe.Pointer(&p)) } -func PtrToFloat64(p uintptr) float64 { return **(**float64)(unsafe.Pointer(&p)) } -func PtrToBool(p uintptr) bool { return **(**bool)(unsafe.Pointer(&p)) } -func PtrToBytes(p uintptr) []byte { return **(**[]byte)(unsafe.Pointer(&p)) } -func PtrToNumber(p uintptr) json.Number { return **(**json.Number)(unsafe.Pointer(&p)) } -func PtrToString(p uintptr) string { return **(**string)(unsafe.Pointer(&p)) } -func PtrToSlice(p uintptr) *runtime.SliceHeader { return *(**runtime.SliceHeader)(unsafe.Pointer(&p)) } -func PtrToPtr(p uintptr) uintptr { - return uintptr(**(**unsafe.Pointer)(unsafe.Pointer(&p))) -} -func PtrToNPtr(p uintptr, ptrNum int) uintptr { - for i := 0; i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = PtrToPtr(p) - } - return p -} - -func PtrToUnsafePtr(p uintptr) unsafe.Pointer { - return *(*unsafe.Pointer)(unsafe.Pointer(&p)) -} -func PtrToInterface(code *Opcode, p uintptr) interface{} { - return *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: code.Type, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&p)), - })) -} - -func ErrUnsupportedValue(code *Opcode, ptr uintptr) *errors.UnsupportedValueError { - v := *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: code.Type, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&ptr)), - })) - return &errors.UnsupportedValueError{ - Value: reflect.ValueOf(v), - Str: fmt.Sprintf("encountered a cycle via %s", code.Type), - } -} - -func ErrUnsupportedFloat(v float64) *errors.UnsupportedValueError { - return &errors.UnsupportedValueError{ - Value: reflect.ValueOf(v), - Str: strconv.FormatFloat(v, 'g', -1, 64), - } -} - -func ErrMarshalerWithCode(code *Opcode, err error) *errors.MarshalerError { - return &errors.MarshalerError{ - Type: runtime.RType2Type(code.Type), - Err: err, - } -} - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -type MapItem struct { - Key []byte - Value []byte -} - -type Mapslice struct { - Items []MapItem -} - -func (m *Mapslice) Len() int { - return len(m.Items) -} - -func (m *Mapslice) Less(i, j int) bool { - return bytes.Compare(m.Items[i].Key, m.Items[j].Key) < 0 -} - -func (m *Mapslice) Swap(i, j int) { - m.Items[i], m.Items[j] = m.Items[j], m.Items[i] -} - -//nolint:structcheck,unused -type mapIter struct { - key unsafe.Pointer - elem unsafe.Pointer - t unsafe.Pointer - h unsafe.Pointer - buckets unsafe.Pointer - bptr unsafe.Pointer - overflow unsafe.Pointer - oldoverflow unsafe.Pointer - startBucket uintptr - offset uint8 - wrapped bool - B uint8 - i uint8 - bucket uintptr - checkBucket uintptr -} - -type MapContext struct { - Start int - First int - Idx int - Slice *Mapslice - Buf []byte - Len int - Iter mapIter -} - -var mapContextPool = sync.Pool{ - New: func() interface{} { - return &MapContext{ - Slice: &Mapslice{}, - } - }, -} - -func NewMapContext(mapLen int, unorderedMap bool) *MapContext { - ctx := mapContextPool.Get().(*MapContext) - if !unorderedMap { - if len(ctx.Slice.Items) < mapLen { - ctx.Slice.Items = make([]MapItem, mapLen) - } else { - ctx.Slice.Items = ctx.Slice.Items[:mapLen] - } - } - ctx.Buf = ctx.Buf[:0] - ctx.Iter = mapIter{} - ctx.Idx = 0 - ctx.Len = mapLen - return ctx -} - -func ReleaseMapContext(c *MapContext) { - mapContextPool.Put(c) -} - -//go:linkname MapIterInit runtime.mapiterinit -//go:noescape -func MapIterInit(mapType *runtime.Type, m unsafe.Pointer, it *mapIter) - -//go:linkname MapIterKey reflect.mapiterkey -//go:noescape -func MapIterKey(it *mapIter) unsafe.Pointer - -//go:linkname MapIterNext reflect.mapiternext -//go:noescape -func MapIterNext(it *mapIter) - -//go:linkname MapLen reflect.maplen -//go:noescape -func MapLen(m unsafe.Pointer) int - -func AppendByteSlice(_ *RuntimeContext, b []byte, src []byte) []byte { - if src == nil { - return append(b, `null`...) - } - encodedLen := base64.StdEncoding.EncodedLen(len(src)) - b = append(b, '"') - pos := len(b) - remainLen := cap(b[pos:]) - var buf []byte - if remainLen > encodedLen { - buf = b[pos : pos+encodedLen] - } else { - buf = make([]byte, encodedLen) - } - base64.StdEncoding.Encode(buf, src) - return append(append(b, buf...), '"') -} - -func AppendFloat32(_ *RuntimeContext, b []byte, v float32) []byte { - f64 := float64(v) - abs := math.Abs(f64) - fmt := byte('f') - // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. - if abs != 0 { - f32 := float32(abs) - if f32 < 1e-6 || f32 >= 1e21 { - fmt = 'e' - } - } - return strconv.AppendFloat(b, f64, fmt, -1, 32) -} - -func AppendFloat64(_ *RuntimeContext, b []byte, v float64) []byte { - abs := math.Abs(v) - fmt := byte('f') - // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. - if abs != 0 { - if abs < 1e-6 || abs >= 1e21 { - fmt = 'e' - } - } - return strconv.AppendFloat(b, v, fmt, -1, 64) -} - -func AppendBool(_ *RuntimeContext, b []byte, v bool) []byte { - if v { - return append(b, "true"...) - } - return append(b, "false"...) -} - -var ( - floatTable = [256]bool{ - '0': true, - '1': true, - '2': true, - '3': true, - '4': true, - '5': true, - '6': true, - '7': true, - '8': true, - '9': true, - '.': true, - 'e': true, - 'E': true, - '+': true, - '-': true, - } -) - -func AppendNumber(_ *RuntimeContext, b []byte, n json.Number) ([]byte, error) { - if len(n) == 0 { - return append(b, '0'), nil - } - for i := 0; i < len(n); i++ { - if !floatTable[n[i]] { - return nil, fmt.Errorf("json: invalid number literal %q", n) - } - } - b = append(b, n...) - return b, nil -} - -func AppendMarshalJSON(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error) { - rv := reflect.ValueOf(v) // convert by dynamic interface type - if (code.Flags & AddrForMarshalerFlags) != 0 { - if rv.CanAddr() { - rv = rv.Addr() - } else { - newV := reflect.New(rv.Type()) - newV.Elem().Set(rv) - rv = newV - } - } - - if rv.Kind() == reflect.Ptr && rv.IsNil() { - return AppendNull(ctx, b), nil - } - - v = rv.Interface() - var bb []byte - if (code.Flags & MarshalerContextFlags) != 0 { - marshaler, ok := v.(marshalerContext) - if !ok { - return AppendNull(ctx, b), nil - } - stdctx := ctx.Option.Context - if ctx.Option.Flag&FieldQueryOption != 0 { - stdctx = SetFieldQueryToContext(stdctx, code.FieldQuery) - } - b, err := marshaler.MarshalJSON(stdctx) - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - bb = b - } else { - marshaler, ok := v.(json.Marshaler) - if !ok { - return AppendNull(ctx, b), nil - } - b, err := marshaler.MarshalJSON() - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - bb = b - } - marshalBuf := ctx.MarshalBuf[:0] - marshalBuf = append(append(marshalBuf, bb...), nul) - compactedBuf, err := compact(b, marshalBuf, (ctx.Option.Flag&HTMLEscapeOption) != 0) - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - ctx.MarshalBuf = marshalBuf - return compactedBuf, nil -} - -func AppendMarshalJSONIndent(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error) { - rv := reflect.ValueOf(v) // convert by dynamic interface type - if (code.Flags & AddrForMarshalerFlags) != 0 { - if rv.CanAddr() { - rv = rv.Addr() - } else { - newV := reflect.New(rv.Type()) - newV.Elem().Set(rv) - rv = newV - } - } - v = rv.Interface() - var bb []byte - if (code.Flags & MarshalerContextFlags) != 0 { - marshaler, ok := v.(marshalerContext) - if !ok { - return AppendNull(ctx, b), nil - } - b, err := marshaler.MarshalJSON(ctx.Option.Context) - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - bb = b - } else { - marshaler, ok := v.(json.Marshaler) - if !ok { - return AppendNull(ctx, b), nil - } - b, err := marshaler.MarshalJSON() - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - bb = b - } - marshalBuf := ctx.MarshalBuf[:0] - marshalBuf = append(append(marshalBuf, bb...), nul) - indentedBuf, err := doIndent( - b, - marshalBuf, - string(ctx.Prefix)+strings.Repeat(string(ctx.IndentStr), int(ctx.BaseIndent+code.Indent)), - string(ctx.IndentStr), - (ctx.Option.Flag&HTMLEscapeOption) != 0, - ) - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - ctx.MarshalBuf = marshalBuf - return indentedBuf, nil -} - -func AppendMarshalText(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error) { - rv := reflect.ValueOf(v) // convert by dynamic interface type - if (code.Flags & AddrForMarshalerFlags) != 0 { - if rv.CanAddr() { - rv = rv.Addr() - } else { - newV := reflect.New(rv.Type()) - newV.Elem().Set(rv) - rv = newV - } - } - v = rv.Interface() - marshaler, ok := v.(encoding.TextMarshaler) - if !ok { - return AppendNull(ctx, b), nil - } - bytes, err := marshaler.MarshalText() - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - return AppendString(ctx, b, *(*string)(unsafe.Pointer(&bytes))), nil -} - -func AppendMarshalTextIndent(ctx *RuntimeContext, code *Opcode, b []byte, v interface{}) ([]byte, error) { - rv := reflect.ValueOf(v) // convert by dynamic interface type - if (code.Flags & AddrForMarshalerFlags) != 0 { - if rv.CanAddr() { - rv = rv.Addr() - } else { - newV := reflect.New(rv.Type()) - newV.Elem().Set(rv) - rv = newV - } - } - v = rv.Interface() - marshaler, ok := v.(encoding.TextMarshaler) - if !ok { - return AppendNull(ctx, b), nil - } - bytes, err := marshaler.MarshalText() - if err != nil { - return nil, &errors.MarshalerError{Type: reflect.TypeOf(v), Err: err} - } - return AppendString(ctx, b, *(*string)(unsafe.Pointer(&bytes))), nil -} - -func AppendNull(_ *RuntimeContext, b []byte) []byte { - return append(b, "null"...) -} - -func AppendComma(_ *RuntimeContext, b []byte) []byte { - return append(b, ',') -} - -func AppendCommaIndent(_ *RuntimeContext, b []byte) []byte { - return append(b, ',', '\n') -} - -func AppendStructEnd(_ *RuntimeContext, b []byte) []byte { - return append(b, '}', ',') -} - -func AppendStructEndIndent(ctx *RuntimeContext, code *Opcode, b []byte) []byte { - b = append(b, '\n') - b = append(b, ctx.Prefix...) - indentNum := ctx.BaseIndent + code.Indent - 1 - for i := uint32(0); i < indentNum; i++ { - b = append(b, ctx.IndentStr...) - } - return append(b, '}', ',', '\n') -} - -func AppendIndent(ctx *RuntimeContext, b []byte, indent uint32) []byte { - b = append(b, ctx.Prefix...) - indentNum := ctx.BaseIndent + indent - for i := uint32(0); i < indentNum; i++ { - b = append(b, ctx.IndentStr...) - } - return b -} - -func IsNilForMarshaler(v interface{}) bool { - rv := reflect.ValueOf(v) - switch rv.Kind() { - case reflect.Bool: - return !rv.Bool() - case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - return rv.Int() == 0 - case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - return rv.Uint() == 0 - case reflect.Float32, reflect.Float64: - return math.Float64bits(rv.Float()) == 0 - case reflect.Interface, reflect.Map, reflect.Ptr, reflect.Func: - return rv.IsNil() - case reflect.Slice: - return rv.IsNil() || rv.Len() == 0 - case reflect.String: - return rv.Len() == 0 - } - return false -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/indent.go b/vendor/github.com/goccy/go-json/internal/encoder/indent.go deleted file mode 100644 index dfe04b5e3c4..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/indent.go +++ /dev/null @@ -1,211 +0,0 @@ -package encoder - -import ( - "bytes" - "fmt" - - "github.com/goccy/go-json/internal/errors" -) - -func takeIndentSrcRuntimeContext(src []byte) (*RuntimeContext, []byte) { - ctx := TakeRuntimeContext() - buf := ctx.Buf[:0] - buf = append(append(buf, src...), nul) - ctx.Buf = buf - return ctx, buf -} - -func Indent(buf *bytes.Buffer, src []byte, prefix, indentStr string) error { - if len(src) == 0 { - return errors.ErrUnexpectedEndOfJSON("", 0) - } - - srcCtx, srcBuf := takeIndentSrcRuntimeContext(src) - dstCtx := TakeRuntimeContext() - dst := dstCtx.Buf[:0] - - dst, err := indentAndWrite(buf, dst, srcBuf, prefix, indentStr) - if err != nil { - ReleaseRuntimeContext(srcCtx) - ReleaseRuntimeContext(dstCtx) - return err - } - dstCtx.Buf = dst - ReleaseRuntimeContext(srcCtx) - ReleaseRuntimeContext(dstCtx) - return nil -} - -func indentAndWrite(buf *bytes.Buffer, dst []byte, src []byte, prefix, indentStr string) ([]byte, error) { - dst, err := doIndent(dst, src, prefix, indentStr, false) - if err != nil { - return nil, err - } - if _, err := buf.Write(dst); err != nil { - return nil, err - } - return dst, nil -} - -func doIndent(dst, src []byte, prefix, indentStr string, escape bool) ([]byte, error) { - buf, cursor, err := indentValue(dst, src, 0, 0, []byte(prefix), []byte(indentStr), escape) - if err != nil { - return nil, err - } - if err := validateEndBuf(src, cursor); err != nil { - return nil, err - } - return buf, nil -} - -func indentValue( - dst []byte, - src []byte, - indentNum int, - cursor int64, - prefix []byte, - indentBytes []byte, - escape bool) ([]byte, int64, error) { - for { - switch src[cursor] { - case ' ', '\t', '\n', '\r': - cursor++ - continue - case '{': - return indentObject(dst, src, indentNum, cursor, prefix, indentBytes, escape) - case '}': - return nil, 0, errors.ErrSyntax("unexpected character '}'", cursor) - case '[': - return indentArray(dst, src, indentNum, cursor, prefix, indentBytes, escape) - case ']': - return nil, 0, errors.ErrSyntax("unexpected character ']'", cursor) - case '"': - return compactString(dst, src, cursor, escape) - case '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - return compactNumber(dst, src, cursor) - case 't': - return compactTrue(dst, src, cursor) - case 'f': - return compactFalse(dst, src, cursor) - case 'n': - return compactNull(dst, src, cursor) - default: - return nil, 0, errors.ErrSyntax(fmt.Sprintf("unexpected character '%c'", src[cursor]), cursor) - } - } -} - -func indentObject( - dst []byte, - src []byte, - indentNum int, - cursor int64, - prefix []byte, - indentBytes []byte, - escape bool) ([]byte, int64, error) { - if src[cursor] == '{' { - dst = append(dst, '{') - } else { - return nil, 0, errors.ErrExpected("expected { character for object value", cursor) - } - cursor = skipWhiteSpace(src, cursor+1) - if src[cursor] == '}' { - dst = append(dst, '}') - return dst, cursor + 1, nil - } - indentNum++ - var err error - for { - dst = append(append(dst, '\n'), prefix...) - for i := 0; i < indentNum; i++ { - dst = append(dst, indentBytes...) - } - cursor = skipWhiteSpace(src, cursor) - dst, cursor, err = compactString(dst, src, cursor, escape) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(src, cursor) - if src[cursor] != ':' { - return nil, 0, errors.ErrSyntax( - fmt.Sprintf("invalid character '%c' after object key", src[cursor]), - cursor+1, - ) - } - dst = append(dst, ':', ' ') - dst, cursor, err = indentValue(dst, src, indentNum, cursor+1, prefix, indentBytes, escape) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(src, cursor) - switch src[cursor] { - case '}': - dst = append(append(dst, '\n'), prefix...) - for i := 0; i < indentNum-1; i++ { - dst = append(dst, indentBytes...) - } - dst = append(dst, '}') - cursor++ - return dst, cursor, nil - case ',': - dst = append(dst, ',') - default: - return nil, 0, errors.ErrSyntax( - fmt.Sprintf("invalid character '%c' after object key:value pair", src[cursor]), - cursor+1, - ) - } - cursor++ - } -} - -func indentArray( - dst []byte, - src []byte, - indentNum int, - cursor int64, - prefix []byte, - indentBytes []byte, - escape bool) ([]byte, int64, error) { - if src[cursor] == '[' { - dst = append(dst, '[') - } else { - return nil, 0, errors.ErrExpected("expected [ character for array value", cursor) - } - cursor = skipWhiteSpace(src, cursor+1) - if src[cursor] == ']' { - dst = append(dst, ']') - return dst, cursor + 1, nil - } - indentNum++ - var err error - for { - dst = append(append(dst, '\n'), prefix...) - for i := 0; i < indentNum; i++ { - dst = append(dst, indentBytes...) - } - dst, cursor, err = indentValue(dst, src, indentNum, cursor, prefix, indentBytes, escape) - if err != nil { - return nil, 0, err - } - cursor = skipWhiteSpace(src, cursor) - switch src[cursor] { - case ']': - dst = append(append(dst, '\n'), prefix...) - for i := 0; i < indentNum-1; i++ { - dst = append(dst, indentBytes...) - } - dst = append(dst, ']') - cursor++ - return dst, cursor, nil - case ',': - dst = append(dst, ',') - default: - return nil, 0, errors.ErrSyntax( - fmt.Sprintf("invalid character '%c' after array value", src[cursor]), - cursor+1, - ) - } - cursor++ - } -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/int.go b/vendor/github.com/goccy/go-json/internal/encoder/int.go deleted file mode 100644 index 8b5febeaa63..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/int.go +++ /dev/null @@ -1,176 +0,0 @@ -// This files's processing codes are inspired by https://github.com/segmentio/encoding. -// The license notation is as follows. -// -// # MIT License -// -// Copyright (c) 2019 Segment.io, Inc. -// -// 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. -package encoder - -import ( - "unsafe" -) - -var endianness int - -func init() { - var b [2]byte - *(*uint16)(unsafe.Pointer(&b)) = uint16(0xABCD) - - switch b[0] { - case 0xCD: - endianness = 0 // LE - case 0xAB: - endianness = 1 // BE - default: - panic("could not determine endianness") - } -} - -// "00010203...96979899" cast to []uint16 -var intLELookup = [100]uint16{ - 0x3030, 0x3130, 0x3230, 0x3330, 0x3430, 0x3530, 0x3630, 0x3730, 0x3830, 0x3930, - 0x3031, 0x3131, 0x3231, 0x3331, 0x3431, 0x3531, 0x3631, 0x3731, 0x3831, 0x3931, - 0x3032, 0x3132, 0x3232, 0x3332, 0x3432, 0x3532, 0x3632, 0x3732, 0x3832, 0x3932, - 0x3033, 0x3133, 0x3233, 0x3333, 0x3433, 0x3533, 0x3633, 0x3733, 0x3833, 0x3933, - 0x3034, 0x3134, 0x3234, 0x3334, 0x3434, 0x3534, 0x3634, 0x3734, 0x3834, 0x3934, - 0x3035, 0x3135, 0x3235, 0x3335, 0x3435, 0x3535, 0x3635, 0x3735, 0x3835, 0x3935, - 0x3036, 0x3136, 0x3236, 0x3336, 0x3436, 0x3536, 0x3636, 0x3736, 0x3836, 0x3936, - 0x3037, 0x3137, 0x3237, 0x3337, 0x3437, 0x3537, 0x3637, 0x3737, 0x3837, 0x3937, - 0x3038, 0x3138, 0x3238, 0x3338, 0x3438, 0x3538, 0x3638, 0x3738, 0x3838, 0x3938, - 0x3039, 0x3139, 0x3239, 0x3339, 0x3439, 0x3539, 0x3639, 0x3739, 0x3839, 0x3939, -} - -var intBELookup = [100]uint16{ - 0x3030, 0x3031, 0x3032, 0x3033, 0x3034, 0x3035, 0x3036, 0x3037, 0x3038, 0x3039, - 0x3130, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137, 0x3138, 0x3139, - 0x3230, 0x3231, 0x3232, 0x3233, 0x3234, 0x3235, 0x3236, 0x3237, 0x3238, 0x3239, - 0x3330, 0x3331, 0x3332, 0x3333, 0x3334, 0x3335, 0x3336, 0x3337, 0x3338, 0x3339, - 0x3430, 0x3431, 0x3432, 0x3433, 0x3434, 0x3435, 0x3436, 0x3437, 0x3438, 0x3439, - 0x3530, 0x3531, 0x3532, 0x3533, 0x3534, 0x3535, 0x3536, 0x3537, 0x3538, 0x3539, - 0x3630, 0x3631, 0x3632, 0x3633, 0x3634, 0x3635, 0x3636, 0x3637, 0x3638, 0x3639, - 0x3730, 0x3731, 0x3732, 0x3733, 0x3734, 0x3735, 0x3736, 0x3737, 0x3738, 0x3739, - 0x3830, 0x3831, 0x3832, 0x3833, 0x3834, 0x3835, 0x3836, 0x3837, 0x3838, 0x3839, - 0x3930, 0x3931, 0x3932, 0x3933, 0x3934, 0x3935, 0x3936, 0x3937, 0x3938, 0x3939, -} - -var intLookup = [2]*[100]uint16{&intLELookup, &intBELookup} - -func numMask(numBitSize uint8) uint64 { - return 1<>(code.NumBitSize-1))&1 == 1 - if !negative { - if n < 10 { - return append(out, byte(n+'0')) - } else if n < 100 { - u := intLELookup[n] - return append(out, byte(u), byte(u>>8)) - } - } else { - n = -n & mask - } - - lookup := intLookup[endianness] - - var b [22]byte - u := (*[11]uint16)(unsafe.Pointer(&b)) - i := 11 - - for n >= 100 { - j := n % 100 - n /= 100 - i-- - u[i] = lookup[j] - } - - i-- - u[i] = lookup[n] - - i *= 2 // convert to byte index - if n < 10 { - i++ // remove leading zero - } - if negative { - i-- - b[i] = '-' - } - - return append(out, b[i:]...) -} - -func AppendUint(_ *RuntimeContext, out []byte, p uintptr, code *Opcode) []byte { - var u64 uint64 - switch code.NumBitSize { - case 8: - u64 = (uint64)(**(**uint8)(unsafe.Pointer(&p))) - case 16: - u64 = (uint64)(**(**uint16)(unsafe.Pointer(&p))) - case 32: - u64 = (uint64)(**(**uint32)(unsafe.Pointer(&p))) - case 64: - u64 = **(**uint64)(unsafe.Pointer(&p)) - } - mask := numMask(code.NumBitSize) - n := u64 & mask - if n < 10 { - return append(out, byte(n+'0')) - } else if n < 100 { - u := intLELookup[n] - return append(out, byte(u), byte(u>>8)) - } - - lookup := intLookup[endianness] - - var b [22]byte - u := (*[11]uint16)(unsafe.Pointer(&b)) - i := 11 - - for n >= 100 { - j := n % 100 - n /= 100 - i-- - u[i] = lookup[j] - } - - i-- - u[i] = lookup[n] - - i *= 2 // convert to byte index - if n < 10 { - i++ // remove leading zero - } - return append(out, b[i:]...) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/map112.go b/vendor/github.com/goccy/go-json/internal/encoder/map112.go deleted file mode 100644 index e96ffadf7ab..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/map112.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build !go1.13 -// +build !go1.13 - -package encoder - -import "unsafe" - -//go:linkname MapIterValue reflect.mapitervalue -func MapIterValue(it *mapIter) unsafe.Pointer diff --git a/vendor/github.com/goccy/go-json/internal/encoder/map113.go b/vendor/github.com/goccy/go-json/internal/encoder/map113.go deleted file mode 100644 index 9b69dcc360d..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/map113.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build go1.13 -// +build go1.13 - -package encoder - -import "unsafe" - -//go:linkname MapIterValue reflect.mapiterelem -func MapIterValue(it *mapIter) unsafe.Pointer diff --git a/vendor/github.com/goccy/go-json/internal/encoder/opcode.go b/vendor/github.com/goccy/go-json/internal/encoder/opcode.go deleted file mode 100644 index df22f55423d..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/opcode.go +++ /dev/null @@ -1,752 +0,0 @@ -package encoder - -import ( - "bytes" - "fmt" - "sort" - "strings" - "unsafe" - - "github.com/goccy/go-json/internal/runtime" -) - -const uintptrSize = 4 << (^uintptr(0) >> 63) - -type OpFlags uint16 - -const ( - AnonymousHeadFlags OpFlags = 1 << 0 - AnonymousKeyFlags OpFlags = 1 << 1 - IndirectFlags OpFlags = 1 << 2 - IsTaggedKeyFlags OpFlags = 1 << 3 - NilCheckFlags OpFlags = 1 << 4 - AddrForMarshalerFlags OpFlags = 1 << 5 - IsNextOpPtrTypeFlags OpFlags = 1 << 6 - IsNilableTypeFlags OpFlags = 1 << 7 - MarshalerContextFlags OpFlags = 1 << 8 - NonEmptyInterfaceFlags OpFlags = 1 << 9 -) - -type Opcode struct { - Op OpType // operation type - Idx uint32 // offset to access ptr - Next *Opcode // next opcode - End *Opcode // array/slice/struct/map end - NextField *Opcode // next struct field - Key string // struct field key - Offset uint32 // offset size from struct header - PtrNum uint8 // pointer number: e.g. double pointer is 2. - NumBitSize uint8 - Flags OpFlags - - Type *runtime.Type // go type - Jmp *CompiledCode // for recursive call - FieldQuery *FieldQuery // field query for Interface / MarshalJSON / MarshalText - ElemIdx uint32 // offset to access array/slice elem - Length uint32 // offset to access slice length or array length - Indent uint32 // indent number - Size uint32 // array/slice elem size - DisplayIdx uint32 // opcode index - DisplayKey string // key text to display -} - -func (c *Opcode) Validate() error { - var prevIdx uint32 - for code := c; !code.IsEnd(); { - if prevIdx != 0 { - if code.DisplayIdx != prevIdx+1 { - return fmt.Errorf( - "invalid index. previous display index is %d but next is %d. dump = %s", - prevIdx, code.DisplayIdx, c.Dump(), - ) - } - } - prevIdx = code.DisplayIdx - code = code.IterNext() - } - return nil -} - -func (c *Opcode) IterNext() *Opcode { - if c == nil { - return nil - } - switch c.Op.CodeType() { - case CodeArrayElem, CodeSliceElem, CodeMapKey: - return c.End - default: - return c.Next - } -} - -func (c *Opcode) IsEnd() bool { - if c == nil { - return true - } - return c.Op == OpEnd || c.Op == OpInterfaceEnd || c.Op == OpRecursiveEnd -} - -func (c *Opcode) MaxIdx() uint32 { - max := uint32(0) - for _, value := range []uint32{ - c.Idx, - c.ElemIdx, - c.Length, - c.Size, - } { - if max < value { - max = value - } - } - return max -} - -func (c *Opcode) ToHeaderType(isString bool) OpType { - switch c.Op { - case OpInt: - if isString { - return OpStructHeadIntString - } - return OpStructHeadInt - case OpIntPtr: - if isString { - return OpStructHeadIntPtrString - } - return OpStructHeadIntPtr - case OpUint: - if isString { - return OpStructHeadUintString - } - return OpStructHeadUint - case OpUintPtr: - if isString { - return OpStructHeadUintPtrString - } - return OpStructHeadUintPtr - case OpFloat32: - if isString { - return OpStructHeadFloat32String - } - return OpStructHeadFloat32 - case OpFloat32Ptr: - if isString { - return OpStructHeadFloat32PtrString - } - return OpStructHeadFloat32Ptr - case OpFloat64: - if isString { - return OpStructHeadFloat64String - } - return OpStructHeadFloat64 - case OpFloat64Ptr: - if isString { - return OpStructHeadFloat64PtrString - } - return OpStructHeadFloat64Ptr - case OpString: - if isString { - return OpStructHeadStringString - } - return OpStructHeadString - case OpStringPtr: - if isString { - return OpStructHeadStringPtrString - } - return OpStructHeadStringPtr - case OpNumber: - if isString { - return OpStructHeadNumberString - } - return OpStructHeadNumber - case OpNumberPtr: - if isString { - return OpStructHeadNumberPtrString - } - return OpStructHeadNumberPtr - case OpBool: - if isString { - return OpStructHeadBoolString - } - return OpStructHeadBool - case OpBoolPtr: - if isString { - return OpStructHeadBoolPtrString - } - return OpStructHeadBoolPtr - case OpBytes: - return OpStructHeadBytes - case OpBytesPtr: - return OpStructHeadBytesPtr - case OpMap: - return OpStructHeadMap - case OpMapPtr: - c.Op = OpMap - return OpStructHeadMapPtr - case OpArray: - return OpStructHeadArray - case OpArrayPtr: - c.Op = OpArray - return OpStructHeadArrayPtr - case OpSlice: - return OpStructHeadSlice - case OpSlicePtr: - c.Op = OpSlice - return OpStructHeadSlicePtr - case OpMarshalJSON: - return OpStructHeadMarshalJSON - case OpMarshalJSONPtr: - return OpStructHeadMarshalJSONPtr - case OpMarshalText: - return OpStructHeadMarshalText - case OpMarshalTextPtr: - return OpStructHeadMarshalTextPtr - } - return OpStructHead -} - -func (c *Opcode) ToFieldType(isString bool) OpType { - switch c.Op { - case OpInt: - if isString { - return OpStructFieldIntString - } - return OpStructFieldInt - case OpIntPtr: - if isString { - return OpStructFieldIntPtrString - } - return OpStructFieldIntPtr - case OpUint: - if isString { - return OpStructFieldUintString - } - return OpStructFieldUint - case OpUintPtr: - if isString { - return OpStructFieldUintPtrString - } - return OpStructFieldUintPtr - case OpFloat32: - if isString { - return OpStructFieldFloat32String - } - return OpStructFieldFloat32 - case OpFloat32Ptr: - if isString { - return OpStructFieldFloat32PtrString - } - return OpStructFieldFloat32Ptr - case OpFloat64: - if isString { - return OpStructFieldFloat64String - } - return OpStructFieldFloat64 - case OpFloat64Ptr: - if isString { - return OpStructFieldFloat64PtrString - } - return OpStructFieldFloat64Ptr - case OpString: - if isString { - return OpStructFieldStringString - } - return OpStructFieldString - case OpStringPtr: - if isString { - return OpStructFieldStringPtrString - } - return OpStructFieldStringPtr - case OpNumber: - if isString { - return OpStructFieldNumberString - } - return OpStructFieldNumber - case OpNumberPtr: - if isString { - return OpStructFieldNumberPtrString - } - return OpStructFieldNumberPtr - case OpBool: - if isString { - return OpStructFieldBoolString - } - return OpStructFieldBool - case OpBoolPtr: - if isString { - return OpStructFieldBoolPtrString - } - return OpStructFieldBoolPtr - case OpBytes: - return OpStructFieldBytes - case OpBytesPtr: - return OpStructFieldBytesPtr - case OpMap: - return OpStructFieldMap - case OpMapPtr: - c.Op = OpMap - return OpStructFieldMapPtr - case OpArray: - return OpStructFieldArray - case OpArrayPtr: - c.Op = OpArray - return OpStructFieldArrayPtr - case OpSlice: - return OpStructFieldSlice - case OpSlicePtr: - c.Op = OpSlice - return OpStructFieldSlicePtr - case OpMarshalJSON: - return OpStructFieldMarshalJSON - case OpMarshalJSONPtr: - return OpStructFieldMarshalJSONPtr - case OpMarshalText: - return OpStructFieldMarshalText - case OpMarshalTextPtr: - return OpStructFieldMarshalTextPtr - } - return OpStructField -} - -func newOpCode(ctx *compileContext, typ *runtime.Type, op OpType) *Opcode { - return newOpCodeWithNext(ctx, typ, op, newEndOp(ctx, typ)) -} - -func opcodeOffset(idx int) uint32 { - return uint32(idx) * uintptrSize -} - -func getCodeAddrByIdx(head *Opcode, idx uint32) *Opcode { - addr := uintptr(unsafe.Pointer(head)) + uintptr(idx)*unsafe.Sizeof(Opcode{}) - return *(**Opcode)(unsafe.Pointer(&addr)) -} - -func copyOpcode(code *Opcode) *Opcode { - codeNum := ToEndCode(code).DisplayIdx + 1 - codeSlice := make([]Opcode, codeNum) - head := (*Opcode)((*runtime.SliceHeader)(unsafe.Pointer(&codeSlice)).Data) - ptr := head - c := code - for { - *ptr = Opcode{ - Op: c.Op, - Key: c.Key, - PtrNum: c.PtrNum, - NumBitSize: c.NumBitSize, - Flags: c.Flags, - Idx: c.Idx, - Offset: c.Offset, - Type: c.Type, - FieldQuery: c.FieldQuery, - DisplayIdx: c.DisplayIdx, - DisplayKey: c.DisplayKey, - ElemIdx: c.ElemIdx, - Length: c.Length, - Size: c.Size, - Indent: c.Indent, - Jmp: c.Jmp, - } - if c.End != nil { - ptr.End = getCodeAddrByIdx(head, c.End.DisplayIdx) - } - if c.NextField != nil { - ptr.NextField = getCodeAddrByIdx(head, c.NextField.DisplayIdx) - } - if c.Next != nil { - ptr.Next = getCodeAddrByIdx(head, c.Next.DisplayIdx) - } - if c.IsEnd() { - break - } - ptr = getCodeAddrByIdx(head, c.DisplayIdx+1) - c = c.IterNext() - } - return head -} - -func setTotalLengthToInterfaceOp(code *Opcode) { - for c := code; !c.IsEnd(); { - if c.Op == OpInterface || c.Op == OpInterfacePtr { - c.Length = uint32(code.TotalLength()) - } - c = c.IterNext() - } -} - -func ToEndCode(code *Opcode) *Opcode { - c := code - for !c.IsEnd() { - c = c.IterNext() - } - return c -} - -func copyToInterfaceOpcode(code *Opcode) *Opcode { - copied := copyOpcode(code) - c := copied - c = ToEndCode(c) - c.Idx += uintptrSize - c.ElemIdx = c.Idx + uintptrSize - c.Length = c.Idx + 2*uintptrSize - c.Op = OpInterfaceEnd - return copied -} - -func newOpCodeWithNext(ctx *compileContext, typ *runtime.Type, op OpType, next *Opcode) *Opcode { - return &Opcode{ - Op: op, - Idx: opcodeOffset(ctx.ptrIndex), - Next: next, - Type: typ, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } -} - -func newEndOp(ctx *compileContext, typ *runtime.Type) *Opcode { - return newOpCodeWithNext(ctx, typ, OpEnd, nil) -} - -func (c *Opcode) TotalLength() int { - var idx int - code := c - for !code.IsEnd() { - maxIdx := int(code.MaxIdx() / uintptrSize) - if idx < maxIdx { - idx = maxIdx - } - if code.Op == OpRecursiveEnd { - break - } - code = code.IterNext() - } - maxIdx := int(code.MaxIdx() / uintptrSize) - if idx < maxIdx { - idx = maxIdx - } - return idx + 1 -} - -func (c *Opcode) dumpHead(code *Opcode) string { - var length uint32 - if code.Op.CodeType() == CodeArrayHead { - length = code.Length - } else { - length = code.Length / uintptrSize - } - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d][elemIdx:%d][length:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - code.ElemIdx/uintptrSize, - length, - ) -} - -func (c *Opcode) dumpMapHead(code *Opcode) string { - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - ) -} - -func (c *Opcode) dumpMapEnd(code *Opcode) string { - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - ) -} - -func (c *Opcode) dumpElem(code *Opcode) string { - var length uint32 - if code.Op.CodeType() == CodeArrayElem { - length = code.Length - } else { - length = code.Length / uintptrSize - } - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d][elemIdx:%d][length:%d][size:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - code.ElemIdx/uintptrSize, - length, - code.Size, - ) -} - -func (c *Opcode) dumpField(code *Opcode) string { - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d][key:%s][offset:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - code.DisplayKey, - code.Offset, - ) -} - -func (c *Opcode) dumpKey(code *Opcode) string { - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - ) -} - -func (c *Opcode) dumpValue(code *Opcode) string { - return fmt.Sprintf( - `[%03d]%s%s ([idx:%d])`, - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - ) -} - -func (c *Opcode) Dump() string { - codes := []string{} - for code := c; !code.IsEnd(); { - switch code.Op.CodeType() { - case CodeSliceHead: - codes = append(codes, c.dumpHead(code)) - code = code.Next - case CodeMapHead: - codes = append(codes, c.dumpMapHead(code)) - code = code.Next - case CodeArrayElem, CodeSliceElem: - codes = append(codes, c.dumpElem(code)) - code = code.End - case CodeMapKey: - codes = append(codes, c.dumpKey(code)) - code = code.End - case CodeMapValue: - codes = append(codes, c.dumpValue(code)) - code = code.Next - case CodeMapEnd: - codes = append(codes, c.dumpMapEnd(code)) - code = code.Next - case CodeStructField: - codes = append(codes, c.dumpField(code)) - code = code.Next - case CodeStructEnd: - codes = append(codes, c.dumpField(code)) - code = code.Next - default: - codes = append(codes, fmt.Sprintf( - "[%03d]%s%s ([idx:%d])", - code.DisplayIdx, - strings.Repeat("-", int(code.Indent)), - code.Op, - code.Idx/uintptrSize, - )) - code = code.Next - } - } - return strings.Join(codes, "\n") -} - -func (c *Opcode) DumpDOT() string { - type edge struct { - from, to *Opcode - label string - weight int - } - var edges []edge - - b := &bytes.Buffer{} - fmt.Fprintf(b, "digraph \"%p\" {\n", c.Type) - fmt.Fprintln(b, "mclimit=1.5;\nrankdir=TD;\nordering=out;\nnode[shape=box];") - for code := c; !code.IsEnd(); { - label := code.Op.String() - fmt.Fprintf(b, "\"%p\" [label=%q];\n", code, label) - if p := code.Next; p != nil { - edges = append(edges, edge{ - from: code, - to: p, - label: "Next", - weight: 10, - }) - } - if p := code.NextField; p != nil { - edges = append(edges, edge{ - from: code, - to: p, - label: "NextField", - weight: 2, - }) - } - if p := code.End; p != nil { - edges = append(edges, edge{ - from: code, - to: p, - label: "End", - weight: 1, - }) - } - if p := code.Jmp; p != nil { - edges = append(edges, edge{ - from: code, - to: p.Code, - label: "Jmp", - weight: 1, - }) - } - - switch code.Op.CodeType() { - case CodeSliceHead: - code = code.Next - case CodeMapHead: - code = code.Next - case CodeArrayElem, CodeSliceElem: - code = code.End - case CodeMapKey: - code = code.End - case CodeMapValue: - code = code.Next - case CodeMapEnd: - code = code.Next - case CodeStructField: - code = code.Next - case CodeStructEnd: - code = code.Next - default: - code = code.Next - } - if code.IsEnd() { - fmt.Fprintf(b, "\"%p\" [label=%q];\n", code, code.Op.String()) - } - } - sort.Slice(edges, func(i, j int) bool { - return edges[i].to.DisplayIdx < edges[j].to.DisplayIdx - }) - for _, e := range edges { - fmt.Fprintf(b, "\"%p\" -> \"%p\" [label=%q][weight=%d];\n", e.from, e.to, e.label, e.weight) - } - fmt.Fprint(b, "}") - return b.String() -} - -func newSliceHeaderCode(ctx *compileContext, typ *runtime.Type) *Opcode { - idx := opcodeOffset(ctx.ptrIndex) - ctx.incPtrIndex() - elemIdx := opcodeOffset(ctx.ptrIndex) - ctx.incPtrIndex() - length := opcodeOffset(ctx.ptrIndex) - return &Opcode{ - Op: OpSlice, - Type: typ, - Idx: idx, - DisplayIdx: ctx.opcodeIndex, - ElemIdx: elemIdx, - Length: length, - Indent: ctx.indent, - } -} - -func newSliceElemCode(ctx *compileContext, typ *runtime.Type, head *Opcode, size uintptr) *Opcode { - return &Opcode{ - Op: OpSliceElem, - Type: typ, - Idx: head.Idx, - DisplayIdx: ctx.opcodeIndex, - ElemIdx: head.ElemIdx, - Length: head.Length, - Indent: ctx.indent, - Size: uint32(size), - } -} - -func newArrayHeaderCode(ctx *compileContext, typ *runtime.Type, alen int) *Opcode { - idx := opcodeOffset(ctx.ptrIndex) - ctx.incPtrIndex() - elemIdx := opcodeOffset(ctx.ptrIndex) - return &Opcode{ - Op: OpArray, - Type: typ, - Idx: idx, - DisplayIdx: ctx.opcodeIndex, - ElemIdx: elemIdx, - Indent: ctx.indent, - Length: uint32(alen), - } -} - -func newArrayElemCode(ctx *compileContext, typ *runtime.Type, head *Opcode, length int, size uintptr) *Opcode { - return &Opcode{ - Op: OpArrayElem, - Type: typ, - Idx: head.Idx, - DisplayIdx: ctx.opcodeIndex, - ElemIdx: head.ElemIdx, - Length: uint32(length), - Indent: ctx.indent, - Size: uint32(size), - } -} - -func newMapHeaderCode(ctx *compileContext, typ *runtime.Type) *Opcode { - idx := opcodeOffset(ctx.ptrIndex) - ctx.incPtrIndex() - return &Opcode{ - Op: OpMap, - Type: typ, - Idx: idx, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } -} - -func newMapKeyCode(ctx *compileContext, typ *runtime.Type, head *Opcode) *Opcode { - return &Opcode{ - Op: OpMapKey, - Type: typ, - Idx: head.Idx, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } -} - -func newMapValueCode(ctx *compileContext, typ *runtime.Type, head *Opcode) *Opcode { - return &Opcode{ - Op: OpMapValue, - Type: typ, - Idx: head.Idx, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - } -} - -func newMapEndCode(ctx *compileContext, typ *runtime.Type, head *Opcode) *Opcode { - return &Opcode{ - Op: OpMapEnd, - Type: typ, - Idx: head.Idx, - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - Next: newEndOp(ctx, typ), - } -} - -func newRecursiveCode(ctx *compileContext, typ *runtime.Type, jmp *CompiledCode) *Opcode { - return &Opcode{ - Op: OpRecursive, - Type: typ, - Idx: opcodeOffset(ctx.ptrIndex), - Next: newEndOp(ctx, typ), - DisplayIdx: ctx.opcodeIndex, - Indent: ctx.indent, - Jmp: jmp, - } -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/option.go b/vendor/github.com/goccy/go-json/internal/encoder/option.go deleted file mode 100644 index 12c58e46c01..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/option.go +++ /dev/null @@ -1,48 +0,0 @@ -package encoder - -import ( - "context" - "io" -) - -type OptionFlag uint8 - -const ( - HTMLEscapeOption OptionFlag = 1 << iota - IndentOption - UnorderedMapOption - DebugOption - ColorizeOption - ContextOption - NormalizeUTF8Option - FieldQueryOption -) - -type Option struct { - Flag OptionFlag - ColorScheme *ColorScheme - Context context.Context - DebugOut io.Writer - DebugDOTOut io.WriteCloser -} - -type EncodeFormat struct { - Header string - Footer string -} - -type EncodeFormatScheme struct { - Int EncodeFormat - Uint EncodeFormat - Float EncodeFormat - Bool EncodeFormat - String EncodeFormat - Binary EncodeFormat - ObjectKey EncodeFormat - Null EncodeFormat -} - -type ( - ColorScheme = EncodeFormatScheme - ColorFormat = EncodeFormat -) diff --git a/vendor/github.com/goccy/go-json/internal/encoder/optype.go b/vendor/github.com/goccy/go-json/internal/encoder/optype.go deleted file mode 100644 index 5c1241b47d0..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/optype.go +++ /dev/null @@ -1,932 +0,0 @@ -// Code generated by internal/cmd/generator. DO NOT EDIT! -package encoder - -import ( - "strings" -) - -type CodeType int - -const ( - CodeOp CodeType = 0 - CodeArrayHead CodeType = 1 - CodeArrayElem CodeType = 2 - CodeSliceHead CodeType = 3 - CodeSliceElem CodeType = 4 - CodeMapHead CodeType = 5 - CodeMapKey CodeType = 6 - CodeMapValue CodeType = 7 - CodeMapEnd CodeType = 8 - CodeRecursive CodeType = 9 - CodeStructField CodeType = 10 - CodeStructEnd CodeType = 11 -) - -var opTypeStrings = [400]string{ - "End", - "Interface", - "Ptr", - "SliceElem", - "SliceEnd", - "ArrayElem", - "ArrayEnd", - "MapKey", - "MapValue", - "MapEnd", - "Recursive", - "RecursivePtr", - "RecursiveEnd", - "InterfaceEnd", - "Int", - "Uint", - "Float32", - "Float64", - "Bool", - "String", - "Bytes", - "Number", - "Array", - "Map", - "Slice", - "Struct", - "MarshalJSON", - "MarshalText", - "IntString", - "UintString", - "Float32String", - "Float64String", - "BoolString", - "StringString", - "NumberString", - "IntPtr", - "UintPtr", - "Float32Ptr", - "Float64Ptr", - "BoolPtr", - "StringPtr", - "BytesPtr", - "NumberPtr", - "ArrayPtr", - "MapPtr", - "SlicePtr", - "MarshalJSONPtr", - "MarshalTextPtr", - "InterfacePtr", - "IntPtrString", - "UintPtrString", - "Float32PtrString", - "Float64PtrString", - "BoolPtrString", - "StringPtrString", - "NumberPtrString", - "StructHeadInt", - "StructHeadOmitEmptyInt", - "StructPtrHeadInt", - "StructPtrHeadOmitEmptyInt", - "StructHeadUint", - "StructHeadOmitEmptyUint", - "StructPtrHeadUint", - "StructPtrHeadOmitEmptyUint", - "StructHeadFloat32", - "StructHeadOmitEmptyFloat32", - "StructPtrHeadFloat32", - "StructPtrHeadOmitEmptyFloat32", - "StructHeadFloat64", - "StructHeadOmitEmptyFloat64", - "StructPtrHeadFloat64", - "StructPtrHeadOmitEmptyFloat64", - "StructHeadBool", - "StructHeadOmitEmptyBool", - "StructPtrHeadBool", - "StructPtrHeadOmitEmptyBool", - "StructHeadString", - "StructHeadOmitEmptyString", - "StructPtrHeadString", - "StructPtrHeadOmitEmptyString", - "StructHeadBytes", - "StructHeadOmitEmptyBytes", - "StructPtrHeadBytes", - "StructPtrHeadOmitEmptyBytes", - "StructHeadNumber", - "StructHeadOmitEmptyNumber", - "StructPtrHeadNumber", - "StructPtrHeadOmitEmptyNumber", - "StructHeadArray", - "StructHeadOmitEmptyArray", - "StructPtrHeadArray", - "StructPtrHeadOmitEmptyArray", - "StructHeadMap", - "StructHeadOmitEmptyMap", - "StructPtrHeadMap", - "StructPtrHeadOmitEmptyMap", - "StructHeadSlice", - "StructHeadOmitEmptySlice", - "StructPtrHeadSlice", - "StructPtrHeadOmitEmptySlice", - "StructHeadStruct", - "StructHeadOmitEmptyStruct", - "StructPtrHeadStruct", - "StructPtrHeadOmitEmptyStruct", - "StructHeadMarshalJSON", - "StructHeadOmitEmptyMarshalJSON", - "StructPtrHeadMarshalJSON", - "StructPtrHeadOmitEmptyMarshalJSON", - "StructHeadMarshalText", - "StructHeadOmitEmptyMarshalText", - "StructPtrHeadMarshalText", - "StructPtrHeadOmitEmptyMarshalText", - "StructHeadIntString", - "StructHeadOmitEmptyIntString", - "StructPtrHeadIntString", - "StructPtrHeadOmitEmptyIntString", - "StructHeadUintString", - "StructHeadOmitEmptyUintString", - "StructPtrHeadUintString", - "StructPtrHeadOmitEmptyUintString", - "StructHeadFloat32String", - "StructHeadOmitEmptyFloat32String", - "StructPtrHeadFloat32String", - "StructPtrHeadOmitEmptyFloat32String", - "StructHeadFloat64String", - "StructHeadOmitEmptyFloat64String", - "StructPtrHeadFloat64String", - "StructPtrHeadOmitEmptyFloat64String", - "StructHeadBoolString", - "StructHeadOmitEmptyBoolString", - "StructPtrHeadBoolString", - "StructPtrHeadOmitEmptyBoolString", - "StructHeadStringString", - "StructHeadOmitEmptyStringString", - "StructPtrHeadStringString", - "StructPtrHeadOmitEmptyStringString", - "StructHeadNumberString", - "StructHeadOmitEmptyNumberString", - "StructPtrHeadNumberString", - "StructPtrHeadOmitEmptyNumberString", - "StructHeadIntPtr", - "StructHeadOmitEmptyIntPtr", - "StructPtrHeadIntPtr", - "StructPtrHeadOmitEmptyIntPtr", - "StructHeadUintPtr", - "StructHeadOmitEmptyUintPtr", - "StructPtrHeadUintPtr", - "StructPtrHeadOmitEmptyUintPtr", - "StructHeadFloat32Ptr", - "StructHeadOmitEmptyFloat32Ptr", - "StructPtrHeadFloat32Ptr", - "StructPtrHeadOmitEmptyFloat32Ptr", - "StructHeadFloat64Ptr", - "StructHeadOmitEmptyFloat64Ptr", - "StructPtrHeadFloat64Ptr", - "StructPtrHeadOmitEmptyFloat64Ptr", - "StructHeadBoolPtr", - "StructHeadOmitEmptyBoolPtr", - "StructPtrHeadBoolPtr", - "StructPtrHeadOmitEmptyBoolPtr", - "StructHeadStringPtr", - "StructHeadOmitEmptyStringPtr", - "StructPtrHeadStringPtr", - "StructPtrHeadOmitEmptyStringPtr", - "StructHeadBytesPtr", - "StructHeadOmitEmptyBytesPtr", - "StructPtrHeadBytesPtr", - "StructPtrHeadOmitEmptyBytesPtr", - "StructHeadNumberPtr", - "StructHeadOmitEmptyNumberPtr", - "StructPtrHeadNumberPtr", - "StructPtrHeadOmitEmptyNumberPtr", - "StructHeadArrayPtr", - "StructHeadOmitEmptyArrayPtr", - "StructPtrHeadArrayPtr", - "StructPtrHeadOmitEmptyArrayPtr", - "StructHeadMapPtr", - "StructHeadOmitEmptyMapPtr", - "StructPtrHeadMapPtr", - "StructPtrHeadOmitEmptyMapPtr", - "StructHeadSlicePtr", - "StructHeadOmitEmptySlicePtr", - "StructPtrHeadSlicePtr", - "StructPtrHeadOmitEmptySlicePtr", - "StructHeadMarshalJSONPtr", - "StructHeadOmitEmptyMarshalJSONPtr", - "StructPtrHeadMarshalJSONPtr", - "StructPtrHeadOmitEmptyMarshalJSONPtr", - "StructHeadMarshalTextPtr", - "StructHeadOmitEmptyMarshalTextPtr", - "StructPtrHeadMarshalTextPtr", - "StructPtrHeadOmitEmptyMarshalTextPtr", - "StructHeadInterfacePtr", - "StructHeadOmitEmptyInterfacePtr", - "StructPtrHeadInterfacePtr", - "StructPtrHeadOmitEmptyInterfacePtr", - "StructHeadIntPtrString", - "StructHeadOmitEmptyIntPtrString", - "StructPtrHeadIntPtrString", - "StructPtrHeadOmitEmptyIntPtrString", - "StructHeadUintPtrString", - "StructHeadOmitEmptyUintPtrString", - "StructPtrHeadUintPtrString", - "StructPtrHeadOmitEmptyUintPtrString", - "StructHeadFloat32PtrString", - "StructHeadOmitEmptyFloat32PtrString", - "StructPtrHeadFloat32PtrString", - "StructPtrHeadOmitEmptyFloat32PtrString", - "StructHeadFloat64PtrString", - "StructHeadOmitEmptyFloat64PtrString", - "StructPtrHeadFloat64PtrString", - "StructPtrHeadOmitEmptyFloat64PtrString", - "StructHeadBoolPtrString", - "StructHeadOmitEmptyBoolPtrString", - "StructPtrHeadBoolPtrString", - "StructPtrHeadOmitEmptyBoolPtrString", - "StructHeadStringPtrString", - "StructHeadOmitEmptyStringPtrString", - "StructPtrHeadStringPtrString", - "StructPtrHeadOmitEmptyStringPtrString", - "StructHeadNumberPtrString", - "StructHeadOmitEmptyNumberPtrString", - "StructPtrHeadNumberPtrString", - "StructPtrHeadOmitEmptyNumberPtrString", - "StructHead", - "StructHeadOmitEmpty", - "StructPtrHead", - "StructPtrHeadOmitEmpty", - "StructFieldInt", - "StructFieldOmitEmptyInt", - "StructEndInt", - "StructEndOmitEmptyInt", - "StructFieldUint", - "StructFieldOmitEmptyUint", - "StructEndUint", - "StructEndOmitEmptyUint", - "StructFieldFloat32", - "StructFieldOmitEmptyFloat32", - "StructEndFloat32", - "StructEndOmitEmptyFloat32", - "StructFieldFloat64", - "StructFieldOmitEmptyFloat64", - "StructEndFloat64", - "StructEndOmitEmptyFloat64", - "StructFieldBool", - "StructFieldOmitEmptyBool", - "StructEndBool", - "StructEndOmitEmptyBool", - "StructFieldString", - "StructFieldOmitEmptyString", - "StructEndString", - "StructEndOmitEmptyString", - "StructFieldBytes", - "StructFieldOmitEmptyBytes", - "StructEndBytes", - "StructEndOmitEmptyBytes", - "StructFieldNumber", - "StructFieldOmitEmptyNumber", - "StructEndNumber", - "StructEndOmitEmptyNumber", - "StructFieldArray", - "StructFieldOmitEmptyArray", - "StructEndArray", - "StructEndOmitEmptyArray", - "StructFieldMap", - "StructFieldOmitEmptyMap", - "StructEndMap", - "StructEndOmitEmptyMap", - "StructFieldSlice", - "StructFieldOmitEmptySlice", - "StructEndSlice", - "StructEndOmitEmptySlice", - "StructFieldStruct", - "StructFieldOmitEmptyStruct", - "StructEndStruct", - "StructEndOmitEmptyStruct", - "StructFieldMarshalJSON", - "StructFieldOmitEmptyMarshalJSON", - "StructEndMarshalJSON", - "StructEndOmitEmptyMarshalJSON", - "StructFieldMarshalText", - "StructFieldOmitEmptyMarshalText", - "StructEndMarshalText", - "StructEndOmitEmptyMarshalText", - "StructFieldIntString", - "StructFieldOmitEmptyIntString", - "StructEndIntString", - "StructEndOmitEmptyIntString", - "StructFieldUintString", - "StructFieldOmitEmptyUintString", - "StructEndUintString", - "StructEndOmitEmptyUintString", - "StructFieldFloat32String", - "StructFieldOmitEmptyFloat32String", - "StructEndFloat32String", - "StructEndOmitEmptyFloat32String", - "StructFieldFloat64String", - "StructFieldOmitEmptyFloat64String", - "StructEndFloat64String", - "StructEndOmitEmptyFloat64String", - "StructFieldBoolString", - "StructFieldOmitEmptyBoolString", - "StructEndBoolString", - "StructEndOmitEmptyBoolString", - "StructFieldStringString", - "StructFieldOmitEmptyStringString", - "StructEndStringString", - "StructEndOmitEmptyStringString", - "StructFieldNumberString", - "StructFieldOmitEmptyNumberString", - "StructEndNumberString", - "StructEndOmitEmptyNumberString", - "StructFieldIntPtr", - "StructFieldOmitEmptyIntPtr", - "StructEndIntPtr", - "StructEndOmitEmptyIntPtr", - "StructFieldUintPtr", - "StructFieldOmitEmptyUintPtr", - "StructEndUintPtr", - "StructEndOmitEmptyUintPtr", - "StructFieldFloat32Ptr", - "StructFieldOmitEmptyFloat32Ptr", - "StructEndFloat32Ptr", - "StructEndOmitEmptyFloat32Ptr", - "StructFieldFloat64Ptr", - "StructFieldOmitEmptyFloat64Ptr", - "StructEndFloat64Ptr", - "StructEndOmitEmptyFloat64Ptr", - "StructFieldBoolPtr", - "StructFieldOmitEmptyBoolPtr", - "StructEndBoolPtr", - "StructEndOmitEmptyBoolPtr", - "StructFieldStringPtr", - "StructFieldOmitEmptyStringPtr", - "StructEndStringPtr", - "StructEndOmitEmptyStringPtr", - "StructFieldBytesPtr", - "StructFieldOmitEmptyBytesPtr", - "StructEndBytesPtr", - "StructEndOmitEmptyBytesPtr", - "StructFieldNumberPtr", - "StructFieldOmitEmptyNumberPtr", - "StructEndNumberPtr", - "StructEndOmitEmptyNumberPtr", - "StructFieldArrayPtr", - "StructFieldOmitEmptyArrayPtr", - "StructEndArrayPtr", - "StructEndOmitEmptyArrayPtr", - "StructFieldMapPtr", - "StructFieldOmitEmptyMapPtr", - "StructEndMapPtr", - "StructEndOmitEmptyMapPtr", - "StructFieldSlicePtr", - "StructFieldOmitEmptySlicePtr", - "StructEndSlicePtr", - "StructEndOmitEmptySlicePtr", - "StructFieldMarshalJSONPtr", - "StructFieldOmitEmptyMarshalJSONPtr", - "StructEndMarshalJSONPtr", - "StructEndOmitEmptyMarshalJSONPtr", - "StructFieldMarshalTextPtr", - "StructFieldOmitEmptyMarshalTextPtr", - "StructEndMarshalTextPtr", - "StructEndOmitEmptyMarshalTextPtr", - "StructFieldInterfacePtr", - "StructFieldOmitEmptyInterfacePtr", - "StructEndInterfacePtr", - "StructEndOmitEmptyInterfacePtr", - "StructFieldIntPtrString", - "StructFieldOmitEmptyIntPtrString", - "StructEndIntPtrString", - "StructEndOmitEmptyIntPtrString", - "StructFieldUintPtrString", - "StructFieldOmitEmptyUintPtrString", - "StructEndUintPtrString", - "StructEndOmitEmptyUintPtrString", - "StructFieldFloat32PtrString", - "StructFieldOmitEmptyFloat32PtrString", - "StructEndFloat32PtrString", - "StructEndOmitEmptyFloat32PtrString", - "StructFieldFloat64PtrString", - "StructFieldOmitEmptyFloat64PtrString", - "StructEndFloat64PtrString", - "StructEndOmitEmptyFloat64PtrString", - "StructFieldBoolPtrString", - "StructFieldOmitEmptyBoolPtrString", - "StructEndBoolPtrString", - "StructEndOmitEmptyBoolPtrString", - "StructFieldStringPtrString", - "StructFieldOmitEmptyStringPtrString", - "StructEndStringPtrString", - "StructEndOmitEmptyStringPtrString", - "StructFieldNumberPtrString", - "StructFieldOmitEmptyNumberPtrString", - "StructEndNumberPtrString", - "StructEndOmitEmptyNumberPtrString", - "StructField", - "StructFieldOmitEmpty", - "StructEnd", - "StructEndOmitEmpty", -} - -type OpType uint16 - -const ( - OpEnd OpType = 0 - OpInterface OpType = 1 - OpPtr OpType = 2 - OpSliceElem OpType = 3 - OpSliceEnd OpType = 4 - OpArrayElem OpType = 5 - OpArrayEnd OpType = 6 - OpMapKey OpType = 7 - OpMapValue OpType = 8 - OpMapEnd OpType = 9 - OpRecursive OpType = 10 - OpRecursivePtr OpType = 11 - OpRecursiveEnd OpType = 12 - OpInterfaceEnd OpType = 13 - OpInt OpType = 14 - OpUint OpType = 15 - OpFloat32 OpType = 16 - OpFloat64 OpType = 17 - OpBool OpType = 18 - OpString OpType = 19 - OpBytes OpType = 20 - OpNumber OpType = 21 - OpArray OpType = 22 - OpMap OpType = 23 - OpSlice OpType = 24 - OpStruct OpType = 25 - OpMarshalJSON OpType = 26 - OpMarshalText OpType = 27 - OpIntString OpType = 28 - OpUintString OpType = 29 - OpFloat32String OpType = 30 - OpFloat64String OpType = 31 - OpBoolString OpType = 32 - OpStringString OpType = 33 - OpNumberString OpType = 34 - OpIntPtr OpType = 35 - OpUintPtr OpType = 36 - OpFloat32Ptr OpType = 37 - OpFloat64Ptr OpType = 38 - OpBoolPtr OpType = 39 - OpStringPtr OpType = 40 - OpBytesPtr OpType = 41 - OpNumberPtr OpType = 42 - OpArrayPtr OpType = 43 - OpMapPtr OpType = 44 - OpSlicePtr OpType = 45 - OpMarshalJSONPtr OpType = 46 - OpMarshalTextPtr OpType = 47 - OpInterfacePtr OpType = 48 - OpIntPtrString OpType = 49 - OpUintPtrString OpType = 50 - OpFloat32PtrString OpType = 51 - OpFloat64PtrString OpType = 52 - OpBoolPtrString OpType = 53 - OpStringPtrString OpType = 54 - OpNumberPtrString OpType = 55 - OpStructHeadInt OpType = 56 - OpStructHeadOmitEmptyInt OpType = 57 - OpStructPtrHeadInt OpType = 58 - OpStructPtrHeadOmitEmptyInt OpType = 59 - OpStructHeadUint OpType = 60 - OpStructHeadOmitEmptyUint OpType = 61 - OpStructPtrHeadUint OpType = 62 - OpStructPtrHeadOmitEmptyUint OpType = 63 - OpStructHeadFloat32 OpType = 64 - OpStructHeadOmitEmptyFloat32 OpType = 65 - OpStructPtrHeadFloat32 OpType = 66 - OpStructPtrHeadOmitEmptyFloat32 OpType = 67 - OpStructHeadFloat64 OpType = 68 - OpStructHeadOmitEmptyFloat64 OpType = 69 - OpStructPtrHeadFloat64 OpType = 70 - OpStructPtrHeadOmitEmptyFloat64 OpType = 71 - OpStructHeadBool OpType = 72 - OpStructHeadOmitEmptyBool OpType = 73 - OpStructPtrHeadBool OpType = 74 - OpStructPtrHeadOmitEmptyBool OpType = 75 - OpStructHeadString OpType = 76 - OpStructHeadOmitEmptyString OpType = 77 - OpStructPtrHeadString OpType = 78 - OpStructPtrHeadOmitEmptyString OpType = 79 - OpStructHeadBytes OpType = 80 - OpStructHeadOmitEmptyBytes OpType = 81 - OpStructPtrHeadBytes OpType = 82 - OpStructPtrHeadOmitEmptyBytes OpType = 83 - OpStructHeadNumber OpType = 84 - OpStructHeadOmitEmptyNumber OpType = 85 - OpStructPtrHeadNumber OpType = 86 - OpStructPtrHeadOmitEmptyNumber OpType = 87 - OpStructHeadArray OpType = 88 - OpStructHeadOmitEmptyArray OpType = 89 - OpStructPtrHeadArray OpType = 90 - OpStructPtrHeadOmitEmptyArray OpType = 91 - OpStructHeadMap OpType = 92 - OpStructHeadOmitEmptyMap OpType = 93 - OpStructPtrHeadMap OpType = 94 - OpStructPtrHeadOmitEmptyMap OpType = 95 - OpStructHeadSlice OpType = 96 - OpStructHeadOmitEmptySlice OpType = 97 - OpStructPtrHeadSlice OpType = 98 - OpStructPtrHeadOmitEmptySlice OpType = 99 - OpStructHeadStruct OpType = 100 - OpStructHeadOmitEmptyStruct OpType = 101 - OpStructPtrHeadStruct OpType = 102 - OpStructPtrHeadOmitEmptyStruct OpType = 103 - OpStructHeadMarshalJSON OpType = 104 - OpStructHeadOmitEmptyMarshalJSON OpType = 105 - OpStructPtrHeadMarshalJSON OpType = 106 - OpStructPtrHeadOmitEmptyMarshalJSON OpType = 107 - OpStructHeadMarshalText OpType = 108 - OpStructHeadOmitEmptyMarshalText OpType = 109 - OpStructPtrHeadMarshalText OpType = 110 - OpStructPtrHeadOmitEmptyMarshalText OpType = 111 - OpStructHeadIntString OpType = 112 - OpStructHeadOmitEmptyIntString OpType = 113 - OpStructPtrHeadIntString OpType = 114 - OpStructPtrHeadOmitEmptyIntString OpType = 115 - OpStructHeadUintString OpType = 116 - OpStructHeadOmitEmptyUintString OpType = 117 - OpStructPtrHeadUintString OpType = 118 - OpStructPtrHeadOmitEmptyUintString OpType = 119 - OpStructHeadFloat32String OpType = 120 - OpStructHeadOmitEmptyFloat32String OpType = 121 - OpStructPtrHeadFloat32String OpType = 122 - OpStructPtrHeadOmitEmptyFloat32String OpType = 123 - OpStructHeadFloat64String OpType = 124 - OpStructHeadOmitEmptyFloat64String OpType = 125 - OpStructPtrHeadFloat64String OpType = 126 - OpStructPtrHeadOmitEmptyFloat64String OpType = 127 - OpStructHeadBoolString OpType = 128 - OpStructHeadOmitEmptyBoolString OpType = 129 - OpStructPtrHeadBoolString OpType = 130 - OpStructPtrHeadOmitEmptyBoolString OpType = 131 - OpStructHeadStringString OpType = 132 - OpStructHeadOmitEmptyStringString OpType = 133 - OpStructPtrHeadStringString OpType = 134 - OpStructPtrHeadOmitEmptyStringString OpType = 135 - OpStructHeadNumberString OpType = 136 - OpStructHeadOmitEmptyNumberString OpType = 137 - OpStructPtrHeadNumberString OpType = 138 - OpStructPtrHeadOmitEmptyNumberString OpType = 139 - OpStructHeadIntPtr OpType = 140 - OpStructHeadOmitEmptyIntPtr OpType = 141 - OpStructPtrHeadIntPtr OpType = 142 - OpStructPtrHeadOmitEmptyIntPtr OpType = 143 - OpStructHeadUintPtr OpType = 144 - OpStructHeadOmitEmptyUintPtr OpType = 145 - OpStructPtrHeadUintPtr OpType = 146 - OpStructPtrHeadOmitEmptyUintPtr OpType = 147 - OpStructHeadFloat32Ptr OpType = 148 - OpStructHeadOmitEmptyFloat32Ptr OpType = 149 - OpStructPtrHeadFloat32Ptr OpType = 150 - OpStructPtrHeadOmitEmptyFloat32Ptr OpType = 151 - OpStructHeadFloat64Ptr OpType = 152 - OpStructHeadOmitEmptyFloat64Ptr OpType = 153 - OpStructPtrHeadFloat64Ptr OpType = 154 - OpStructPtrHeadOmitEmptyFloat64Ptr OpType = 155 - OpStructHeadBoolPtr OpType = 156 - OpStructHeadOmitEmptyBoolPtr OpType = 157 - OpStructPtrHeadBoolPtr OpType = 158 - OpStructPtrHeadOmitEmptyBoolPtr OpType = 159 - OpStructHeadStringPtr OpType = 160 - OpStructHeadOmitEmptyStringPtr OpType = 161 - OpStructPtrHeadStringPtr OpType = 162 - OpStructPtrHeadOmitEmptyStringPtr OpType = 163 - OpStructHeadBytesPtr OpType = 164 - OpStructHeadOmitEmptyBytesPtr OpType = 165 - OpStructPtrHeadBytesPtr OpType = 166 - OpStructPtrHeadOmitEmptyBytesPtr OpType = 167 - OpStructHeadNumberPtr OpType = 168 - OpStructHeadOmitEmptyNumberPtr OpType = 169 - OpStructPtrHeadNumberPtr OpType = 170 - OpStructPtrHeadOmitEmptyNumberPtr OpType = 171 - OpStructHeadArrayPtr OpType = 172 - OpStructHeadOmitEmptyArrayPtr OpType = 173 - OpStructPtrHeadArrayPtr OpType = 174 - OpStructPtrHeadOmitEmptyArrayPtr OpType = 175 - OpStructHeadMapPtr OpType = 176 - OpStructHeadOmitEmptyMapPtr OpType = 177 - OpStructPtrHeadMapPtr OpType = 178 - OpStructPtrHeadOmitEmptyMapPtr OpType = 179 - OpStructHeadSlicePtr OpType = 180 - OpStructHeadOmitEmptySlicePtr OpType = 181 - OpStructPtrHeadSlicePtr OpType = 182 - OpStructPtrHeadOmitEmptySlicePtr OpType = 183 - OpStructHeadMarshalJSONPtr OpType = 184 - OpStructHeadOmitEmptyMarshalJSONPtr OpType = 185 - OpStructPtrHeadMarshalJSONPtr OpType = 186 - OpStructPtrHeadOmitEmptyMarshalJSONPtr OpType = 187 - OpStructHeadMarshalTextPtr OpType = 188 - OpStructHeadOmitEmptyMarshalTextPtr OpType = 189 - OpStructPtrHeadMarshalTextPtr OpType = 190 - OpStructPtrHeadOmitEmptyMarshalTextPtr OpType = 191 - OpStructHeadInterfacePtr OpType = 192 - OpStructHeadOmitEmptyInterfacePtr OpType = 193 - OpStructPtrHeadInterfacePtr OpType = 194 - OpStructPtrHeadOmitEmptyInterfacePtr OpType = 195 - OpStructHeadIntPtrString OpType = 196 - OpStructHeadOmitEmptyIntPtrString OpType = 197 - OpStructPtrHeadIntPtrString OpType = 198 - OpStructPtrHeadOmitEmptyIntPtrString OpType = 199 - OpStructHeadUintPtrString OpType = 200 - OpStructHeadOmitEmptyUintPtrString OpType = 201 - OpStructPtrHeadUintPtrString OpType = 202 - OpStructPtrHeadOmitEmptyUintPtrString OpType = 203 - OpStructHeadFloat32PtrString OpType = 204 - OpStructHeadOmitEmptyFloat32PtrString OpType = 205 - OpStructPtrHeadFloat32PtrString OpType = 206 - OpStructPtrHeadOmitEmptyFloat32PtrString OpType = 207 - OpStructHeadFloat64PtrString OpType = 208 - OpStructHeadOmitEmptyFloat64PtrString OpType = 209 - OpStructPtrHeadFloat64PtrString OpType = 210 - OpStructPtrHeadOmitEmptyFloat64PtrString OpType = 211 - OpStructHeadBoolPtrString OpType = 212 - OpStructHeadOmitEmptyBoolPtrString OpType = 213 - OpStructPtrHeadBoolPtrString OpType = 214 - OpStructPtrHeadOmitEmptyBoolPtrString OpType = 215 - OpStructHeadStringPtrString OpType = 216 - OpStructHeadOmitEmptyStringPtrString OpType = 217 - OpStructPtrHeadStringPtrString OpType = 218 - OpStructPtrHeadOmitEmptyStringPtrString OpType = 219 - OpStructHeadNumberPtrString OpType = 220 - OpStructHeadOmitEmptyNumberPtrString OpType = 221 - OpStructPtrHeadNumberPtrString OpType = 222 - OpStructPtrHeadOmitEmptyNumberPtrString OpType = 223 - OpStructHead OpType = 224 - OpStructHeadOmitEmpty OpType = 225 - OpStructPtrHead OpType = 226 - OpStructPtrHeadOmitEmpty OpType = 227 - OpStructFieldInt OpType = 228 - OpStructFieldOmitEmptyInt OpType = 229 - OpStructEndInt OpType = 230 - OpStructEndOmitEmptyInt OpType = 231 - OpStructFieldUint OpType = 232 - OpStructFieldOmitEmptyUint OpType = 233 - OpStructEndUint OpType = 234 - OpStructEndOmitEmptyUint OpType = 235 - OpStructFieldFloat32 OpType = 236 - OpStructFieldOmitEmptyFloat32 OpType = 237 - OpStructEndFloat32 OpType = 238 - OpStructEndOmitEmptyFloat32 OpType = 239 - OpStructFieldFloat64 OpType = 240 - OpStructFieldOmitEmptyFloat64 OpType = 241 - OpStructEndFloat64 OpType = 242 - OpStructEndOmitEmptyFloat64 OpType = 243 - OpStructFieldBool OpType = 244 - OpStructFieldOmitEmptyBool OpType = 245 - OpStructEndBool OpType = 246 - OpStructEndOmitEmptyBool OpType = 247 - OpStructFieldString OpType = 248 - OpStructFieldOmitEmptyString OpType = 249 - OpStructEndString OpType = 250 - OpStructEndOmitEmptyString OpType = 251 - OpStructFieldBytes OpType = 252 - OpStructFieldOmitEmptyBytes OpType = 253 - OpStructEndBytes OpType = 254 - OpStructEndOmitEmptyBytes OpType = 255 - OpStructFieldNumber OpType = 256 - OpStructFieldOmitEmptyNumber OpType = 257 - OpStructEndNumber OpType = 258 - OpStructEndOmitEmptyNumber OpType = 259 - OpStructFieldArray OpType = 260 - OpStructFieldOmitEmptyArray OpType = 261 - OpStructEndArray OpType = 262 - OpStructEndOmitEmptyArray OpType = 263 - OpStructFieldMap OpType = 264 - OpStructFieldOmitEmptyMap OpType = 265 - OpStructEndMap OpType = 266 - OpStructEndOmitEmptyMap OpType = 267 - OpStructFieldSlice OpType = 268 - OpStructFieldOmitEmptySlice OpType = 269 - OpStructEndSlice OpType = 270 - OpStructEndOmitEmptySlice OpType = 271 - OpStructFieldStruct OpType = 272 - OpStructFieldOmitEmptyStruct OpType = 273 - OpStructEndStruct OpType = 274 - OpStructEndOmitEmptyStruct OpType = 275 - OpStructFieldMarshalJSON OpType = 276 - OpStructFieldOmitEmptyMarshalJSON OpType = 277 - OpStructEndMarshalJSON OpType = 278 - OpStructEndOmitEmptyMarshalJSON OpType = 279 - OpStructFieldMarshalText OpType = 280 - OpStructFieldOmitEmptyMarshalText OpType = 281 - OpStructEndMarshalText OpType = 282 - OpStructEndOmitEmptyMarshalText OpType = 283 - OpStructFieldIntString OpType = 284 - OpStructFieldOmitEmptyIntString OpType = 285 - OpStructEndIntString OpType = 286 - OpStructEndOmitEmptyIntString OpType = 287 - OpStructFieldUintString OpType = 288 - OpStructFieldOmitEmptyUintString OpType = 289 - OpStructEndUintString OpType = 290 - OpStructEndOmitEmptyUintString OpType = 291 - OpStructFieldFloat32String OpType = 292 - OpStructFieldOmitEmptyFloat32String OpType = 293 - OpStructEndFloat32String OpType = 294 - OpStructEndOmitEmptyFloat32String OpType = 295 - OpStructFieldFloat64String OpType = 296 - OpStructFieldOmitEmptyFloat64String OpType = 297 - OpStructEndFloat64String OpType = 298 - OpStructEndOmitEmptyFloat64String OpType = 299 - OpStructFieldBoolString OpType = 300 - OpStructFieldOmitEmptyBoolString OpType = 301 - OpStructEndBoolString OpType = 302 - OpStructEndOmitEmptyBoolString OpType = 303 - OpStructFieldStringString OpType = 304 - OpStructFieldOmitEmptyStringString OpType = 305 - OpStructEndStringString OpType = 306 - OpStructEndOmitEmptyStringString OpType = 307 - OpStructFieldNumberString OpType = 308 - OpStructFieldOmitEmptyNumberString OpType = 309 - OpStructEndNumberString OpType = 310 - OpStructEndOmitEmptyNumberString OpType = 311 - OpStructFieldIntPtr OpType = 312 - OpStructFieldOmitEmptyIntPtr OpType = 313 - OpStructEndIntPtr OpType = 314 - OpStructEndOmitEmptyIntPtr OpType = 315 - OpStructFieldUintPtr OpType = 316 - OpStructFieldOmitEmptyUintPtr OpType = 317 - OpStructEndUintPtr OpType = 318 - OpStructEndOmitEmptyUintPtr OpType = 319 - OpStructFieldFloat32Ptr OpType = 320 - OpStructFieldOmitEmptyFloat32Ptr OpType = 321 - OpStructEndFloat32Ptr OpType = 322 - OpStructEndOmitEmptyFloat32Ptr OpType = 323 - OpStructFieldFloat64Ptr OpType = 324 - OpStructFieldOmitEmptyFloat64Ptr OpType = 325 - OpStructEndFloat64Ptr OpType = 326 - OpStructEndOmitEmptyFloat64Ptr OpType = 327 - OpStructFieldBoolPtr OpType = 328 - OpStructFieldOmitEmptyBoolPtr OpType = 329 - OpStructEndBoolPtr OpType = 330 - OpStructEndOmitEmptyBoolPtr OpType = 331 - OpStructFieldStringPtr OpType = 332 - OpStructFieldOmitEmptyStringPtr OpType = 333 - OpStructEndStringPtr OpType = 334 - OpStructEndOmitEmptyStringPtr OpType = 335 - OpStructFieldBytesPtr OpType = 336 - OpStructFieldOmitEmptyBytesPtr OpType = 337 - OpStructEndBytesPtr OpType = 338 - OpStructEndOmitEmptyBytesPtr OpType = 339 - OpStructFieldNumberPtr OpType = 340 - OpStructFieldOmitEmptyNumberPtr OpType = 341 - OpStructEndNumberPtr OpType = 342 - OpStructEndOmitEmptyNumberPtr OpType = 343 - OpStructFieldArrayPtr OpType = 344 - OpStructFieldOmitEmptyArrayPtr OpType = 345 - OpStructEndArrayPtr OpType = 346 - OpStructEndOmitEmptyArrayPtr OpType = 347 - OpStructFieldMapPtr OpType = 348 - OpStructFieldOmitEmptyMapPtr OpType = 349 - OpStructEndMapPtr OpType = 350 - OpStructEndOmitEmptyMapPtr OpType = 351 - OpStructFieldSlicePtr OpType = 352 - OpStructFieldOmitEmptySlicePtr OpType = 353 - OpStructEndSlicePtr OpType = 354 - OpStructEndOmitEmptySlicePtr OpType = 355 - OpStructFieldMarshalJSONPtr OpType = 356 - OpStructFieldOmitEmptyMarshalJSONPtr OpType = 357 - OpStructEndMarshalJSONPtr OpType = 358 - OpStructEndOmitEmptyMarshalJSONPtr OpType = 359 - OpStructFieldMarshalTextPtr OpType = 360 - OpStructFieldOmitEmptyMarshalTextPtr OpType = 361 - OpStructEndMarshalTextPtr OpType = 362 - OpStructEndOmitEmptyMarshalTextPtr OpType = 363 - OpStructFieldInterfacePtr OpType = 364 - OpStructFieldOmitEmptyInterfacePtr OpType = 365 - OpStructEndInterfacePtr OpType = 366 - OpStructEndOmitEmptyInterfacePtr OpType = 367 - OpStructFieldIntPtrString OpType = 368 - OpStructFieldOmitEmptyIntPtrString OpType = 369 - OpStructEndIntPtrString OpType = 370 - OpStructEndOmitEmptyIntPtrString OpType = 371 - OpStructFieldUintPtrString OpType = 372 - OpStructFieldOmitEmptyUintPtrString OpType = 373 - OpStructEndUintPtrString OpType = 374 - OpStructEndOmitEmptyUintPtrString OpType = 375 - OpStructFieldFloat32PtrString OpType = 376 - OpStructFieldOmitEmptyFloat32PtrString OpType = 377 - OpStructEndFloat32PtrString OpType = 378 - OpStructEndOmitEmptyFloat32PtrString OpType = 379 - OpStructFieldFloat64PtrString OpType = 380 - OpStructFieldOmitEmptyFloat64PtrString OpType = 381 - OpStructEndFloat64PtrString OpType = 382 - OpStructEndOmitEmptyFloat64PtrString OpType = 383 - OpStructFieldBoolPtrString OpType = 384 - OpStructFieldOmitEmptyBoolPtrString OpType = 385 - OpStructEndBoolPtrString OpType = 386 - OpStructEndOmitEmptyBoolPtrString OpType = 387 - OpStructFieldStringPtrString OpType = 388 - OpStructFieldOmitEmptyStringPtrString OpType = 389 - OpStructEndStringPtrString OpType = 390 - OpStructEndOmitEmptyStringPtrString OpType = 391 - OpStructFieldNumberPtrString OpType = 392 - OpStructFieldOmitEmptyNumberPtrString OpType = 393 - OpStructEndNumberPtrString OpType = 394 - OpStructEndOmitEmptyNumberPtrString OpType = 395 - OpStructField OpType = 396 - OpStructFieldOmitEmpty OpType = 397 - OpStructEnd OpType = 398 - OpStructEndOmitEmpty OpType = 399 -) - -func (t OpType) String() string { - if int(t) >= 400 { - return "" - } - return opTypeStrings[int(t)] -} - -func (t OpType) CodeType() CodeType { - if strings.Contains(t.String(), "Struct") { - if strings.Contains(t.String(), "End") { - return CodeStructEnd - } - return CodeStructField - } - switch t { - case OpArray, OpArrayPtr: - return CodeArrayHead - case OpArrayElem: - return CodeArrayElem - case OpSlice, OpSlicePtr: - return CodeSliceHead - case OpSliceElem: - return CodeSliceElem - case OpMap, OpMapPtr: - return CodeMapHead - case OpMapKey: - return CodeMapKey - case OpMapValue: - return CodeMapValue - case OpMapEnd: - return CodeMapEnd - } - - return CodeOp -} - -func (t OpType) HeadToPtrHead() OpType { - if strings.Index(t.String(), "PtrHead") > 0 { - return t - } - - idx := strings.Index(t.String(), "Head") - if idx == -1 { - return t - } - suffix := "PtrHead" + t.String()[idx+len("Head"):] - - const toPtrOffset = 2 - if strings.Contains(OpType(int(t)+toPtrOffset).String(), suffix) { - return OpType(int(t) + toPtrOffset) - } - return t -} - -func (t OpType) HeadToOmitEmptyHead() OpType { - const toOmitEmptyOffset = 1 - if strings.Contains(OpType(int(t)+toOmitEmptyOffset).String(), "OmitEmpty") { - return OpType(int(t) + toOmitEmptyOffset) - } - - return t -} - -func (t OpType) PtrHeadToHead() OpType { - idx := strings.Index(t.String(), "PtrHead") - if idx == -1 { - return t - } - suffix := t.String()[idx+len("Ptr"):] - - const toPtrOffset = 2 - if strings.Contains(OpType(int(t)-toPtrOffset).String(), suffix) { - return OpType(int(t) - toPtrOffset) - } - return t -} - -func (t OpType) FieldToEnd() OpType { - idx := strings.Index(t.String(), "Field") - if idx == -1 { - return t - } - suffix := t.String()[idx+len("Field"):] - if suffix == "" || suffix == "OmitEmpty" { - return t - } - const toEndOffset = 2 - if strings.Contains(OpType(int(t)+toEndOffset).String(), "End"+suffix) { - return OpType(int(t) + toEndOffset) - } - return t -} - -func (t OpType) FieldToOmitEmptyField() OpType { - const toOmitEmptyOffset = 1 - if strings.Contains(OpType(int(t)+toOmitEmptyOffset).String(), "OmitEmpty") { - return OpType(int(t) + toOmitEmptyOffset) - } - return t -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/query.go b/vendor/github.com/goccy/go-json/internal/encoder/query.go deleted file mode 100644 index 1e1850cc153..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/query.go +++ /dev/null @@ -1,135 +0,0 @@ -package encoder - -import ( - "context" - "fmt" - "reflect" -) - -var ( - Marshal func(interface{}) ([]byte, error) - Unmarshal func([]byte, interface{}) error -) - -type FieldQuery struct { - Name string - Fields []*FieldQuery - hash string -} - -func (q *FieldQuery) Hash() string { - if q.hash != "" { - return q.hash - } - b, _ := Marshal(q) - q.hash = string(b) - return q.hash -} - -func (q *FieldQuery) MarshalJSON() ([]byte, error) { - if q.Name != "" { - if len(q.Fields) > 0 { - return Marshal(map[string][]*FieldQuery{q.Name: q.Fields}) - } - return Marshal(q.Name) - } - return Marshal(q.Fields) -} - -func (q *FieldQuery) QueryString() (FieldQueryString, error) { - b, err := Marshal(q) - if err != nil { - return "", err - } - return FieldQueryString(b), nil -} - -type FieldQueryString string - -func (s FieldQueryString) Build() (*FieldQuery, error) { - var query interface{} - if err := Unmarshal([]byte(s), &query); err != nil { - return nil, err - } - return s.build(reflect.ValueOf(query)) -} - -func (s FieldQueryString) build(v reflect.Value) (*FieldQuery, error) { - switch v.Type().Kind() { - case reflect.String: - return s.buildString(v) - case reflect.Map: - return s.buildMap(v) - case reflect.Slice: - return s.buildSlice(v) - case reflect.Interface: - return s.build(reflect.ValueOf(v.Interface())) - } - return nil, fmt.Errorf("failed to build field query") -} - -func (s FieldQueryString) buildString(v reflect.Value) (*FieldQuery, error) { - b := []byte(v.String()) - switch b[0] { - case '[', '{': - var query interface{} - if err := Unmarshal(b, &query); err != nil { - return nil, err - } - if str, ok := query.(string); ok { - return &FieldQuery{Name: str}, nil - } - return s.build(reflect.ValueOf(query)) - } - return &FieldQuery{Name: string(b)}, nil -} - -func (s FieldQueryString) buildSlice(v reflect.Value) (*FieldQuery, error) { - fields := make([]*FieldQuery, 0, v.Len()) - for i := 0; i < v.Len(); i++ { - def, err := s.build(v.Index(i)) - if err != nil { - return nil, err - } - fields = append(fields, def) - } - return &FieldQuery{Fields: fields}, nil -} - -func (s FieldQueryString) buildMap(v reflect.Value) (*FieldQuery, error) { - keys := v.MapKeys() - if len(keys) != 1 { - return nil, fmt.Errorf("failed to build field query object") - } - key := keys[0] - if key.Type().Kind() != reflect.String { - return nil, fmt.Errorf("failed to build field query. invalid object key type") - } - name := key.String() - def, err := s.build(v.MapIndex(key)) - if err != nil { - return nil, err - } - return &FieldQuery{ - Name: name, - Fields: def.Fields, - }, nil -} - -type queryKey struct{} - -func FieldQueryFromContext(ctx context.Context) *FieldQuery { - query := ctx.Value(queryKey{}) - if query == nil { - return nil - } - q, ok := query.(*FieldQuery) - if !ok { - return nil - } - return q -} - -func SetFieldQueryToContext(ctx context.Context, query *FieldQuery) context.Context { - return context.WithValue(ctx, queryKey{}, query) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/string.go b/vendor/github.com/goccy/go-json/internal/encoder/string.go deleted file mode 100644 index 4abb84165e9..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/string.go +++ /dev/null @@ -1,483 +0,0 @@ -// This files's string processing codes are inspired by https://github.com/segmentio/encoding. -// The license notation is as follows. -// -// # MIT License -// -// Copyright (c) 2019 Segment.io, Inc. -// -// 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. -package encoder - -import ( - "math/bits" - "reflect" - "unsafe" -) - -const ( - lsb = 0x0101010101010101 - msb = 0x8080808080808080 -) - -var hex = "0123456789abcdef" - -//nolint:govet -func stringToUint64Slice(s string) []uint64 { - return *(*[]uint64)(unsafe.Pointer(&reflect.SliceHeader{ - Data: ((*reflect.StringHeader)(unsafe.Pointer(&s))).Data, - Len: len(s) / 8, - Cap: len(s) / 8, - })) -} - -func AppendString(ctx *RuntimeContext, buf []byte, s string) []byte { - if ctx.Option.Flag&HTMLEscapeOption != 0 { - if ctx.Option.Flag&NormalizeUTF8Option != 0 { - return appendNormalizedHTMLString(buf, s) - } - return appendHTMLString(buf, s) - } - if ctx.Option.Flag&NormalizeUTF8Option != 0 { - return appendNormalizedString(buf, s) - } - return appendString(buf, s) -} - -func appendNormalizedHTMLString(buf []byte, s string) []byte { - valLen := len(s) - if valLen == 0 { - return append(buf, `""`...) - } - buf = append(buf, '"') - var ( - i, j int - ) - if valLen >= 8 { - chunks := stringToUint64Slice(s) - for _, n := range chunks { - // combine masks before checking for the MSB of each byte. We include - // `n` in the mask to check whether any of the *input* byte MSBs were - // set (i.e. the byte was outside the ASCII range). - mask := n | (n - (lsb * 0x20)) | - ((n ^ (lsb * '"')) - lsb) | - ((n ^ (lsb * '\\')) - lsb) | - ((n ^ (lsb * '<')) - lsb) | - ((n ^ (lsb * '>')) - lsb) | - ((n ^ (lsb * '&')) - lsb) - if (mask & msb) != 0 { - j = bits.TrailingZeros64(mask&msb) / 8 - goto ESCAPE_END - } - } - for i := len(chunks) * 8; i < valLen; i++ { - if needEscapeHTMLNormalizeUTF8[s[i]] { - j = i - goto ESCAPE_END - } - } - // no found any escape characters. - return append(append(buf, s...), '"') - } -ESCAPE_END: - for j < valLen { - c := s[j] - - if !needEscapeHTMLNormalizeUTF8[c] { - // fast path: most of the time, printable ascii characters are used - j++ - continue - } - - switch c { - case '\\', '"': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', c) - i = j + 1 - j = j + 1 - continue - - case '\n': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'n') - i = j + 1 - j = j + 1 - continue - - case '\r': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'r') - i = j + 1 - j = j + 1 - continue - - case '\t': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 't') - i = j + 1 - j = j + 1 - continue - - case '<', '>', '&': - buf = append(buf, s[i:j]...) - buf = append(buf, `\u00`...) - buf = append(buf, hex[c>>4], hex[c&0xF]) - i = j + 1 - j = j + 1 - continue - - case 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0B, 0x0C, 0x0E, 0x0F, // 0x00-0x0F - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F: // 0x10-0x1F - buf = append(buf, s[i:j]...) - buf = append(buf, `\u00`...) - buf = append(buf, hex[c>>4], hex[c&0xF]) - i = j + 1 - j = j + 1 - continue - } - state, size := decodeRuneInString(s[j:]) - switch state { - case runeErrorState: - buf = append(buf, s[i:j]...) - buf = append(buf, `\ufffd`...) - i = j + 1 - j = j + 1 - continue - // U+2028 is LINE SEPARATOR. - // U+2029 is PARAGRAPH SEPARATOR. - // They are both technically valid characters in JSON strings, - // but don't work in JSONP, which has to be evaluated as JavaScript, - // and can lead to security holes there. It is valid JSON to - // escape them, so we do so unconditionally. - // See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion. - case lineSepState: - buf = append(buf, s[i:j]...) - buf = append(buf, `\u2028`...) - i = j + 3 - j = j + 3 - continue - case paragraphSepState: - buf = append(buf, s[i:j]...) - buf = append(buf, `\u2029`...) - i = j + 3 - j = j + 3 - continue - } - j += size - } - - return append(append(buf, s[i:]...), '"') -} - -func appendHTMLString(buf []byte, s string) []byte { - valLen := len(s) - if valLen == 0 { - return append(buf, `""`...) - } - buf = append(buf, '"') - var ( - i, j int - ) - if valLen >= 8 { - chunks := stringToUint64Slice(s) - for _, n := range chunks { - // combine masks before checking for the MSB of each byte. We include - // `n` in the mask to check whether any of the *input* byte MSBs were - // set (i.e. the byte was outside the ASCII range). - mask := n | (n - (lsb * 0x20)) | - ((n ^ (lsb * '"')) - lsb) | - ((n ^ (lsb * '\\')) - lsb) | - ((n ^ (lsb * '<')) - lsb) | - ((n ^ (lsb * '>')) - lsb) | - ((n ^ (lsb * '&')) - lsb) - if (mask & msb) != 0 { - j = bits.TrailingZeros64(mask&msb) / 8 - goto ESCAPE_END - } - } - for i := len(chunks) * 8; i < valLen; i++ { - if needEscapeHTML[s[i]] { - j = i - goto ESCAPE_END - } - } - // no found any escape characters. - return append(append(buf, s...), '"') - } -ESCAPE_END: - for j < valLen { - c := s[j] - - if !needEscapeHTML[c] { - // fast path: most of the time, printable ascii characters are used - j++ - continue - } - - switch c { - case '\\', '"': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', c) - i = j + 1 - j = j + 1 - continue - - case '\n': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'n') - i = j + 1 - j = j + 1 - continue - - case '\r': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'r') - i = j + 1 - j = j + 1 - continue - - case '\t': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 't') - i = j + 1 - j = j + 1 - continue - - case '<', '>', '&': - buf = append(buf, s[i:j]...) - buf = append(buf, `\u00`...) - buf = append(buf, hex[c>>4], hex[c&0xF]) - i = j + 1 - j = j + 1 - continue - - case 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0B, 0x0C, 0x0E, 0x0F, // 0x00-0x0F - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F: // 0x10-0x1F - buf = append(buf, s[i:j]...) - buf = append(buf, `\u00`...) - buf = append(buf, hex[c>>4], hex[c&0xF]) - i = j + 1 - j = j + 1 - continue - } - j++ - } - - return append(append(buf, s[i:]...), '"') -} - -func appendNormalizedString(buf []byte, s string) []byte { - valLen := len(s) - if valLen == 0 { - return append(buf, `""`...) - } - buf = append(buf, '"') - var ( - i, j int - ) - if valLen >= 8 { - chunks := stringToUint64Slice(s) - for _, n := range chunks { - // combine masks before checking for the MSB of each byte. We include - // `n` in the mask to check whether any of the *input* byte MSBs were - // set (i.e. the byte was outside the ASCII range). - mask := n | (n - (lsb * 0x20)) | - ((n ^ (lsb * '"')) - lsb) | - ((n ^ (lsb * '\\')) - lsb) - if (mask & msb) != 0 { - j = bits.TrailingZeros64(mask&msb) / 8 - goto ESCAPE_END - } - } - valLen := len(s) - for i := len(chunks) * 8; i < valLen; i++ { - if needEscapeNormalizeUTF8[s[i]] { - j = i - goto ESCAPE_END - } - } - return append(append(buf, s...), '"') - } -ESCAPE_END: - for j < valLen { - c := s[j] - - if !needEscapeNormalizeUTF8[c] { - // fast path: most of the time, printable ascii characters are used - j++ - continue - } - - switch c { - case '\\', '"': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', c) - i = j + 1 - j = j + 1 - continue - - case '\n': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'n') - i = j + 1 - j = j + 1 - continue - - case '\r': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'r') - i = j + 1 - j = j + 1 - continue - - case '\t': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 't') - i = j + 1 - j = j + 1 - continue - - case 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0B, 0x0C, 0x0E, 0x0F, // 0x00-0x0F - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F: // 0x10-0x1F - buf = append(buf, s[i:j]...) - buf = append(buf, `\u00`...) - buf = append(buf, hex[c>>4], hex[c&0xF]) - i = j + 1 - j = j + 1 - continue - } - - state, size := decodeRuneInString(s[j:]) - switch state { - case runeErrorState: - buf = append(buf, s[i:j]...) - buf = append(buf, `\ufffd`...) - i = j + 1 - j = j + 1 - continue - // U+2028 is LINE SEPARATOR. - // U+2029 is PARAGRAPH SEPARATOR. - // They are both technically valid characters in JSON strings, - // but don't work in JSONP, which has to be evaluated as JavaScript, - // and can lead to security holes there. It is valid JSON to - // escape them, so we do so unconditionally. - // See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion. - case lineSepState: - buf = append(buf, s[i:j]...) - buf = append(buf, `\u2028`...) - i = j + 3 - j = j + 3 - continue - case paragraphSepState: - buf = append(buf, s[i:j]...) - buf = append(buf, `\u2029`...) - i = j + 3 - j = j + 3 - continue - } - j += size - } - - return append(append(buf, s[i:]...), '"') -} - -func appendString(buf []byte, s string) []byte { - valLen := len(s) - if valLen == 0 { - return append(buf, `""`...) - } - buf = append(buf, '"') - var ( - i, j int - ) - if valLen >= 8 { - chunks := stringToUint64Slice(s) - for _, n := range chunks { - // combine masks before checking for the MSB of each byte. We include - // `n` in the mask to check whether any of the *input* byte MSBs were - // set (i.e. the byte was outside the ASCII range). - mask := n | (n - (lsb * 0x20)) | - ((n ^ (lsb * '"')) - lsb) | - ((n ^ (lsb * '\\')) - lsb) - if (mask & msb) != 0 { - j = bits.TrailingZeros64(mask&msb) / 8 - goto ESCAPE_END - } - } - valLen := len(s) - for i := len(chunks) * 8; i < valLen; i++ { - if needEscape[s[i]] { - j = i - goto ESCAPE_END - } - } - return append(append(buf, s...), '"') - } -ESCAPE_END: - for j < valLen { - c := s[j] - - if !needEscape[c] { - // fast path: most of the time, printable ascii characters are used - j++ - continue - } - - switch c { - case '\\', '"': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', c) - i = j + 1 - j = j + 1 - continue - - case '\n': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'n') - i = j + 1 - j = j + 1 - continue - - case '\r': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 'r') - i = j + 1 - j = j + 1 - continue - - case '\t': - buf = append(buf, s[i:j]...) - buf = append(buf, '\\', 't') - i = j + 1 - j = j + 1 - continue - - case 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0B, 0x0C, 0x0E, 0x0F, // 0x00-0x0F - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F: // 0x10-0x1F - buf = append(buf, s[i:j]...) - buf = append(buf, `\u00`...) - buf = append(buf, hex[c>>4], hex[c&0xF]) - i = j + 1 - j = j + 1 - continue - } - j++ - } - - return append(append(buf, s[i:]...), '"') -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/string_table.go b/vendor/github.com/goccy/go-json/internal/encoder/string_table.go deleted file mode 100644 index ebe42c92dfd..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/string_table.go +++ /dev/null @@ -1,415 +0,0 @@ -package encoder - -var needEscapeHTMLNormalizeUTF8 = [256]bool{ - '"': true, - '&': true, - '<': true, - '>': true, - '\\': true, - 0x00: true, - 0x01: true, - 0x02: true, - 0x03: true, - 0x04: true, - 0x05: true, - 0x06: true, - 0x07: true, - 0x08: true, - 0x09: true, - 0x0a: true, - 0x0b: true, - 0x0c: true, - 0x0d: true, - 0x0e: true, - 0x0f: true, - 0x10: true, - 0x11: true, - 0x12: true, - 0x13: true, - 0x14: true, - 0x15: true, - 0x16: true, - 0x17: true, - 0x18: true, - 0x19: true, - 0x1a: true, - 0x1b: true, - 0x1c: true, - 0x1d: true, - 0x1e: true, - 0x1f: true, - /* 0x20 - 0x7f */ - 0x80: true, - 0x81: true, - 0x82: true, - 0x83: true, - 0x84: true, - 0x85: true, - 0x86: true, - 0x87: true, - 0x88: true, - 0x89: true, - 0x8a: true, - 0x8b: true, - 0x8c: true, - 0x8d: true, - 0x8e: true, - 0x8f: true, - 0x90: true, - 0x91: true, - 0x92: true, - 0x93: true, - 0x94: true, - 0x95: true, - 0x96: true, - 0x97: true, - 0x98: true, - 0x99: true, - 0x9a: true, - 0x9b: true, - 0x9c: true, - 0x9d: true, - 0x9e: true, - 0x9f: true, - 0xa0: true, - 0xa1: true, - 0xa2: true, - 0xa3: true, - 0xa4: true, - 0xa5: true, - 0xa6: true, - 0xa7: true, - 0xa8: true, - 0xa9: true, - 0xaa: true, - 0xab: true, - 0xac: true, - 0xad: true, - 0xae: true, - 0xaf: true, - 0xb0: true, - 0xb1: true, - 0xb2: true, - 0xb3: true, - 0xb4: true, - 0xb5: true, - 0xb6: true, - 0xb7: true, - 0xb8: true, - 0xb9: true, - 0xba: true, - 0xbb: true, - 0xbc: true, - 0xbd: true, - 0xbe: true, - 0xbf: true, - 0xc0: true, - 0xc1: true, - 0xc2: true, - 0xc3: true, - 0xc4: true, - 0xc5: true, - 0xc6: true, - 0xc7: true, - 0xc8: true, - 0xc9: true, - 0xca: true, - 0xcb: true, - 0xcc: true, - 0xcd: true, - 0xce: true, - 0xcf: true, - 0xd0: true, - 0xd1: true, - 0xd2: true, - 0xd3: true, - 0xd4: true, - 0xd5: true, - 0xd6: true, - 0xd7: true, - 0xd8: true, - 0xd9: true, - 0xda: true, - 0xdb: true, - 0xdc: true, - 0xdd: true, - 0xde: true, - 0xdf: true, - 0xe0: true, - 0xe1: true, - 0xe2: true, - 0xe3: true, - 0xe4: true, - 0xe5: true, - 0xe6: true, - 0xe7: true, - 0xe8: true, - 0xe9: true, - 0xea: true, - 0xeb: true, - 0xec: true, - 0xed: true, - 0xee: true, - 0xef: true, - 0xf0: true, - 0xf1: true, - 0xf2: true, - 0xf3: true, - 0xf4: true, - 0xf5: true, - 0xf6: true, - 0xf7: true, - 0xf8: true, - 0xf9: true, - 0xfa: true, - 0xfb: true, - 0xfc: true, - 0xfd: true, - 0xfe: true, - 0xff: true, -} - -var needEscapeNormalizeUTF8 = [256]bool{ - '"': true, - '\\': true, - 0x00: true, - 0x01: true, - 0x02: true, - 0x03: true, - 0x04: true, - 0x05: true, - 0x06: true, - 0x07: true, - 0x08: true, - 0x09: true, - 0x0a: true, - 0x0b: true, - 0x0c: true, - 0x0d: true, - 0x0e: true, - 0x0f: true, - 0x10: true, - 0x11: true, - 0x12: true, - 0x13: true, - 0x14: true, - 0x15: true, - 0x16: true, - 0x17: true, - 0x18: true, - 0x19: true, - 0x1a: true, - 0x1b: true, - 0x1c: true, - 0x1d: true, - 0x1e: true, - 0x1f: true, - /* 0x20 - 0x7f */ - 0x80: true, - 0x81: true, - 0x82: true, - 0x83: true, - 0x84: true, - 0x85: true, - 0x86: true, - 0x87: true, - 0x88: true, - 0x89: true, - 0x8a: true, - 0x8b: true, - 0x8c: true, - 0x8d: true, - 0x8e: true, - 0x8f: true, - 0x90: true, - 0x91: true, - 0x92: true, - 0x93: true, - 0x94: true, - 0x95: true, - 0x96: true, - 0x97: true, - 0x98: true, - 0x99: true, - 0x9a: true, - 0x9b: true, - 0x9c: true, - 0x9d: true, - 0x9e: true, - 0x9f: true, - 0xa0: true, - 0xa1: true, - 0xa2: true, - 0xa3: true, - 0xa4: true, - 0xa5: true, - 0xa6: true, - 0xa7: true, - 0xa8: true, - 0xa9: true, - 0xaa: true, - 0xab: true, - 0xac: true, - 0xad: true, - 0xae: true, - 0xaf: true, - 0xb0: true, - 0xb1: true, - 0xb2: true, - 0xb3: true, - 0xb4: true, - 0xb5: true, - 0xb6: true, - 0xb7: true, - 0xb8: true, - 0xb9: true, - 0xba: true, - 0xbb: true, - 0xbc: true, - 0xbd: true, - 0xbe: true, - 0xbf: true, - 0xc0: true, - 0xc1: true, - 0xc2: true, - 0xc3: true, - 0xc4: true, - 0xc5: true, - 0xc6: true, - 0xc7: true, - 0xc8: true, - 0xc9: true, - 0xca: true, - 0xcb: true, - 0xcc: true, - 0xcd: true, - 0xce: true, - 0xcf: true, - 0xd0: true, - 0xd1: true, - 0xd2: true, - 0xd3: true, - 0xd4: true, - 0xd5: true, - 0xd6: true, - 0xd7: true, - 0xd8: true, - 0xd9: true, - 0xda: true, - 0xdb: true, - 0xdc: true, - 0xdd: true, - 0xde: true, - 0xdf: true, - 0xe0: true, - 0xe1: true, - 0xe2: true, - 0xe3: true, - 0xe4: true, - 0xe5: true, - 0xe6: true, - 0xe7: true, - 0xe8: true, - 0xe9: true, - 0xea: true, - 0xeb: true, - 0xec: true, - 0xed: true, - 0xee: true, - 0xef: true, - 0xf0: true, - 0xf1: true, - 0xf2: true, - 0xf3: true, - 0xf4: true, - 0xf5: true, - 0xf6: true, - 0xf7: true, - 0xf8: true, - 0xf9: true, - 0xfa: true, - 0xfb: true, - 0xfc: true, - 0xfd: true, - 0xfe: true, - 0xff: true, -} - -var needEscapeHTML = [256]bool{ - '"': true, - '&': true, - '<': true, - '>': true, - '\\': true, - 0x00: true, - 0x01: true, - 0x02: true, - 0x03: true, - 0x04: true, - 0x05: true, - 0x06: true, - 0x07: true, - 0x08: true, - 0x09: true, - 0x0a: true, - 0x0b: true, - 0x0c: true, - 0x0d: true, - 0x0e: true, - 0x0f: true, - 0x10: true, - 0x11: true, - 0x12: true, - 0x13: true, - 0x14: true, - 0x15: true, - 0x16: true, - 0x17: true, - 0x18: true, - 0x19: true, - 0x1a: true, - 0x1b: true, - 0x1c: true, - 0x1d: true, - 0x1e: true, - 0x1f: true, - /* 0x20 - 0xff */ -} - -var needEscape = [256]bool{ - '"': true, - '\\': true, - 0x00: true, - 0x01: true, - 0x02: true, - 0x03: true, - 0x04: true, - 0x05: true, - 0x06: true, - 0x07: true, - 0x08: true, - 0x09: true, - 0x0a: true, - 0x0b: true, - 0x0c: true, - 0x0d: true, - 0x0e: true, - 0x0f: true, - 0x10: true, - 0x11: true, - 0x12: true, - 0x13: true, - 0x14: true, - 0x15: true, - 0x16: true, - 0x17: true, - 0x18: true, - 0x19: true, - 0x1a: true, - 0x1b: true, - 0x1c: true, - 0x1d: true, - 0x1e: true, - 0x1f: true, - /* 0x20 - 0xff */ -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm/debug_vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm/debug_vm.go deleted file mode 100644 index 82b6dd47f86..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm/debug_vm.go +++ /dev/null @@ -1,41 +0,0 @@ -package vm - -import ( - "fmt" - "io" - - "github.com/goccy/go-json/internal/encoder" -) - -func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - defer func() { - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - if wc := ctx.Option.DebugDOTOut; wc != nil { - _, _ = io.WriteString(wc, code.DumpDOT()) - wc.Close() - ctx.Option.DebugDOTOut = nil - } - - if err := recover(); err != nil { - w := ctx.Option.DebugOut - fmt.Fprintln(w, "=============[DEBUG]===============") - fmt.Fprintln(w, "* [TYPE]") - fmt.Fprintln(w, codeSet.Type) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [ALL OPCODE]") - fmt.Fprintln(w, code.Dump()) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [CONTEXT]") - fmt.Fprintf(w, "%+v\n", ctx) - fmt.Fprintln(w, "===================================") - panic(err) - } - }() - - return Run(ctx, b, codeSet) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm/hack.go b/vendor/github.com/goccy/go-json/internal/encoder/vm/hack.go deleted file mode 100644 index 65252b4a5cd..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm/hack.go +++ /dev/null @@ -1,9 +0,0 @@ -package vm - -import ( - // HACK: compile order - // `vm`, `vm_indent`, `vm_color`, `vm_color_indent` packages uses a lot of memory to compile, - // so forcibly make dependencies and avoid compiling in concurrent. - // dependency order: vm => vm_indent => vm_color => vm_color_indent - _ "github.com/goccy/go-json/internal/encoder/vm_indent" -) diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm/util.go b/vendor/github.com/goccy/go-json/internal/encoder/vm/util.go deleted file mode 100644 index 86291d7bb37..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm/util.go +++ /dev/null @@ -1,207 +0,0 @@ -package vm - -import ( - "encoding/json" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -const uintptrSize = 4 << (^uintptr(0) >> 63) - -var ( - appendInt = encoder.AppendInt - appendUint = encoder.AppendUint - appendFloat32 = encoder.AppendFloat32 - appendFloat64 = encoder.AppendFloat64 - appendString = encoder.AppendString - appendByteSlice = encoder.AppendByteSlice - appendNumber = encoder.AppendNumber - errUnsupportedValue = encoder.ErrUnsupportedValue - errUnsupportedFloat = encoder.ErrUnsupportedFloat - mapiterinit = encoder.MapIterInit - mapiterkey = encoder.MapIterKey - mapitervalue = encoder.MapIterValue - mapiternext = encoder.MapIterNext - maplen = encoder.MapLen -) - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -type nonEmptyInterface struct { - itab *struct { - ityp *runtime.Type // static interface type - typ *runtime.Type // dynamic concrete type - // unused fields... - } - ptr unsafe.Pointer -} - -func errUnimplementedOp(op encoder.OpType) error { - return fmt.Errorf("encoder: opcode %s has not been implemented", op) -} - -func load(base uintptr, idx uint32) uintptr { - addr := base + uintptr(idx) - return **(**uintptr)(unsafe.Pointer(&addr)) -} - -func store(base uintptr, idx uint32, p uintptr) { - addr := base + uintptr(idx) - **(**uintptr)(unsafe.Pointer(&addr)) = p -} - -func loadNPtr(base uintptr, idx uint32, ptrNum uint8) uintptr { - addr := base + uintptr(idx) - p := **(**uintptr)(unsafe.Pointer(&addr)) - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUint64(p uintptr, bitSize uint8) uint64 { - switch bitSize { - case 8: - return (uint64)(**(**uint8)(unsafe.Pointer(&p))) - case 16: - return (uint64)(**(**uint16)(unsafe.Pointer(&p))) - case 32: - return (uint64)(**(**uint32)(unsafe.Pointer(&p))) - case 64: - return **(**uint64)(unsafe.Pointer(&p)) - } - return 0 -} -func ptrToFloat32(p uintptr) float32 { return **(**float32)(unsafe.Pointer(&p)) } -func ptrToFloat64(p uintptr) float64 { return **(**float64)(unsafe.Pointer(&p)) } -func ptrToBool(p uintptr) bool { return **(**bool)(unsafe.Pointer(&p)) } -func ptrToBytes(p uintptr) []byte { return **(**[]byte)(unsafe.Pointer(&p)) } -func ptrToNumber(p uintptr) json.Number { return **(**json.Number)(unsafe.Pointer(&p)) } -func ptrToString(p uintptr) string { return **(**string)(unsafe.Pointer(&p)) } -func ptrToSlice(p uintptr) *runtime.SliceHeader { return *(**runtime.SliceHeader)(unsafe.Pointer(&p)) } -func ptrToPtr(p uintptr) uintptr { - return uintptr(**(**unsafe.Pointer)(unsafe.Pointer(&p))) -} -func ptrToNPtr(p uintptr, ptrNum uint8) uintptr { - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUnsafePtr(p uintptr) unsafe.Pointer { - return *(*unsafe.Pointer)(unsafe.Pointer(&p)) -} -func ptrToInterface(code *encoder.Opcode, p uintptr) interface{} { - return *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: code.Type, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&p)), - })) -} - -func appendBool(_ *encoder.RuntimeContext, b []byte, v bool) []byte { - if v { - return append(b, "true"...) - } - return append(b, "false"...) -} - -func appendNull(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, "null"...) -} - -func appendComma(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, ',') -} - -func appendNullComma(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, "null,"...) -} - -func appendColon(_ *encoder.RuntimeContext, b []byte) []byte { - last := len(b) - 1 - b[last] = ':' - return b -} - -func appendMapKeyValue(_ *encoder.RuntimeContext, _ *encoder.Opcode, b, key, value []byte) []byte { - b = append(b, key...) - b[len(b)-1] = ':' - return append(b, value...) -} - -func appendMapEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - b[len(b)-1] = '}' - b = append(b, ',') - return b -} - -func appendMarshalJSON(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - return encoder.AppendMarshalJSON(ctx, code, b, v) -} - -func appendMarshalText(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - return encoder.AppendMarshalText(ctx, code, b, v) -} - -func appendArrayHead(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - return append(b, '[') -} - -func appendArrayEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - b[last] = ']' - return append(b, ',') -} - -func appendEmptyArray(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '[', ']', ',') -} - -func appendEmptyObject(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{', '}', ',') -} - -func appendObjectEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - b[last] = '}' - return append(b, ',') -} - -func appendStructHead(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{') -} - -func appendStructKey(_ *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - return append(b, code.Key...) -} - -func appendStructEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - return append(b, '}', ',') -} - -func appendStructEndSkipLast(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - if b[last] == ',' { - b[last] = '}' - return appendComma(ctx, b) - } - return appendStructEnd(ctx, code, b) -} - -func restoreIndent(_ *encoder.RuntimeContext, _ *encoder.Opcode, _ uintptr) {} -func storeIndent(_ uintptr, _ *encoder.Opcode, _ uintptr) {} -func appendMapKeyIndent(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { return b } -func appendArrayElemIndent(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { return b } diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm/vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm/vm.go deleted file mode 100644 index 645d20f9fbe..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm/vm.go +++ /dev/null @@ -1,4859 +0,0 @@ -// Code generated by internal/cmd/generator. DO NOT EDIT! -package vm - -import ( - "math" - "reflect" - "sort" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - recursiveLevel := 0 - ptrOffset := uintptr(0) - ctxptr := ctx.Ptr() - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - for { - switch code.Op { - default: - return nil, errUnimplementedOp(code.Op) - case encoder.OpPtr: - p := load(ctxptr, code.Idx) - code = code.Next - store(ctxptr, code.Idx, ptrToPtr(p)) - case encoder.OpIntPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInt: - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpUint: - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpIntString: - b = append(b, '"') - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintString: - b = append(b, '"') - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat32Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat32: - b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat64Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat64: - v := ptrToFloat64(load(ctxptr, code.Idx)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStringPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpString: - b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBoolPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBool: - b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBytesPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBytes: - b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpNumberPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpNumber: - bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpInterfacePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInterface: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if p == seen { - return nil, errUnsupportedValue(code, p) - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, p) - var ( - typ *runtime.Type - ifacePtr unsafe.Pointer - ) - up := ptrToUnsafePtr(p) - if code.Flags&encoder.NonEmptyInterfaceFlags != 0 { - iface := (*nonEmptyInterface)(up) - ifacePtr = iface.ptr - if iface.itab != nil { - typ = iface.itab.typ - } - } else { - iface := (*emptyInterface)(up) - ifacePtr = iface.ptr - typ = iface.typ - } - if ifacePtr == nil { - isDirectedNil := typ != nil && typ.Kind() == reflect.Struct && !runtime.IfaceIndir(typ) - if !isDirectedNil { - b = appendNullComma(ctx, b) - code = code.Next - break - } - } - ctx.KeepRefs = append(ctx.KeepRefs, up) - ifaceCodeSet, err := encoder.CompileToGetCodeSet(ctx, uintptr(unsafe.Pointer(typ))) - if err != nil { - return nil, err - } - - totalLength := uintptr(code.Length) + 3 - nextTotalLength := uintptr(ifaceCodeSet.CodeLength) + 3 - - var c *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - c = ifaceCodeSet.InterfaceEscapeKeyCode - } else { - c = ifaceCodeSet.InterfaceNoescapeKeyCode - } - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += totalLength * uintptrSize - oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - - newLen := offsetNum + totalLength + nextTotalLength - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - end := ifaceCodeSet.EndCode - store(ctxptr, c.Idx, uintptr(ifacePtr)) - store(ctxptr, end.Idx, oldOffset) - store(ctxptr, end.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, end, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpInterfaceEnd: - recursiveLevel-- - - // restore ctxptr - offset := load(ctxptr, code.Idx) - restoreIndent(ctx, code, ctxptr) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - b = append(b, `""`...) - b = appendComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpSlicePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpSlice: - p := load(ctxptr, code.Idx) - slice := ptrToSlice(p) - if p == 0 || slice.Data == nil { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.ElemIdx, 0) - store(ctxptr, code.Length, uintptr(slice.Len)) - store(ctxptr, code.Idx, uintptr(slice.Data)) - if slice.Len > 0 { - b = appendArrayHead(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, uintptr(slice.Data)) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpSliceElem: - idx := load(ctxptr, code.ElemIdx) - length := load(ctxptr, code.Length) - idx++ - if idx < length { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - data := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, data+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpArrayPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpArray: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - if code.Length > 0 { - b = appendArrayHead(ctx, code, b) - store(ctxptr, code.ElemIdx, 0) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpArrayElem: - idx := load(ctxptr, code.ElemIdx) - idx++ - if idx < uintptr(code.Length) { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - p := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, p+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpMapPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpMap: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - uptr := ptrToUnsafePtr(p) - mlen := maplen(uptr) - if mlen <= 0 { - b = appendEmptyObject(ctx, b) - code = code.End.Next - break - } - b = appendStructHead(ctx, b) - unorderedMap := (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 - mapCtx := encoder.NewMapContext(mlen, unorderedMap) - mapiterinit(code.Type, uptr, &mapCtx.Iter) - store(ctxptr, code.Idx, uintptr(unsafe.Pointer(mapCtx))) - ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(mapCtx)) - if unorderedMap { - b = appendMapKeyIndent(ctx, code.Next, b) - } else { - mapCtx.Start = len(b) - mapCtx.First = len(b) - } - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - case encoder.OpMapKey: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - idx := mapCtx.Idx - idx++ - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - if idx < mapCtx.Len { - b = appendMapKeyIndent(ctx, code, b) - mapCtx.Idx = int(idx) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - b = appendObjectEnd(ctx, code, b) - encoder.ReleaseMapContext(mapCtx) - code = code.End.Next - } - } else { - mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] - if idx < mapCtx.Len { - mapCtx.Idx = int(idx) - mapCtx.Start = len(b) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - code = code.End - } - } - case encoder.OpMapValue: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - b = appendColon(ctx, b) - } else { - mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] - mapCtx.Start = len(b) - } - value := mapitervalue(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(value)) - mapiternext(&mapCtx.Iter) - code = code.Next - case encoder.OpMapEnd: - // this operation only used by sorted map. - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - sort.Sort(mapCtx.Slice) - buf := mapCtx.Buf - for _, item := range mapCtx.Slice.Items { - buf = appendMapKeyValue(ctx, code, buf, item.Key, item.Value) - } - buf = appendMapEnd(ctx, code, buf) - b = b[:mapCtx.First] - b = append(b, buf...) - mapCtx.Buf = buf - encoder.ReleaseMapContext(mapCtx) - code = code.Next - case encoder.OpRecursivePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpRecursive: - ptr := load(ctxptr, code.Idx) - if ptr != 0 { - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if ptr == seen { - return nil, errUnsupportedValue(code, ptr) - } - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, ptr) - c := code.Jmp.Code - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += code.Jmp.CurLen * uintptrSize - oldBaseIndent := ctx.BaseIndent - indentDiffFromTop := c.Indent - 1 - ctx.BaseIndent += code.Indent - indentDiffFromTop - - newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - store(ctxptr, c.Idx, ptr) - store(ctxptr, c.End.Next.Idx, oldOffset) - store(ctxptr, c.End.Next.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, c.End.Next, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpRecursiveEnd: - recursiveLevel-- - - // restore ctxptr - restoreIndent(ctx, code, ctxptr) - offset := load(ctxptr, code.Idx) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpStructPtrHead: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHead: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if len(code.Key) > 0 { - if (code.Flags&encoder.IsTaggedKeyFlags) != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - } - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - u64 := ptrToUint64(p, code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - } - case encoder.OpStructPtrHeadNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructPtrHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadArray, encoder.OpStructHeadSlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyArray: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyArray: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptySlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptySlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadArrayPtr, encoder.OpStructPtrHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadArrayPtr, encoder.OpStructHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyArrayPtr, encoder.OpStructPtrHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyArrayPtr, encoder.OpStructHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - if maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalJSON { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { - p = ptrToPtr(p) - } - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructField: - if code.Flags&encoder.IsTaggedKeyFlags != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - p := load(ctxptr, code.Idx) + uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmpty: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringString: - p := load(ctxptr, code.Idx) - s := ptrToString(p + uintptr(code.Offset)) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldMarshalJSON: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalJSONPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldMarshalText: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalTextPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldArrayPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArrayPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldSlice: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlice: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldSlicePtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldMap: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMap: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 || maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldMapPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldStruct: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyStruct: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructEnd: - b = appendStructEndSkipLast(ctx, code, b) - code = code.Next - case encoder.OpStructEndInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendStructEnd(ctx, code, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - s := ptrToString(p + uintptr(code.Offset)) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytesPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - code = code.Next - case encoder.OpStructEndOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpEnd: - goto END - } - } -END: - return b, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/debug_vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color/debug_vm.go deleted file mode 100644 index 925f61ed8e6..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/debug_vm.go +++ /dev/null @@ -1,35 +0,0 @@ -package vm_color - -import ( - "fmt" - - "github.com/goccy/go-json/internal/encoder" -) - -func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - defer func() { - if err := recover(); err != nil { - w := ctx.Option.DebugOut - fmt.Fprintln(w, "=============[DEBUG]===============") - fmt.Fprintln(w, "* [TYPE]") - fmt.Fprintln(w, codeSet.Type) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [ALL OPCODE]") - fmt.Fprintln(w, code.Dump()) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [CONTEXT]") - fmt.Fprintf(w, "%+v\n", ctx) - fmt.Fprintln(w, "===================================") - panic(err) - } - }() - - return Run(ctx, b, codeSet) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/hack.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color/hack.go deleted file mode 100644 index 12ec56c5bbd..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/hack.go +++ /dev/null @@ -1,9 +0,0 @@ -package vm_color - -import ( - // HACK: compile order - // `vm`, `vm_indent`, `vm_color`, `vm_color_indent` packages uses a lot of memory to compile, - // so forcibly make dependencies and avoid compiling in concurrent. - // dependency order: vm => vm_indent => vm_color => vm_color_indent - _ "github.com/goccy/go-json/internal/encoder/vm_color_indent" -) diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/util.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color/util.go deleted file mode 100644 index 33f29aee448..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/util.go +++ /dev/null @@ -1,274 +0,0 @@ -package vm_color - -import ( - "encoding/json" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -const uintptrSize = 4 << (^uintptr(0) >> 63) - -var ( - errUnsupportedValue = encoder.ErrUnsupportedValue - errUnsupportedFloat = encoder.ErrUnsupportedFloat - mapiterinit = encoder.MapIterInit - mapiterkey = encoder.MapIterKey - mapitervalue = encoder.MapIterValue - mapiternext = encoder.MapIterNext - maplen = encoder.MapLen -) - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -type nonEmptyInterface struct { - itab *struct { - ityp *runtime.Type // static interface type - typ *runtime.Type // dynamic concrete type - // unused fields... - } - ptr unsafe.Pointer -} - -func errUnimplementedOp(op encoder.OpType) error { - return fmt.Errorf("encoder: opcode %s has not been implemented", op) -} - -func load(base uintptr, idx uint32) uintptr { - addr := base + uintptr(idx) - return **(**uintptr)(unsafe.Pointer(&addr)) -} - -func store(base uintptr, idx uint32, p uintptr) { - addr := base + uintptr(idx) - **(**uintptr)(unsafe.Pointer(&addr)) = p -} - -func loadNPtr(base uintptr, idx uint32, ptrNum uint8) uintptr { - addr := base + uintptr(idx) - p := **(**uintptr)(unsafe.Pointer(&addr)) - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUint64(p uintptr, bitSize uint8) uint64 { - switch bitSize { - case 8: - return (uint64)(**(**uint8)(unsafe.Pointer(&p))) - case 16: - return (uint64)(**(**uint16)(unsafe.Pointer(&p))) - case 32: - return (uint64)(**(**uint32)(unsafe.Pointer(&p))) - case 64: - return **(**uint64)(unsafe.Pointer(&p)) - } - return 0 -} -func ptrToFloat32(p uintptr) float32 { return **(**float32)(unsafe.Pointer(&p)) } -func ptrToFloat64(p uintptr) float64 { return **(**float64)(unsafe.Pointer(&p)) } -func ptrToBool(p uintptr) bool { return **(**bool)(unsafe.Pointer(&p)) } -func ptrToBytes(p uintptr) []byte { return **(**[]byte)(unsafe.Pointer(&p)) } -func ptrToNumber(p uintptr) json.Number { return **(**json.Number)(unsafe.Pointer(&p)) } -func ptrToString(p uintptr) string { return **(**string)(unsafe.Pointer(&p)) } -func ptrToSlice(p uintptr) *runtime.SliceHeader { return *(**runtime.SliceHeader)(unsafe.Pointer(&p)) } -func ptrToPtr(p uintptr) uintptr { - return uintptr(**(**unsafe.Pointer)(unsafe.Pointer(&p))) -} -func ptrToNPtr(p uintptr, ptrNum uint8) uintptr { - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUnsafePtr(p uintptr) unsafe.Pointer { - return *(*unsafe.Pointer)(unsafe.Pointer(&p)) -} -func ptrToInterface(code *encoder.Opcode, p uintptr) interface{} { - return *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: code.Type, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&p)), - })) -} - -func appendInt(ctx *encoder.RuntimeContext, b []byte, p uintptr, code *encoder.Opcode) []byte { - format := ctx.Option.ColorScheme.Int - b = append(b, format.Header...) - b = encoder.AppendInt(ctx, b, p, code) - return append(b, format.Footer...) -} - -func appendUint(ctx *encoder.RuntimeContext, b []byte, p uintptr, code *encoder.Opcode) []byte { - format := ctx.Option.ColorScheme.Uint - b = append(b, format.Header...) - b = encoder.AppendUint(ctx, b, p, code) - return append(b, format.Footer...) -} - -func appendFloat32(ctx *encoder.RuntimeContext, b []byte, v float32) []byte { - format := ctx.Option.ColorScheme.Float - b = append(b, format.Header...) - b = encoder.AppendFloat32(ctx, b, v) - return append(b, format.Footer...) -} - -func appendFloat64(ctx *encoder.RuntimeContext, b []byte, v float64) []byte { - format := ctx.Option.ColorScheme.Float - b = append(b, format.Header...) - b = encoder.AppendFloat64(ctx, b, v) - return append(b, format.Footer...) -} - -func appendString(ctx *encoder.RuntimeContext, b []byte, v string) []byte { - format := ctx.Option.ColorScheme.String - b = append(b, format.Header...) - b = encoder.AppendString(ctx, b, v) - return append(b, format.Footer...) -} - -func appendByteSlice(ctx *encoder.RuntimeContext, b []byte, src []byte) []byte { - format := ctx.Option.ColorScheme.Binary - b = append(b, format.Header...) - b = encoder.AppendByteSlice(ctx, b, src) - return append(b, format.Footer...) -} - -func appendNumber(ctx *encoder.RuntimeContext, b []byte, n json.Number) ([]byte, error) { - format := ctx.Option.ColorScheme.Int - b = append(b, format.Header...) - bb, err := encoder.AppendNumber(ctx, b, n) - if err != nil { - return nil, err - } - return append(bb, format.Footer...), nil -} - -func appendBool(ctx *encoder.RuntimeContext, b []byte, v bool) []byte { - format := ctx.Option.ColorScheme.Bool - b = append(b, format.Header...) - if v { - b = append(b, "true"...) - } else { - b = append(b, "false"...) - } - return append(b, format.Footer...) -} - -func appendNull(ctx *encoder.RuntimeContext, b []byte) []byte { - format := ctx.Option.ColorScheme.Null - b = append(b, format.Header...) - b = append(b, "null"...) - return append(b, format.Footer...) -} - -func appendComma(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, ',') -} - -func appendNullComma(ctx *encoder.RuntimeContext, b []byte) []byte { - format := ctx.Option.ColorScheme.Null - b = append(b, format.Header...) - b = append(b, "null"...) - return append(append(b, format.Footer...), ',') -} - -func appendColon(_ *encoder.RuntimeContext, b []byte) []byte { - last := len(b) - 1 - b[last] = ':' - return b -} - -func appendMapKeyValue(_ *encoder.RuntimeContext, _ *encoder.Opcode, b, key, value []byte) []byte { - b = append(b, key[:len(key)-1]...) - b = append(b, ':') - return append(b, value...) -} - -func appendMapEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - b[last] = '}' - b = append(b, ',') - return b -} - -func appendMarshalJSON(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - return encoder.AppendMarshalJSON(ctx, code, b, v) -} - -func appendMarshalText(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - format := ctx.Option.ColorScheme.String - b = append(b, format.Header...) - bb, err := encoder.AppendMarshalText(ctx, code, b, v) - if err != nil { - return nil, err - } - return append(bb, format.Footer...), nil -} - -func appendArrayHead(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - return append(b, '[') -} - -func appendArrayEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - b[last] = ']' - return append(b, ',') -} - -func appendEmptyArray(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '[', ']', ',') -} - -func appendEmptyObject(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{', '}', ',') -} - -func appendObjectEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - b[last] = '}' - return append(b, ',') -} - -func appendStructHead(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{') -} - -func appendStructKey(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - format := ctx.Option.ColorScheme.ObjectKey - b = append(b, format.Header...) - b = append(b, code.Key[:len(code.Key)-1]...) - b = append(b, format.Footer...) - - return append(b, ':') -} - -func appendStructEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { - return append(b, '}', ',') -} - -func appendStructEndSkipLast(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - if b[last] == ',' { - b[last] = '}' - return appendComma(ctx, b) - } - return appendStructEnd(ctx, code, b) -} - -func restoreIndent(_ *encoder.RuntimeContext, _ *encoder.Opcode, _ uintptr) {} -func storeIndent(_ uintptr, _ *encoder.Opcode, _ uintptr) {} -func appendMapKeyIndent(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { return b } -func appendArrayElemIndent(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []byte { return b } diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color/vm.go deleted file mode 100644 index a63e83e5505..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color/vm.go +++ /dev/null @@ -1,4859 +0,0 @@ -// Code generated by internal/cmd/generator. DO NOT EDIT! -package vm_color - -import ( - "math" - "reflect" - "sort" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - recursiveLevel := 0 - ptrOffset := uintptr(0) - ctxptr := ctx.Ptr() - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - for { - switch code.Op { - default: - return nil, errUnimplementedOp(code.Op) - case encoder.OpPtr: - p := load(ctxptr, code.Idx) - code = code.Next - store(ctxptr, code.Idx, ptrToPtr(p)) - case encoder.OpIntPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInt: - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpUint: - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpIntString: - b = append(b, '"') - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintString: - b = append(b, '"') - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat32Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat32: - b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat64Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat64: - v := ptrToFloat64(load(ctxptr, code.Idx)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStringPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpString: - b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBoolPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBool: - b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBytesPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBytes: - b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpNumberPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpNumber: - bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpInterfacePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInterface: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if p == seen { - return nil, errUnsupportedValue(code, p) - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, p) - var ( - typ *runtime.Type - ifacePtr unsafe.Pointer - ) - up := ptrToUnsafePtr(p) - if code.Flags&encoder.NonEmptyInterfaceFlags != 0 { - iface := (*nonEmptyInterface)(up) - ifacePtr = iface.ptr - if iface.itab != nil { - typ = iface.itab.typ - } - } else { - iface := (*emptyInterface)(up) - ifacePtr = iface.ptr - typ = iface.typ - } - if ifacePtr == nil { - isDirectedNil := typ != nil && typ.Kind() == reflect.Struct && !runtime.IfaceIndir(typ) - if !isDirectedNil { - b = appendNullComma(ctx, b) - code = code.Next - break - } - } - ctx.KeepRefs = append(ctx.KeepRefs, up) - ifaceCodeSet, err := encoder.CompileToGetCodeSet(ctx, uintptr(unsafe.Pointer(typ))) - if err != nil { - return nil, err - } - - totalLength := uintptr(code.Length) + 3 - nextTotalLength := uintptr(ifaceCodeSet.CodeLength) + 3 - - var c *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - c = ifaceCodeSet.InterfaceEscapeKeyCode - } else { - c = ifaceCodeSet.InterfaceNoescapeKeyCode - } - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += totalLength * uintptrSize - oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - - newLen := offsetNum + totalLength + nextTotalLength - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - end := ifaceCodeSet.EndCode - store(ctxptr, c.Idx, uintptr(ifacePtr)) - store(ctxptr, end.Idx, oldOffset) - store(ctxptr, end.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, end, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpInterfaceEnd: - recursiveLevel-- - - // restore ctxptr - offset := load(ctxptr, code.Idx) - restoreIndent(ctx, code, ctxptr) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - b = append(b, `""`...) - b = appendComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpSlicePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpSlice: - p := load(ctxptr, code.Idx) - slice := ptrToSlice(p) - if p == 0 || slice.Data == nil { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.ElemIdx, 0) - store(ctxptr, code.Length, uintptr(slice.Len)) - store(ctxptr, code.Idx, uintptr(slice.Data)) - if slice.Len > 0 { - b = appendArrayHead(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, uintptr(slice.Data)) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpSliceElem: - idx := load(ctxptr, code.ElemIdx) - length := load(ctxptr, code.Length) - idx++ - if idx < length { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - data := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, data+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpArrayPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpArray: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - if code.Length > 0 { - b = appendArrayHead(ctx, code, b) - store(ctxptr, code.ElemIdx, 0) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpArrayElem: - idx := load(ctxptr, code.ElemIdx) - idx++ - if idx < uintptr(code.Length) { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - p := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, p+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpMapPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpMap: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - uptr := ptrToUnsafePtr(p) - mlen := maplen(uptr) - if mlen <= 0 { - b = appendEmptyObject(ctx, b) - code = code.End.Next - break - } - b = appendStructHead(ctx, b) - unorderedMap := (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 - mapCtx := encoder.NewMapContext(mlen, unorderedMap) - mapiterinit(code.Type, uptr, &mapCtx.Iter) - store(ctxptr, code.Idx, uintptr(unsafe.Pointer(mapCtx))) - ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(mapCtx)) - if unorderedMap { - b = appendMapKeyIndent(ctx, code.Next, b) - } else { - mapCtx.Start = len(b) - mapCtx.First = len(b) - } - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - case encoder.OpMapKey: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - idx := mapCtx.Idx - idx++ - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - if idx < mapCtx.Len { - b = appendMapKeyIndent(ctx, code, b) - mapCtx.Idx = int(idx) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - b = appendObjectEnd(ctx, code, b) - encoder.ReleaseMapContext(mapCtx) - code = code.End.Next - } - } else { - mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] - if idx < mapCtx.Len { - mapCtx.Idx = int(idx) - mapCtx.Start = len(b) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - code = code.End - } - } - case encoder.OpMapValue: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - b = appendColon(ctx, b) - } else { - mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] - mapCtx.Start = len(b) - } - value := mapitervalue(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(value)) - mapiternext(&mapCtx.Iter) - code = code.Next - case encoder.OpMapEnd: - // this operation only used by sorted map. - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - sort.Sort(mapCtx.Slice) - buf := mapCtx.Buf - for _, item := range mapCtx.Slice.Items { - buf = appendMapKeyValue(ctx, code, buf, item.Key, item.Value) - } - buf = appendMapEnd(ctx, code, buf) - b = b[:mapCtx.First] - b = append(b, buf...) - mapCtx.Buf = buf - encoder.ReleaseMapContext(mapCtx) - code = code.Next - case encoder.OpRecursivePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpRecursive: - ptr := load(ctxptr, code.Idx) - if ptr != 0 { - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if ptr == seen { - return nil, errUnsupportedValue(code, ptr) - } - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, ptr) - c := code.Jmp.Code - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += code.Jmp.CurLen * uintptrSize - oldBaseIndent := ctx.BaseIndent - indentDiffFromTop := c.Indent - 1 - ctx.BaseIndent += code.Indent - indentDiffFromTop - - newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - store(ctxptr, c.Idx, ptr) - store(ctxptr, c.End.Next.Idx, oldOffset) - store(ctxptr, c.End.Next.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, c.End.Next, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpRecursiveEnd: - recursiveLevel-- - - // restore ctxptr - restoreIndent(ctx, code, ctxptr) - offset := load(ctxptr, code.Idx) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpStructPtrHead: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHead: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if len(code.Key) > 0 { - if (code.Flags&encoder.IsTaggedKeyFlags) != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - } - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - u64 := ptrToUint64(p, code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - } - case encoder.OpStructPtrHeadNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructPtrHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadArray, encoder.OpStructHeadSlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyArray: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyArray: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptySlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptySlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadArrayPtr, encoder.OpStructPtrHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadArrayPtr, encoder.OpStructHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyArrayPtr, encoder.OpStructPtrHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyArrayPtr, encoder.OpStructHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - if maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalJSON { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { - p = ptrToPtr(p) - } - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructField: - if code.Flags&encoder.IsTaggedKeyFlags != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - p := load(ctxptr, code.Idx) + uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmpty: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringString: - p := load(ctxptr, code.Idx) - s := ptrToString(p + uintptr(code.Offset)) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldMarshalJSON: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalJSONPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldMarshalText: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalTextPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldArrayPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArrayPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldSlice: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlice: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldSlicePtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldMap: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMap: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 || maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldMapPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldStruct: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyStruct: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructEnd: - b = appendStructEndSkipLast(ctx, code, b) - code = code.Next - case encoder.OpStructEndInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendStructEnd(ctx, code, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - s := ptrToString(p + uintptr(code.Offset)) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytesPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - code = code.Next - case encoder.OpStructEndOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpEnd: - goto END - } - } -END: - return b, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/debug_vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/debug_vm.go deleted file mode 100644 index dd4cd489e06..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/debug_vm.go +++ /dev/null @@ -1,35 +0,0 @@ -package vm_color_indent - -import ( - "fmt" - - "github.com/goccy/go-json/internal/encoder" -) - -func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - defer func() { - if err := recover(); err != nil { - w := ctx.Option.DebugOut - fmt.Fprintln(w, "=============[DEBUG]===============") - fmt.Fprintln(w, "* [TYPE]") - fmt.Fprintln(w, codeSet.Type) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [ALL OPCODE]") - fmt.Fprintln(w, code.Dump()) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [CONTEXT]") - fmt.Fprintf(w, "%+v\n", ctx) - fmt.Fprintln(w, "===================================") - panic(err) - } - }() - - return Run(ctx, b, codeSet) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/util.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/util.go deleted file mode 100644 index 2395abec975..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/util.go +++ /dev/null @@ -1,297 +0,0 @@ -package vm_color_indent - -import ( - "encoding/json" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -const uintptrSize = 4 << (^uintptr(0) >> 63) - -var ( - appendIndent = encoder.AppendIndent - appendStructEnd = encoder.AppendStructEndIndent - errUnsupportedValue = encoder.ErrUnsupportedValue - errUnsupportedFloat = encoder.ErrUnsupportedFloat - mapiterinit = encoder.MapIterInit - mapiterkey = encoder.MapIterKey - mapitervalue = encoder.MapIterValue - mapiternext = encoder.MapIterNext - maplen = encoder.MapLen -) - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -type nonEmptyInterface struct { - itab *struct { - ityp *runtime.Type // static interface type - typ *runtime.Type // dynamic concrete type - // unused fields... - } - ptr unsafe.Pointer -} - -func errUnimplementedOp(op encoder.OpType) error { - return fmt.Errorf("encoder (indent): opcode %s has not been implemented", op) -} - -func load(base uintptr, idx uint32) uintptr { - addr := base + uintptr(idx) - return **(**uintptr)(unsafe.Pointer(&addr)) -} - -func store(base uintptr, idx uint32, p uintptr) { - addr := base + uintptr(idx) - **(**uintptr)(unsafe.Pointer(&addr)) = p -} - -func loadNPtr(base uintptr, idx uint32, ptrNum uint8) uintptr { - addr := base + uintptr(idx) - p := **(**uintptr)(unsafe.Pointer(&addr)) - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUint64(p uintptr, bitSize uint8) uint64 { - switch bitSize { - case 8: - return (uint64)(**(**uint8)(unsafe.Pointer(&p))) - case 16: - return (uint64)(**(**uint16)(unsafe.Pointer(&p))) - case 32: - return (uint64)(**(**uint32)(unsafe.Pointer(&p))) - case 64: - return **(**uint64)(unsafe.Pointer(&p)) - } - return 0 -} - -func ptrToFloat32(p uintptr) float32 { return **(**float32)(unsafe.Pointer(&p)) } -func ptrToFloat64(p uintptr) float64 { return **(**float64)(unsafe.Pointer(&p)) } -func ptrToBool(p uintptr) bool { return **(**bool)(unsafe.Pointer(&p)) } -func ptrToBytes(p uintptr) []byte { return **(**[]byte)(unsafe.Pointer(&p)) } -func ptrToNumber(p uintptr) json.Number { return **(**json.Number)(unsafe.Pointer(&p)) } -func ptrToString(p uintptr) string { return **(**string)(unsafe.Pointer(&p)) } -func ptrToSlice(p uintptr) *runtime.SliceHeader { return *(**runtime.SliceHeader)(unsafe.Pointer(&p)) } -func ptrToPtr(p uintptr) uintptr { - return uintptr(**(**unsafe.Pointer)(unsafe.Pointer(&p))) -} -func ptrToNPtr(p uintptr, ptrNum uint8) uintptr { - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUnsafePtr(p uintptr) unsafe.Pointer { - return *(*unsafe.Pointer)(unsafe.Pointer(&p)) -} -func ptrToInterface(code *encoder.Opcode, p uintptr) interface{} { - return *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: code.Type, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&p)), - })) -} - -func appendInt(ctx *encoder.RuntimeContext, b []byte, p uintptr, code *encoder.Opcode) []byte { - format := ctx.Option.ColorScheme.Int - b = append(b, format.Header...) - b = encoder.AppendInt(ctx, b, p, code) - return append(b, format.Footer...) -} - -func appendUint(ctx *encoder.RuntimeContext, b []byte, p uintptr, code *encoder.Opcode) []byte { - format := ctx.Option.ColorScheme.Uint - b = append(b, format.Header...) - b = encoder.AppendUint(ctx, b, p, code) - return append(b, format.Footer...) -} - -func appendFloat32(ctx *encoder.RuntimeContext, b []byte, v float32) []byte { - format := ctx.Option.ColorScheme.Float - b = append(b, format.Header...) - b = encoder.AppendFloat32(ctx, b, v) - return append(b, format.Footer...) -} - -func appendFloat64(ctx *encoder.RuntimeContext, b []byte, v float64) []byte { - format := ctx.Option.ColorScheme.Float - b = append(b, format.Header...) - b = encoder.AppendFloat64(ctx, b, v) - return append(b, format.Footer...) -} - -func appendString(ctx *encoder.RuntimeContext, b []byte, v string) []byte { - format := ctx.Option.ColorScheme.String - b = append(b, format.Header...) - b = encoder.AppendString(ctx, b, v) - return append(b, format.Footer...) -} - -func appendByteSlice(ctx *encoder.RuntimeContext, b []byte, src []byte) []byte { - format := ctx.Option.ColorScheme.Binary - b = append(b, format.Header...) - b = encoder.AppendByteSlice(ctx, b, src) - return append(b, format.Footer...) -} - -func appendNumber(ctx *encoder.RuntimeContext, b []byte, n json.Number) ([]byte, error) { - format := ctx.Option.ColorScheme.Int - b = append(b, format.Header...) - bb, err := encoder.AppendNumber(ctx, b, n) - if err != nil { - return nil, err - } - return append(bb, format.Footer...), nil -} - -func appendBool(ctx *encoder.RuntimeContext, b []byte, v bool) []byte { - format := ctx.Option.ColorScheme.Bool - b = append(b, format.Header...) - if v { - b = append(b, "true"...) - } else { - b = append(b, "false"...) - } - return append(b, format.Footer...) -} - -func appendNull(ctx *encoder.RuntimeContext, b []byte) []byte { - format := ctx.Option.ColorScheme.Null - b = append(b, format.Header...) - b = append(b, "null"...) - return append(b, format.Footer...) -} - -func appendComma(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, ',', '\n') -} - -func appendNullComma(ctx *encoder.RuntimeContext, b []byte) []byte { - format := ctx.Option.ColorScheme.Null - b = append(b, format.Header...) - b = append(b, "null"...) - return append(append(b, format.Footer...), ',', '\n') -} - -func appendColon(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b[:len(b)-2], ':', ' ') -} - -func appendMapKeyValue(ctx *encoder.RuntimeContext, code *encoder.Opcode, b, key, value []byte) []byte { - b = appendIndent(ctx, b, code.Indent+1) - b = append(b, key...) - b[len(b)-2] = ':' - b[len(b)-1] = ' ' - return append(b, value...) -} - -func appendMapEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = b[:len(b)-2] - b = append(b, '\n') - b = appendIndent(ctx, b, code.Indent) - return append(b, '}', ',', '\n') -} - -func appendArrayHead(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = append(b, '[', '\n') - return appendIndent(ctx, b, code.Indent+1) -} - -func appendArrayEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = b[:len(b)-2] - b = append(b, '\n') - b = appendIndent(ctx, b, code.Indent) - return append(b, ']', ',', '\n') -} - -func appendEmptyArray(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '[', ']', ',', '\n') -} - -func appendEmptyObject(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{', '}', ',', '\n') -} - -func appendObjectEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - // replace comma to newline - b[last-1] = '\n' - b = appendIndent(ctx, b[:last], code.Indent) - return append(b, '}', ',', '\n') -} - -func appendMarshalJSON(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - return encoder.AppendMarshalJSONIndent(ctx, code, b, v) -} - -func appendMarshalText(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - format := ctx.Option.ColorScheme.String - b = append(b, format.Header...) - bb, err := encoder.AppendMarshalTextIndent(ctx, code, b, v) - if err != nil { - return nil, err - } - return append(bb, format.Footer...), nil -} - -func appendStructHead(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{', '\n') -} - -func appendStructKey(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = appendIndent(ctx, b, code.Indent) - - format := ctx.Option.ColorScheme.ObjectKey - b = append(b, format.Header...) - b = append(b, code.Key[:len(code.Key)-1]...) - b = append(b, format.Footer...) - - return append(b, ':', ' ') -} - -func appendStructEndSkipLast(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - if b[last-1] == '{' { - b[last] = '}' - } else { - if b[last] == '\n' { - // to remove ',' and '\n' characters - b = b[:len(b)-2] - } - b = append(b, '\n') - b = appendIndent(ctx, b, code.Indent-1) - b = append(b, '}') - } - return appendComma(ctx, b) -} - -func restoreIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, ctxptr uintptr) { - ctx.BaseIndent = uint32(load(ctxptr, code.Length)) -} - -func storeIndent(ctxptr uintptr, code *encoder.Opcode, indent uintptr) { - store(ctxptr, code.Length, indent) -} - -func appendArrayElemIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - return appendIndent(ctx, b, code.Indent+1) -} - -func appendMapKeyIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - return appendIndent(ctx, b, code.Indent) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/vm.go deleted file mode 100644 index 3b4e22e5d42..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_color_indent/vm.go +++ /dev/null @@ -1,4859 +0,0 @@ -// Code generated by internal/cmd/generator. DO NOT EDIT! -package vm_color_indent - -import ( - "math" - "reflect" - "sort" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - recursiveLevel := 0 - ptrOffset := uintptr(0) - ctxptr := ctx.Ptr() - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - for { - switch code.Op { - default: - return nil, errUnimplementedOp(code.Op) - case encoder.OpPtr: - p := load(ctxptr, code.Idx) - code = code.Next - store(ctxptr, code.Idx, ptrToPtr(p)) - case encoder.OpIntPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInt: - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpUint: - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpIntString: - b = append(b, '"') - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintString: - b = append(b, '"') - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat32Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat32: - b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat64Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat64: - v := ptrToFloat64(load(ctxptr, code.Idx)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStringPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpString: - b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBoolPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBool: - b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBytesPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBytes: - b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpNumberPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpNumber: - bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpInterfacePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInterface: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if p == seen { - return nil, errUnsupportedValue(code, p) - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, p) - var ( - typ *runtime.Type - ifacePtr unsafe.Pointer - ) - up := ptrToUnsafePtr(p) - if code.Flags&encoder.NonEmptyInterfaceFlags != 0 { - iface := (*nonEmptyInterface)(up) - ifacePtr = iface.ptr - if iface.itab != nil { - typ = iface.itab.typ - } - } else { - iface := (*emptyInterface)(up) - ifacePtr = iface.ptr - typ = iface.typ - } - if ifacePtr == nil { - isDirectedNil := typ != nil && typ.Kind() == reflect.Struct && !runtime.IfaceIndir(typ) - if !isDirectedNil { - b = appendNullComma(ctx, b) - code = code.Next - break - } - } - ctx.KeepRefs = append(ctx.KeepRefs, up) - ifaceCodeSet, err := encoder.CompileToGetCodeSet(ctx, uintptr(unsafe.Pointer(typ))) - if err != nil { - return nil, err - } - - totalLength := uintptr(code.Length) + 3 - nextTotalLength := uintptr(ifaceCodeSet.CodeLength) + 3 - - var c *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - c = ifaceCodeSet.InterfaceEscapeKeyCode - } else { - c = ifaceCodeSet.InterfaceNoescapeKeyCode - } - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += totalLength * uintptrSize - oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - - newLen := offsetNum + totalLength + nextTotalLength - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - end := ifaceCodeSet.EndCode - store(ctxptr, c.Idx, uintptr(ifacePtr)) - store(ctxptr, end.Idx, oldOffset) - store(ctxptr, end.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, end, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpInterfaceEnd: - recursiveLevel-- - - // restore ctxptr - offset := load(ctxptr, code.Idx) - restoreIndent(ctx, code, ctxptr) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - b = append(b, `""`...) - b = appendComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpSlicePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpSlice: - p := load(ctxptr, code.Idx) - slice := ptrToSlice(p) - if p == 0 || slice.Data == nil { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.ElemIdx, 0) - store(ctxptr, code.Length, uintptr(slice.Len)) - store(ctxptr, code.Idx, uintptr(slice.Data)) - if slice.Len > 0 { - b = appendArrayHead(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, uintptr(slice.Data)) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpSliceElem: - idx := load(ctxptr, code.ElemIdx) - length := load(ctxptr, code.Length) - idx++ - if idx < length { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - data := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, data+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpArrayPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpArray: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - if code.Length > 0 { - b = appendArrayHead(ctx, code, b) - store(ctxptr, code.ElemIdx, 0) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpArrayElem: - idx := load(ctxptr, code.ElemIdx) - idx++ - if idx < uintptr(code.Length) { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - p := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, p+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpMapPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpMap: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - uptr := ptrToUnsafePtr(p) - mlen := maplen(uptr) - if mlen <= 0 { - b = appendEmptyObject(ctx, b) - code = code.End.Next - break - } - b = appendStructHead(ctx, b) - unorderedMap := (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 - mapCtx := encoder.NewMapContext(mlen, unorderedMap) - mapiterinit(code.Type, uptr, &mapCtx.Iter) - store(ctxptr, code.Idx, uintptr(unsafe.Pointer(mapCtx))) - ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(mapCtx)) - if unorderedMap { - b = appendMapKeyIndent(ctx, code.Next, b) - } else { - mapCtx.Start = len(b) - mapCtx.First = len(b) - } - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - case encoder.OpMapKey: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - idx := mapCtx.Idx - idx++ - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - if idx < mapCtx.Len { - b = appendMapKeyIndent(ctx, code, b) - mapCtx.Idx = int(idx) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - b = appendObjectEnd(ctx, code, b) - encoder.ReleaseMapContext(mapCtx) - code = code.End.Next - } - } else { - mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] - if idx < mapCtx.Len { - mapCtx.Idx = int(idx) - mapCtx.Start = len(b) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - code = code.End - } - } - case encoder.OpMapValue: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - b = appendColon(ctx, b) - } else { - mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] - mapCtx.Start = len(b) - } - value := mapitervalue(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(value)) - mapiternext(&mapCtx.Iter) - code = code.Next - case encoder.OpMapEnd: - // this operation only used by sorted map. - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - sort.Sort(mapCtx.Slice) - buf := mapCtx.Buf - for _, item := range mapCtx.Slice.Items { - buf = appendMapKeyValue(ctx, code, buf, item.Key, item.Value) - } - buf = appendMapEnd(ctx, code, buf) - b = b[:mapCtx.First] - b = append(b, buf...) - mapCtx.Buf = buf - encoder.ReleaseMapContext(mapCtx) - code = code.Next - case encoder.OpRecursivePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpRecursive: - ptr := load(ctxptr, code.Idx) - if ptr != 0 { - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if ptr == seen { - return nil, errUnsupportedValue(code, ptr) - } - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, ptr) - c := code.Jmp.Code - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += code.Jmp.CurLen * uintptrSize - oldBaseIndent := ctx.BaseIndent - indentDiffFromTop := c.Indent - 1 - ctx.BaseIndent += code.Indent - indentDiffFromTop - - newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - store(ctxptr, c.Idx, ptr) - store(ctxptr, c.End.Next.Idx, oldOffset) - store(ctxptr, c.End.Next.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, c.End.Next, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpRecursiveEnd: - recursiveLevel-- - - // restore ctxptr - restoreIndent(ctx, code, ctxptr) - offset := load(ctxptr, code.Idx) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpStructPtrHead: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHead: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if len(code.Key) > 0 { - if (code.Flags&encoder.IsTaggedKeyFlags) != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - } - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - u64 := ptrToUint64(p, code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - } - case encoder.OpStructPtrHeadNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructPtrHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadArray, encoder.OpStructHeadSlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyArray: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyArray: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptySlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptySlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadArrayPtr, encoder.OpStructPtrHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadArrayPtr, encoder.OpStructHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyArrayPtr, encoder.OpStructPtrHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyArrayPtr, encoder.OpStructHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - if maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalJSON { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { - p = ptrToPtr(p) - } - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructField: - if code.Flags&encoder.IsTaggedKeyFlags != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - p := load(ctxptr, code.Idx) + uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmpty: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringString: - p := load(ctxptr, code.Idx) - s := ptrToString(p + uintptr(code.Offset)) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldMarshalJSON: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalJSONPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldMarshalText: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalTextPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldArrayPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArrayPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldSlice: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlice: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldSlicePtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldMap: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMap: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 || maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldMapPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldStruct: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyStruct: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructEnd: - b = appendStructEndSkipLast(ctx, code, b) - code = code.Next - case encoder.OpStructEndInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendStructEnd(ctx, code, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - s := ptrToString(p + uintptr(code.Offset)) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytesPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - code = code.Next - case encoder.OpStructEndOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpEnd: - goto END - } - } -END: - return b, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go deleted file mode 100644 index 99395388c1e..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/debug_vm.go +++ /dev/null @@ -1,35 +0,0 @@ -package vm_indent - -import ( - "fmt" - - "github.com/goccy/go-json/internal/encoder" -) - -func DebugRun(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - defer func() { - if err := recover(); err != nil { - w := ctx.Option.DebugOut - fmt.Fprintln(w, "=============[DEBUG]===============") - fmt.Fprintln(w, "* [TYPE]") - fmt.Fprintln(w, codeSet.Type) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [ALL OPCODE]") - fmt.Fprintln(w, code.Dump()) - fmt.Fprintf(w, "\n") - fmt.Fprintln(w, "* [CONTEXT]") - fmt.Fprintf(w, "%+v\n", ctx) - fmt.Fprintln(w, "===================================") - panic(err) - } - }() - - return Run(ctx, b, codeSet) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/hack.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/hack.go deleted file mode 100644 index 9e245bfe57d..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/hack.go +++ /dev/null @@ -1,9 +0,0 @@ -package vm_indent - -import ( - // HACK: compile order - // `vm`, `vm_indent`, `vm_color`, `vm_color_indent` packages uses a lot of memory to compile, - // so forcibly make dependencies and avoid compiling in concurrent. - // dependency order: vm => vm_indent => vm_color => vm_color_indent - _ "github.com/goccy/go-json/internal/encoder/vm_color" -) diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/util.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/util.go deleted file mode 100644 index 6cb745e3939..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/util.go +++ /dev/null @@ -1,230 +0,0 @@ -package vm_indent - -import ( - "encoding/json" - "fmt" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -const uintptrSize = 4 << (^uintptr(0) >> 63) - -var ( - appendInt = encoder.AppendInt - appendUint = encoder.AppendUint - appendFloat32 = encoder.AppendFloat32 - appendFloat64 = encoder.AppendFloat64 - appendString = encoder.AppendString - appendByteSlice = encoder.AppendByteSlice - appendNumber = encoder.AppendNumber - appendStructEnd = encoder.AppendStructEndIndent - appendIndent = encoder.AppendIndent - errUnsupportedValue = encoder.ErrUnsupportedValue - errUnsupportedFloat = encoder.ErrUnsupportedFloat - mapiterinit = encoder.MapIterInit - mapiterkey = encoder.MapIterKey - mapitervalue = encoder.MapIterValue - mapiternext = encoder.MapIterNext - maplen = encoder.MapLen -) - -type emptyInterface struct { - typ *runtime.Type - ptr unsafe.Pointer -} - -type nonEmptyInterface struct { - itab *struct { - ityp *runtime.Type // static interface type - typ *runtime.Type // dynamic concrete type - // unused fields... - } - ptr unsafe.Pointer -} - -func errUnimplementedOp(op encoder.OpType) error { - return fmt.Errorf("encoder (indent): opcode %s has not been implemented", op) -} - -func load(base uintptr, idx uint32) uintptr { - addr := base + uintptr(idx) - return **(**uintptr)(unsafe.Pointer(&addr)) -} - -func store(base uintptr, idx uint32, p uintptr) { - addr := base + uintptr(idx) - **(**uintptr)(unsafe.Pointer(&addr)) = p -} - -func loadNPtr(base uintptr, idx uint32, ptrNum uint8) uintptr { - addr := base + uintptr(idx) - p := **(**uintptr)(unsafe.Pointer(&addr)) - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUint64(p uintptr, bitSize uint8) uint64 { - switch bitSize { - case 8: - return (uint64)(**(**uint8)(unsafe.Pointer(&p))) - case 16: - return (uint64)(**(**uint16)(unsafe.Pointer(&p))) - case 32: - return (uint64)(**(**uint32)(unsafe.Pointer(&p))) - case 64: - return **(**uint64)(unsafe.Pointer(&p)) - } - return 0 -} -func ptrToFloat32(p uintptr) float32 { return **(**float32)(unsafe.Pointer(&p)) } -func ptrToFloat64(p uintptr) float64 { return **(**float64)(unsafe.Pointer(&p)) } -func ptrToBool(p uintptr) bool { return **(**bool)(unsafe.Pointer(&p)) } -func ptrToBytes(p uintptr) []byte { return **(**[]byte)(unsafe.Pointer(&p)) } -func ptrToNumber(p uintptr) json.Number { return **(**json.Number)(unsafe.Pointer(&p)) } -func ptrToString(p uintptr) string { return **(**string)(unsafe.Pointer(&p)) } -func ptrToSlice(p uintptr) *runtime.SliceHeader { return *(**runtime.SliceHeader)(unsafe.Pointer(&p)) } -func ptrToPtr(p uintptr) uintptr { - return uintptr(**(**unsafe.Pointer)(unsafe.Pointer(&p))) -} -func ptrToNPtr(p uintptr, ptrNum uint8) uintptr { - for i := uint8(0); i < ptrNum; i++ { - if p == 0 { - return 0 - } - p = ptrToPtr(p) - } - return p -} - -func ptrToUnsafePtr(p uintptr) unsafe.Pointer { - return *(*unsafe.Pointer)(unsafe.Pointer(&p)) -} -func ptrToInterface(code *encoder.Opcode, p uintptr) interface{} { - return *(*interface{})(unsafe.Pointer(&emptyInterface{ - typ: code.Type, - ptr: *(*unsafe.Pointer)(unsafe.Pointer(&p)), - })) -} - -func appendBool(_ *encoder.RuntimeContext, b []byte, v bool) []byte { - if v { - return append(b, "true"...) - } - return append(b, "false"...) -} - -func appendNull(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, "null"...) -} - -func appendComma(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, ',', '\n') -} - -func appendNullComma(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, "null,\n"...) -} - -func appendColon(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b[:len(b)-2], ':', ' ') -} - -func appendMapKeyValue(ctx *encoder.RuntimeContext, code *encoder.Opcode, b, key, value []byte) []byte { - b = appendIndent(ctx, b, code.Indent+1) - b = append(b, key...) - b[len(b)-2] = ':' - b[len(b)-1] = ' ' - return append(b, value...) -} - -func appendMapEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = b[:len(b)-2] - b = append(b, '\n') - b = appendIndent(ctx, b, code.Indent) - return append(b, '}', ',', '\n') -} - -func appendArrayHead(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = append(b, '[', '\n') - return appendIndent(ctx, b, code.Indent+1) -} - -func appendArrayEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = b[:len(b)-2] - b = append(b, '\n') - b = appendIndent(ctx, b, code.Indent) - return append(b, ']', ',', '\n') -} - -func appendEmptyArray(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '[', ']', ',', '\n') -} - -func appendEmptyObject(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{', '}', ',', '\n') -} - -func appendObjectEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - // replace comma to newline - b[last-1] = '\n' - b = appendIndent(ctx, b[:last], code.Indent) - return append(b, '}', ',', '\n') -} - -func appendMarshalJSON(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - return encoder.AppendMarshalJSONIndent(ctx, code, b, v) -} - -func appendMarshalText(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte, v interface{}) ([]byte, error) { - return encoder.AppendMarshalTextIndent(ctx, code, b, v) -} - -func appendStructHead(_ *encoder.RuntimeContext, b []byte) []byte { - return append(b, '{', '\n') -} - -func appendStructKey(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - b = appendIndent(ctx, b, code.Indent) - b = append(b, code.Key...) - return append(b, ' ') -} - -func appendStructEndSkipLast(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - last := len(b) - 1 - if b[last-1] == '{' { - b[last] = '}' - } else { - if b[last] == '\n' { - // to remove ',' and '\n' characters - b = b[:len(b)-2] - } - b = append(b, '\n') - b = appendIndent(ctx, b, code.Indent-1) - b = append(b, '}') - } - return appendComma(ctx, b) -} - -func restoreIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, ctxptr uintptr) { - ctx.BaseIndent = uint32(load(ctxptr, code.Length)) -} - -func storeIndent(ctxptr uintptr, code *encoder.Opcode, indent uintptr) { - store(ctxptr, code.Length, indent) -} - -func appendArrayElemIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - return appendIndent(ctx, b, code.Indent+1) -} - -func appendMapKeyIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) []byte { - return appendIndent(ctx, b, code.Indent) -} diff --git a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/vm.go b/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/vm.go deleted file mode 100644 index 836c5c8a85a..00000000000 --- a/vendor/github.com/goccy/go-json/internal/encoder/vm_indent/vm.go +++ /dev/null @@ -1,4859 +0,0 @@ -// Code generated by internal/cmd/generator. DO NOT EDIT! -package vm_indent - -import ( - "math" - "reflect" - "sort" - "unsafe" - - "github.com/goccy/go-json/internal/encoder" - "github.com/goccy/go-json/internal/runtime" -) - -func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]byte, error) { - recursiveLevel := 0 - ptrOffset := uintptr(0) - ctxptr := ctx.Ptr() - var code *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - code = codeSet.EscapeKeyCode - } else { - code = codeSet.NoescapeKeyCode - } - - for { - switch code.Op { - default: - return nil, errUnimplementedOp(code.Op) - case encoder.OpPtr: - p := load(ctxptr, code.Idx) - code = code.Next - store(ctxptr, code.Idx, ptrToPtr(p)) - case encoder.OpIntPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInt: - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpUint: - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpIntString: - b = append(b, '"') - b = appendInt(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpUintString: - b = append(b, '"') - b = appendUint(ctx, b, load(ctxptr, code.Idx), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat32Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat32: - b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpFloat64Ptr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpFloat64: - v := ptrToFloat64(load(ctxptr, code.Idx)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStringPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpString: - b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBoolPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBool: - b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpBytesPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpBytes: - b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpNumberPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpNumber: - bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpInterfacePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpInterface: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if p == seen { - return nil, errUnsupportedValue(code, p) - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, p) - var ( - typ *runtime.Type - ifacePtr unsafe.Pointer - ) - up := ptrToUnsafePtr(p) - if code.Flags&encoder.NonEmptyInterfaceFlags != 0 { - iface := (*nonEmptyInterface)(up) - ifacePtr = iface.ptr - if iface.itab != nil { - typ = iface.itab.typ - } - } else { - iface := (*emptyInterface)(up) - ifacePtr = iface.ptr - typ = iface.typ - } - if ifacePtr == nil { - isDirectedNil := typ != nil && typ.Kind() == reflect.Struct && !runtime.IfaceIndir(typ) - if !isDirectedNil { - b = appendNullComma(ctx, b) - code = code.Next - break - } - } - ctx.KeepRefs = append(ctx.KeepRefs, up) - ifaceCodeSet, err := encoder.CompileToGetCodeSet(ctx, uintptr(unsafe.Pointer(typ))) - if err != nil { - return nil, err - } - - totalLength := uintptr(code.Length) + 3 - nextTotalLength := uintptr(ifaceCodeSet.CodeLength) + 3 - - var c *encoder.Opcode - if (ctx.Option.Flag & encoder.HTMLEscapeOption) != 0 { - c = ifaceCodeSet.InterfaceEscapeKeyCode - } else { - c = ifaceCodeSet.InterfaceNoescapeKeyCode - } - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += totalLength * uintptrSize - oldBaseIndent := ctx.BaseIndent - ctx.BaseIndent += code.Indent - - newLen := offsetNum + totalLength + nextTotalLength - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - end := ifaceCodeSet.EndCode - store(ctxptr, c.Idx, uintptr(ifacePtr)) - store(ctxptr, end.Idx, oldOffset) - store(ctxptr, end.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, end, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpInterfaceEnd: - recursiveLevel-- - - // restore ctxptr - offset := load(ctxptr, code.Idx) - restoreIndent(ctx, code, ctxptr) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToPtr(p)) - fallthrough - case encoder.OpMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - b = append(b, `""`...) - b = appendComma(ctx, b) - code = code.Next - break - } - if (code.Flags&encoder.IsNilableTypeFlags) != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p) - } - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpSlicePtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpSlice: - p := load(ctxptr, code.Idx) - slice := ptrToSlice(p) - if p == 0 || slice.Data == nil { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.ElemIdx, 0) - store(ctxptr, code.Length, uintptr(slice.Len)) - store(ctxptr, code.Idx, uintptr(slice.Data)) - if slice.Len > 0 { - b = appendArrayHead(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, uintptr(slice.Data)) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpSliceElem: - idx := load(ctxptr, code.ElemIdx) - length := load(ctxptr, code.Length) - idx++ - if idx < length { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - data := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, data+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpArrayPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpArray: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - if code.Length > 0 { - b = appendArrayHead(ctx, code, b) - store(ctxptr, code.ElemIdx, 0) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - b = appendEmptyArray(ctx, b) - code = code.End.Next - } - case encoder.OpArrayElem: - idx := load(ctxptr, code.ElemIdx) - idx++ - if idx < uintptr(code.Length) { - b = appendArrayElemIndent(ctx, code, b) - store(ctxptr, code.ElemIdx, idx) - p := load(ctxptr, code.Idx) - size := uintptr(code.Size) - code = code.Next - store(ctxptr, code.Idx, p+idx*size) - } else { - b = appendArrayEnd(ctx, code, b) - code = code.End.Next - } - case encoder.OpMapPtr: - p := loadNPtr(ctxptr, code.Idx, code.PtrNum) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - store(ctxptr, code.Idx, p) - fallthrough - case encoder.OpMap: - p := load(ctxptr, code.Idx) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.End.Next - break - } - uptr := ptrToUnsafePtr(p) - mlen := maplen(uptr) - if mlen <= 0 { - b = appendEmptyObject(ctx, b) - code = code.End.Next - break - } - b = appendStructHead(ctx, b) - unorderedMap := (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 - mapCtx := encoder.NewMapContext(mlen, unorderedMap) - mapiterinit(code.Type, uptr, &mapCtx.Iter) - store(ctxptr, code.Idx, uintptr(unsafe.Pointer(mapCtx))) - ctx.KeepRefs = append(ctx.KeepRefs, unsafe.Pointer(mapCtx)) - if unorderedMap { - b = appendMapKeyIndent(ctx, code.Next, b) - } else { - mapCtx.Start = len(b) - mapCtx.First = len(b) - } - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - case encoder.OpMapKey: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - idx := mapCtx.Idx - idx++ - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - if idx < mapCtx.Len { - b = appendMapKeyIndent(ctx, code, b) - mapCtx.Idx = int(idx) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - b = appendObjectEnd(ctx, code, b) - encoder.ReleaseMapContext(mapCtx) - code = code.End.Next - } - } else { - mapCtx.Slice.Items[mapCtx.Idx].Value = b[mapCtx.Start:len(b)] - if idx < mapCtx.Len { - mapCtx.Idx = int(idx) - mapCtx.Start = len(b) - key := mapiterkey(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(key)) - code = code.Next - } else { - code = code.End - } - } - case encoder.OpMapValue: - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - if (ctx.Option.Flag & encoder.UnorderedMapOption) != 0 { - b = appendColon(ctx, b) - } else { - mapCtx.Slice.Items[mapCtx.Idx].Key = b[mapCtx.Start:len(b)] - mapCtx.Start = len(b) - } - value := mapitervalue(&mapCtx.Iter) - store(ctxptr, code.Next.Idx, uintptr(value)) - mapiternext(&mapCtx.Iter) - code = code.Next - case encoder.OpMapEnd: - // this operation only used by sorted map. - mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(load(ctxptr, code.Idx))) - sort.Sort(mapCtx.Slice) - buf := mapCtx.Buf - for _, item := range mapCtx.Slice.Items { - buf = appendMapKeyValue(ctx, code, buf, item.Key, item.Value) - } - buf = appendMapEnd(ctx, code, buf) - b = b[:mapCtx.First] - b = append(b, buf...) - mapCtx.Buf = buf - encoder.ReleaseMapContext(mapCtx) - code = code.Next - case encoder.OpRecursivePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - code = code.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpRecursive: - ptr := load(ctxptr, code.Idx) - if ptr != 0 { - if recursiveLevel > encoder.StartDetectingCyclesAfter { - for _, seen := range ctx.SeenPtr { - if ptr == seen { - return nil, errUnsupportedValue(code, ptr) - } - } - } - } - ctx.SeenPtr = append(ctx.SeenPtr, ptr) - c := code.Jmp.Code - curlen := uintptr(len(ctx.Ptrs)) - offsetNum := ptrOffset / uintptrSize - oldOffset := ptrOffset - ptrOffset += code.Jmp.CurLen * uintptrSize - oldBaseIndent := ctx.BaseIndent - indentDiffFromTop := c.Indent - 1 - ctx.BaseIndent += code.Indent - indentDiffFromTop - - newLen := offsetNum + code.Jmp.CurLen + code.Jmp.NextLen - if curlen < newLen { - ctx.Ptrs = append(ctx.Ptrs, make([]uintptr, newLen-curlen)...) - } - ctxptr = ctx.Ptr() + ptrOffset // assign new ctxptr - - store(ctxptr, c.Idx, ptr) - store(ctxptr, c.End.Next.Idx, oldOffset) - store(ctxptr, c.End.Next.ElemIdx, uintptr(unsafe.Pointer(code.Next))) - storeIndent(ctxptr, c.End.Next, uintptr(oldBaseIndent)) - code = c - recursiveLevel++ - case encoder.OpRecursiveEnd: - recursiveLevel-- - - // restore ctxptr - restoreIndent(ctx, code, ctxptr) - offset := load(ctxptr, code.Idx) - ctx.SeenPtr = ctx.SeenPtr[:len(ctx.SeenPtr)-1] - - codePtr := load(ctxptr, code.ElemIdx) - code = (*encoder.Opcode)(ptrToUnsafePtr(codePtr)) - ctxptr = ctx.Ptr() + offset - ptrOffset = offset - case encoder.OpStructPtrHead: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHead: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if len(code.Key) > 0 { - if (code.Flags&encoder.IsTaggedKeyFlags) != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - } - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmpty: - p := load(ctxptr, code.Idx) - if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyInt: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyInt: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyIntString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - u64 := ptrToUint64(p, code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUint: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUint: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyUintString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat32(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64String: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToFloat64(p + uintptr(code.Offset)) - if v == 0 { - code = code.NextField - } else { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(ctx, b) - b = appendComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyStringString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToString(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBool: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBool: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - } else { - code = code.NextField - } - case encoder.OpStructPtrHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytes: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyBytes: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumber: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumber: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - } - case encoder.OpStructPtrHeadNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberString: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - v := ptrToNumber(p + uintptr(code.Offset)) - if v == "" { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructPtrHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadArray, encoder.OpStructHeadSlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyArray: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyArray: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptySlice: - if (code.Flags & encoder.IndirectFlags) != 0 { - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptySlice: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadArrayPtr, encoder.OpStructPtrHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadArrayPtr, encoder.OpStructHeadSlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyArrayPtr, encoder.OpStructPtrHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyArrayPtr, encoder.OpStructHeadOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructPtrHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMap: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { - p = ptrToPtr(p + uintptr(code.Offset)) - } - if maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - break - } - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 { - code = code.NextField - } else { - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructPtrHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalJSON { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { - p = ptrToPtr(p) - } - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - } - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { - p = ptrToPtr(p) - } - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructPtrHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - b = appendStructKey(ctx, code, b) - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - store(ctxptr, code.Idx, ptrToNPtr(p, code.PtrNum)) - fallthrough - case encoder.OpStructHeadOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNullComma(ctx, b) - } - code = code.End.Next - break - } - if (code.Flags & encoder.IndirectFlags) != 0 { - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - } - if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(ctx, b) - } - if p == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - b = appendComma(ctx, b) - code = code.Next - } - case encoder.OpStructField: - if code.Flags&encoder.IsTaggedKeyFlags != 0 || code.Flags&encoder.AnonymousKeyFlags == 0 { - b = appendStructKey(ctx, code, b) - } - p := load(ctxptr, code.Idx) + uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmpty: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNullComma(ctx, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringString: - p := load(ctxptr, code.Idx) - s := ptrToString(p + uintptr(code.Offset)) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - b = appendStructKey(ctx, code, b) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendComma(ctx, b) - } - code = code.Next - case encoder.OpStructFieldMarshalJSON: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSON: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - iface := ptrToInterface(code, p) - if (code.Flags&encoder.NilCheckFlags) != 0 && encoder.IsNilForMarshaler(iface) { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, iface) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalJSONPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldMarshalText: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalText: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if (code.Flags & encoder.IsNilableTypeFlags) != 0 { - p = ptrToPtr(p) - } - if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - code = code.NextField - break - } - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - code = code.Next - case encoder.OpStructFieldMarshalTextPtr: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendComma(ctx, b) - code = code.Next - case encoder.OpStructFieldOmitEmptyMarshalTextPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) - if err != nil { - return nil, err - } - b = appendComma(ctx, bb) - } - code = code.Next - case encoder.OpStructFieldArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArray: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldArrayPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyArrayPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldSlice: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlice: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - slice := ptrToSlice(p) - if slice.Len == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldSlicePtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptySlicePtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldMap: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMap: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p == 0 || maplen(ptrToUnsafePtr(p)) == 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructFieldMapPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyMapPtr: - p := load(ctxptr, code.Idx) - p = ptrToPtr(p + uintptr(code.Offset)) - if p != 0 { - p = ptrToNPtr(p, code.PtrNum) - } - if p != 0 { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } else { - code = code.NextField - } - case encoder.OpStructFieldStruct: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - code = code.Next - store(ctxptr, code.Idx, p) - case encoder.OpStructFieldOmitEmptyStruct: - p := load(ctxptr, code.Idx) - p += uintptr(code.Offset) - if ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0 { - code = code.NextField - } else { - b = appendStructKey(ctx, code, b) - code = code.Next - store(ctxptr, code.Idx, p) - } - case encoder.OpStructEnd: - b = appendStructEndSkipLast(ctx, code, b) - code = code.Next - case encoder.OpStructEndInt: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyInt: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendInt(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendInt(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndIntPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyIntPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendInt(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUint: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUint: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintString: - p := load(ctxptr, code.Idx) - u64 := ptrToUint64(p+uintptr(code.Offset), code.NumBitSize) - v := u64 & ((1 << code.NumBitSize) - 1) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p+uintptr(code.Offset), code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendUint(ctx, b, p, code) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendUint(ctx, b, p, code) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndUintPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyUintPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendUint(ctx, b, p, code) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32String: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32String: - p := load(ctxptr, code.Idx) - v := ptrToFloat32(p + uintptr(code.Offset)) - if v != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendFloat32(ctx, b, ptrToFloat32(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat32PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat32PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat32(ctx, b, ptrToFloat32(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64String: - p := load(ctxptr, code.Idx) - v := ptrToFloat64(p + uintptr(code.Offset)) - if v != 0 { - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64Ptr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - b = appendStructEnd(ctx, code, b) - code = code.Next - break - } - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64Ptr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndFloat64PtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = appendFloat64(ctx, b, v) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyFloat64PtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - v := ptrToFloat64(p) - if math.IsInf(v, 0) || math.IsNaN(v) { - return nil, errUnsupportedFloat(v) - } - b = append(b, '"') - b = appendFloat64(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - s := ptrToString(p + uintptr(code.Offset)) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringString: - p := load(ctxptr, code.Idx) - v := ptrToString(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, ptrToString(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, ptrToString(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndStringPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyStringPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBool: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBool: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolString: - p := load(ctxptr, code.Idx) - v := ptrToBool(p + uintptr(code.Offset)) - if v { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, v) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendBool(ctx, b, ptrToBool(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendBool(ctx, b, ptrToBool(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBoolPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBoolPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - b = appendBool(ctx, b, ptrToBool(p)) - b = append(b, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytes: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytes: - p := load(ctxptr, code.Idx) - v := ptrToBytes(p + uintptr(code.Offset)) - if len(v) > 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, v) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndBytesPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = appendByteSlice(ctx, b, ptrToBytes(p)) - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyBytesPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = appendByteSlice(ctx, b, ptrToBytes(p)) - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumber: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - code = code.Next - case encoder.OpStructEndOmitEmptyNumber: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberString: - p := load(ctxptr, code.Idx) - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberString: - p := load(ctxptr, code.Idx) - v := ptrToNumber(p + uintptr(code.Offset)) - if v != "" { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, v) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtr: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = bb - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtr: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = appendStructEnd(ctx, code, bb) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpStructEndNumberPtrString: - b = appendStructKey(ctx, code, b) - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p == 0 { - b = appendNull(ctx, b) - } else { - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - } - b = appendStructEnd(ctx, code, b) - code = code.Next - case encoder.OpStructEndOmitEmptyNumberPtrString: - p := load(ctxptr, code.Idx) - p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) - if p != 0 { - b = appendStructKey(ctx, code, b) - b = append(b, '"') - bb, err := appendNumber(ctx, b, ptrToNumber(p)) - if err != nil { - return nil, err - } - b = append(bb, '"') - b = appendStructEnd(ctx, code, b) - } else { - b = appendStructEndSkipLast(ctx, code, b) - } - code = code.Next - case encoder.OpEnd: - goto END - } - } -END: - return b, nil -} diff --git a/vendor/github.com/goccy/go-json/internal/errors/error.go b/vendor/github.com/goccy/go-json/internal/errors/error.go deleted file mode 100644 index 9207d0ff25e..00000000000 --- a/vendor/github.com/goccy/go-json/internal/errors/error.go +++ /dev/null @@ -1,183 +0,0 @@ -package errors - -import ( - "fmt" - "reflect" - "strconv" -) - -type InvalidUTF8Error struct { - S string // the whole string value that caused the error -} - -func (e *InvalidUTF8Error) Error() string { - return fmt.Sprintf("json: invalid UTF-8 in string: %s", strconv.Quote(e.S)) -} - -type InvalidUnmarshalError struct { - Type reflect.Type -} - -func (e *InvalidUnmarshalError) Error() string { - if e.Type == nil { - return "json: Unmarshal(nil)" - } - - if e.Type.Kind() != reflect.Ptr { - return fmt.Sprintf("json: Unmarshal(non-pointer %s)", e.Type) - } - return fmt.Sprintf("json: Unmarshal(nil %s)", e.Type) -} - -// A MarshalerError represents an error from calling a MarshalJSON or MarshalText method. -type MarshalerError struct { - Type reflect.Type - Err error - sourceFunc string -} - -func (e *MarshalerError) Error() string { - srcFunc := e.sourceFunc - if srcFunc == "" { - srcFunc = "MarshalJSON" - } - return fmt.Sprintf("json: error calling %s for type %s: %s", srcFunc, e.Type, e.Err.Error()) -} - -// Unwrap returns the underlying error. -func (e *MarshalerError) Unwrap() error { return e.Err } - -// A SyntaxError is a description of a JSON syntax error. -type SyntaxError struct { - msg string // description of error - Offset int64 // error occurred after reading Offset bytes -} - -func (e *SyntaxError) Error() string { return e.msg } - -// An UnmarshalFieldError describes a JSON object key that -// led to an unexported (and therefore unwritable) struct field. -// -// Deprecated: No longer used; kept for compatibility. -type UnmarshalFieldError struct { - Key string - Type reflect.Type - Field reflect.StructField -} - -func (e *UnmarshalFieldError) Error() string { - return fmt.Sprintf("json: cannot unmarshal object key %s into unexported field %s of type %s", - strconv.Quote(e.Key), e.Field.Name, e.Type.String(), - ) -} - -// An UnmarshalTypeError describes a JSON value that was -// not appropriate for a value of a specific Go type. -type UnmarshalTypeError struct { - Value string // description of JSON value - "bool", "array", "number -5" - Type reflect.Type // type of Go value it could not be assigned to - Offset int64 // error occurred after reading Offset bytes - Struct string // name of the struct type containing the field - Field string // the full path from root node to the field -} - -func (e *UnmarshalTypeError) Error() string { - if e.Struct != "" || e.Field != "" { - return fmt.Sprintf("json: cannot unmarshal %s into Go struct field %s.%s of type %s", - e.Value, e.Struct, e.Field, e.Type, - ) - } - return fmt.Sprintf("json: cannot unmarshal %s into Go value of type %s", e.Value, e.Type) -} - -// An UnsupportedTypeError is returned by Marshal when attempting -// to encode an unsupported value type. -type UnsupportedTypeError struct { - Type reflect.Type -} - -func (e *UnsupportedTypeError) Error() string { - return fmt.Sprintf("json: unsupported type: %s", e.Type) -} - -type UnsupportedValueError struct { - Value reflect.Value - Str string -} - -func (e *UnsupportedValueError) Error() string { - return fmt.Sprintf("json: unsupported value: %s", e.Str) -} - -func ErrSyntax(msg string, offset int64) *SyntaxError { - return &SyntaxError{msg: msg, Offset: offset} -} - -func ErrMarshaler(typ reflect.Type, err error, msg string) *MarshalerError { - return &MarshalerError{ - Type: typ, - Err: err, - sourceFunc: msg, - } -} - -func ErrExceededMaxDepth(c byte, cursor int64) *SyntaxError { - return &SyntaxError{ - msg: fmt.Sprintf(`invalid character "%c" exceeded max depth`, c), - Offset: cursor, - } -} - -func ErrNotAtBeginningOfValue(cursor int64) *SyntaxError { - return &SyntaxError{msg: "not at beginning of value", Offset: cursor} -} - -func ErrUnexpectedEndOfJSON(msg string, cursor int64) *SyntaxError { - return &SyntaxError{ - msg: fmt.Sprintf("json: %s unexpected end of JSON input", msg), - Offset: cursor, - } -} - -func ErrExpected(msg string, cursor int64) *SyntaxError { - return &SyntaxError{msg: fmt.Sprintf("expected %s", msg), Offset: cursor} -} - -func ErrInvalidCharacter(c byte, context string, cursor int64) *SyntaxError { - if c == 0 { - return &SyntaxError{ - msg: fmt.Sprintf("json: invalid character as %s", context), - Offset: cursor, - } - } - return &SyntaxError{ - msg: fmt.Sprintf("json: invalid character %c as %s", c, context), - Offset: cursor, - } -} - -func ErrInvalidBeginningOfValue(c byte, cursor int64) *SyntaxError { - return &SyntaxError{ - msg: fmt.Sprintf("invalid character '%c' looking for beginning of value", c), - Offset: cursor, - } -} - -type PathError struct { - msg string -} - -func (e *PathError) Error() string { - return fmt.Sprintf("json: invalid path format: %s", e.msg) -} - -func ErrInvalidPath(msg string, args ...interface{}) *PathError { - if len(args) != 0 { - return &PathError{msg: fmt.Sprintf(msg, args...)} - } - return &PathError{msg: msg} -} - -func ErrEmptyPath() *PathError { - return &PathError{msg: "path is empty"} -} diff --git a/vendor/github.com/goccy/go-json/internal/runtime/rtype.go b/vendor/github.com/goccy/go-json/internal/runtime/rtype.go deleted file mode 100644 index 37cfe35a1fd..00000000000 --- a/vendor/github.com/goccy/go-json/internal/runtime/rtype.go +++ /dev/null @@ -1,262 +0,0 @@ -package runtime - -import ( - "reflect" - "unsafe" -) - -// Type representing reflect.rtype for noescape trick -type Type struct{} - -//go:linkname rtype_Align reflect.(*rtype).Align -//go:noescape -func rtype_Align(*Type) int - -func (t *Type) Align() int { - return rtype_Align(t) -} - -//go:linkname rtype_FieldAlign reflect.(*rtype).FieldAlign -//go:noescape -func rtype_FieldAlign(*Type) int - -func (t *Type) FieldAlign() int { - return rtype_FieldAlign(t) -} - -//go:linkname rtype_Method reflect.(*rtype).Method -//go:noescape -func rtype_Method(*Type, int) reflect.Method - -func (t *Type) Method(a0 int) reflect.Method { - return rtype_Method(t, a0) -} - -//go:linkname rtype_MethodByName reflect.(*rtype).MethodByName -//go:noescape -func rtype_MethodByName(*Type, string) (reflect.Method, bool) - -func (t *Type) MethodByName(a0 string) (reflect.Method, bool) { - return rtype_MethodByName(t, a0) -} - -//go:linkname rtype_NumMethod reflect.(*rtype).NumMethod -//go:noescape -func rtype_NumMethod(*Type) int - -func (t *Type) NumMethod() int { - return rtype_NumMethod(t) -} - -//go:linkname rtype_Name reflect.(*rtype).Name -//go:noescape -func rtype_Name(*Type) string - -func (t *Type) Name() string { - return rtype_Name(t) -} - -//go:linkname rtype_PkgPath reflect.(*rtype).PkgPath -//go:noescape -func rtype_PkgPath(*Type) string - -func (t *Type) PkgPath() string { - return rtype_PkgPath(t) -} - -//go:linkname rtype_Size reflect.(*rtype).Size -//go:noescape -func rtype_Size(*Type) uintptr - -func (t *Type) Size() uintptr { - return rtype_Size(t) -} - -//go:linkname rtype_String reflect.(*rtype).String -//go:noescape -func rtype_String(*Type) string - -func (t *Type) String() string { - return rtype_String(t) -} - -//go:linkname rtype_Kind reflect.(*rtype).Kind -//go:noescape -func rtype_Kind(*Type) reflect.Kind - -func (t *Type) Kind() reflect.Kind { - return rtype_Kind(t) -} - -//go:linkname rtype_Implements reflect.(*rtype).Implements -//go:noescape -func rtype_Implements(*Type, reflect.Type) bool - -func (t *Type) Implements(u reflect.Type) bool { - return rtype_Implements(t, u) -} - -//go:linkname rtype_AssignableTo reflect.(*rtype).AssignableTo -//go:noescape -func rtype_AssignableTo(*Type, reflect.Type) bool - -func (t *Type) AssignableTo(u reflect.Type) bool { - return rtype_AssignableTo(t, u) -} - -//go:linkname rtype_ConvertibleTo reflect.(*rtype).ConvertibleTo -//go:noescape -func rtype_ConvertibleTo(*Type, reflect.Type) bool - -func (t *Type) ConvertibleTo(u reflect.Type) bool { - return rtype_ConvertibleTo(t, u) -} - -//go:linkname rtype_Comparable reflect.(*rtype).Comparable -//go:noescape -func rtype_Comparable(*Type) bool - -func (t *Type) Comparable() bool { - return rtype_Comparable(t) -} - -//go:linkname rtype_Bits reflect.(*rtype).Bits -//go:noescape -func rtype_Bits(*Type) int - -func (t *Type) Bits() int { - return rtype_Bits(t) -} - -//go:linkname rtype_ChanDir reflect.(*rtype).ChanDir -//go:noescape -func rtype_ChanDir(*Type) reflect.ChanDir - -func (t *Type) ChanDir() reflect.ChanDir { - return rtype_ChanDir(t) -} - -//go:linkname rtype_IsVariadic reflect.(*rtype).IsVariadic -//go:noescape -func rtype_IsVariadic(*Type) bool - -func (t *Type) IsVariadic() bool { - return rtype_IsVariadic(t) -} - -//go:linkname rtype_Elem reflect.(*rtype).Elem -//go:noescape -func rtype_Elem(*Type) reflect.Type - -func (t *Type) Elem() *Type { - return Type2RType(rtype_Elem(t)) -} - -//go:linkname rtype_Field reflect.(*rtype).Field -//go:noescape -func rtype_Field(*Type, int) reflect.StructField - -func (t *Type) Field(i int) reflect.StructField { - return rtype_Field(t, i) -} - -//go:linkname rtype_FieldByIndex reflect.(*rtype).FieldByIndex -//go:noescape -func rtype_FieldByIndex(*Type, []int) reflect.StructField - -func (t *Type) FieldByIndex(index []int) reflect.StructField { - return rtype_FieldByIndex(t, index) -} - -//go:linkname rtype_FieldByName reflect.(*rtype).FieldByName -//go:noescape -func rtype_FieldByName(*Type, string) (reflect.StructField, bool) - -func (t *Type) FieldByName(name string) (reflect.StructField, bool) { - return rtype_FieldByName(t, name) -} - -//go:linkname rtype_FieldByNameFunc reflect.(*rtype).FieldByNameFunc -//go:noescape -func rtype_FieldByNameFunc(*Type, func(string) bool) (reflect.StructField, bool) - -func (t *Type) FieldByNameFunc(match func(string) bool) (reflect.StructField, bool) { - return rtype_FieldByNameFunc(t, match) -} - -//go:linkname rtype_In reflect.(*rtype).In -//go:noescape -func rtype_In(*Type, int) reflect.Type - -func (t *Type) In(i int) reflect.Type { - return rtype_In(t, i) -} - -//go:linkname rtype_Key reflect.(*rtype).Key -//go:noescape -func rtype_Key(*Type) reflect.Type - -func (t *Type) Key() *Type { - return Type2RType(rtype_Key(t)) -} - -//go:linkname rtype_Len reflect.(*rtype).Len -//go:noescape -func rtype_Len(*Type) int - -func (t *Type) Len() int { - return rtype_Len(t) -} - -//go:linkname rtype_NumField reflect.(*rtype).NumField -//go:noescape -func rtype_NumField(*Type) int - -func (t *Type) NumField() int { - return rtype_NumField(t) -} - -//go:linkname rtype_NumIn reflect.(*rtype).NumIn -//go:noescape -func rtype_NumIn(*Type) int - -func (t *Type) NumIn() int { - return rtype_NumIn(t) -} - -//go:linkname rtype_NumOut reflect.(*rtype).NumOut -//go:noescape -func rtype_NumOut(*Type) int - -func (t *Type) NumOut() int { - return rtype_NumOut(t) -} - -//go:linkname rtype_Out reflect.(*rtype).Out -//go:noescape -func rtype_Out(*Type, int) reflect.Type - -//go:linkname PtrTo reflect.(*rtype).ptrTo -//go:noescape -func PtrTo(*Type) *Type - -func (t *Type) Out(i int) reflect.Type { - return rtype_Out(t, i) -} - -//go:linkname IfaceIndir reflect.ifaceIndir -//go:noescape -func IfaceIndir(*Type) bool - -//go:linkname RType2Type reflect.toType -//go:noescape -func RType2Type(t *Type) reflect.Type - -type emptyInterface struct { - _ *Type - ptr unsafe.Pointer -} - -func Type2RType(t reflect.Type) *Type { - return (*Type)(((*emptyInterface)(unsafe.Pointer(&t))).ptr) -} diff --git a/vendor/github.com/goccy/go-json/internal/runtime/struct_field.go b/vendor/github.com/goccy/go-json/internal/runtime/struct_field.go deleted file mode 100644 index baab0c5978d..00000000000 --- a/vendor/github.com/goccy/go-json/internal/runtime/struct_field.go +++ /dev/null @@ -1,91 +0,0 @@ -package runtime - -import ( - "reflect" - "strings" - "unicode" -) - -func getTag(field reflect.StructField) string { - return field.Tag.Get("json") -} - -func IsIgnoredStructField(field reflect.StructField) bool { - if field.PkgPath != "" { - if field.Anonymous { - t := field.Type - if t.Kind() == reflect.Ptr { - t = t.Elem() - } - if t.Kind() != reflect.Struct { - return true - } - } else { - // private field - return true - } - } - tag := getTag(field) - return tag == "-" -} - -type StructTag struct { - Key string - IsTaggedKey bool - IsOmitEmpty bool - IsString bool - Field reflect.StructField -} - -type StructTags []*StructTag - -func (t StructTags) ExistsKey(key string) bool { - for _, tt := range t { - if tt.Key == key { - return true - } - } - return false -} - -func isValidTag(s string) bool { - if s == "" { - return false - } - for _, c := range s { - switch { - case strings.ContainsRune("!#$%&()*+-./:<=>?@[]^_{|}~ ", c): - // Backslash and quote chars are reserved, but - // otherwise any punctuation chars are allowed - // in a tag name. - case !unicode.IsLetter(c) && !unicode.IsDigit(c): - return false - } - } - return true -} - -func StructTagFromField(field reflect.StructField) *StructTag { - keyName := field.Name - tag := getTag(field) - st := &StructTag{Field: field} - opts := strings.Split(tag, ",") - if len(opts) > 0 { - if opts[0] != "" && isValidTag(opts[0]) { - keyName = opts[0] - st.IsTaggedKey = true - } - } - st.Key = keyName - if len(opts) > 1 { - for _, opt := range opts[1:] { - switch opt { - case "omitempty": - st.IsOmitEmpty = true - case "string": - st.IsString = true - } - } - } - return st -} diff --git a/vendor/github.com/goccy/go-json/internal/runtime/type.go b/vendor/github.com/goccy/go-json/internal/runtime/type.go deleted file mode 100644 index 4b693cb0bbe..00000000000 --- a/vendor/github.com/goccy/go-json/internal/runtime/type.go +++ /dev/null @@ -1,98 +0,0 @@ -package runtime - -import ( - "reflect" - "sync" - "unsafe" -) - -type SliceHeader struct { - Data unsafe.Pointer - Len int - Cap int -} - -const ( - maxAcceptableTypeAddrRange = 1024 * 1024 * 2 // 2 Mib -) - -type TypeAddr struct { - BaseTypeAddr uintptr - MaxTypeAddr uintptr - AddrRange uintptr - AddrShift uintptr -} - -var ( - typeAddr *TypeAddr - once sync.Once -) - -//go:linkname typelinks reflect.typelinks -func typelinks() ([]unsafe.Pointer, [][]int32) - -//go:linkname rtypeOff reflect.rtypeOff -func rtypeOff(unsafe.Pointer, int32) unsafe.Pointer - -func AnalyzeTypeAddr() *TypeAddr { - once.Do(func() { - sections, offsets := typelinks() - if len(sections) != 1 { - return - } - if len(offsets) != 1 { - return - } - section := sections[0] - offset := offsets[0] - var ( - min uintptr = uintptr(^uint(0)) - max uintptr = 0 - isAligned64 = true - isAligned32 = true - ) - for i := 0; i < len(offset); i++ { - typ := (*Type)(rtypeOff(section, offset[i])) - addr := uintptr(unsafe.Pointer(typ)) - if min > addr { - min = addr - } - if max < addr { - max = addr - } - if typ.Kind() == reflect.Ptr { - addr = uintptr(unsafe.Pointer(typ.Elem())) - if min > addr { - min = addr - } - if max < addr { - max = addr - } - } - isAligned64 = isAligned64 && (addr-min)&63 == 0 - isAligned32 = isAligned32 && (addr-min)&31 == 0 - } - addrRange := max - min - if addrRange == 0 { - return - } - var addrShift uintptr - if isAligned64 { - addrShift = 6 - } else if isAligned32 { - addrShift = 5 - } - cacheSize := addrRange >> addrShift - if cacheSize > maxAcceptableTypeAddrRange { - return - } - typeAddr = &TypeAddr{ - BaseTypeAddr: min, - MaxTypeAddr: max, - AddrRange: addrRange, - AddrShift: addrShift, - } - }) - - return typeAddr -} diff --git a/vendor/github.com/goccy/go-json/json.go b/vendor/github.com/goccy/go-json/json.go deleted file mode 100644 index fb18065a231..00000000000 --- a/vendor/github.com/goccy/go-json/json.go +++ /dev/null @@ -1,368 +0,0 @@ -package json - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/goccy/go-json/internal/encoder" -) - -// Marshaler is the interface implemented by types that -// can marshal themselves into valid JSON. -type Marshaler interface { - MarshalJSON() ([]byte, error) -} - -// MarshalerContext is the interface implemented by types that -// can marshal themselves into valid JSON with context.Context. -type MarshalerContext interface { - MarshalJSON(context.Context) ([]byte, error) -} - -// Unmarshaler is the interface implemented by types -// that can unmarshal a JSON description of themselves. -// The input can be assumed to be a valid encoding of -// a JSON value. UnmarshalJSON must copy the JSON data -// if it wishes to retain the data after returning. -// -// By convention, to approximate the behavior of Unmarshal itself, -// Unmarshalers implement UnmarshalJSON([]byte("null")) as a no-op. -type Unmarshaler interface { - UnmarshalJSON([]byte) error -} - -// UnmarshalerContext is the interface implemented by types -// that can unmarshal with context.Context a JSON description of themselves. -type UnmarshalerContext interface { - UnmarshalJSON(context.Context, []byte) error -} - -// Marshal returns the JSON encoding of v. -// -// Marshal traverses the value v recursively. -// If an encountered value implements the Marshaler interface -// and is not a nil pointer, Marshal calls its MarshalJSON method -// to produce JSON. If no MarshalJSON method is present but the -// value implements encoding.TextMarshaler instead, Marshal calls -// its MarshalText method and encodes the result as a JSON string. -// The nil pointer exception is not strictly necessary -// but mimics a similar, necessary exception in the behavior of -// UnmarshalJSON. -// -// Otherwise, Marshal uses the following type-dependent default encodings: -// -// Boolean values encode as JSON booleans. -// -// Floating point, integer, and Number values encode as JSON numbers. -// -// String values encode as JSON strings coerced to valid UTF-8, -// replacing invalid bytes with the Unicode replacement rune. -// The angle brackets "<" and ">" are escaped to "\u003c" and "\u003e" -// to keep some browsers from misinterpreting JSON output as HTML. -// Ampersand "&" is also escaped to "\u0026" for the same reason. -// This escaping can be disabled using an Encoder that had SetEscapeHTML(false) -// called on it. -// -// Array and slice values encode as JSON arrays, except that -// []byte encodes as a base64-encoded string, and a nil slice -// encodes as the null JSON value. -// -// Struct values encode as JSON objects. -// Each exported struct field becomes a member of the object, using the -// field name as the object key, unless the field is omitted for one of the -// reasons given below. -// -// The encoding of each struct field can be customized by the format string -// stored under the "json" key in the struct field's tag. -// The format string gives the name of the field, possibly followed by a -// comma-separated list of options. The name may be empty in order to -// specify options without overriding the default field name. -// -// The "omitempty" option specifies that the field should be omitted -// from the encoding if the field has an empty value, defined as -// false, 0, a nil pointer, a nil interface value, and any empty array, -// slice, map, or string. -// -// As a special case, if the field tag is "-", the field is always omitted. -// Note that a field with name "-" can still be generated using the tag "-,". -// -// Examples of struct field tags and their meanings: -// -// // Field appears in JSON as key "myName". -// Field int `json:"myName"` -// -// // Field appears in JSON as key "myName" and -// // the field is omitted from the object if its value is empty, -// // as defined above. -// Field int `json:"myName,omitempty"` -// -// // Field appears in JSON as key "Field" (the default), but -// // the field is skipped if empty. -// // Note the leading comma. -// Field int `json:",omitempty"` -// -// // Field is ignored by this package. -// Field int `json:"-"` -// -// // Field appears in JSON as key "-". -// Field int `json:"-,"` -// -// The "string" option signals that a field is stored as JSON inside a -// JSON-encoded string. It applies only to fields of string, floating point, -// integer, or boolean types. This extra level of encoding is sometimes used -// when communicating with JavaScript programs: -// -// Int64String int64 `json:",string"` -// -// The key name will be used if it's a non-empty string consisting of -// only Unicode letters, digits, and ASCII punctuation except quotation -// marks, backslash, and comma. -// -// Anonymous struct fields are usually marshaled as if their inner exported fields -// were fields in the outer struct, subject to the usual Go visibility rules amended -// as described in the next paragraph. -// An anonymous struct field with a name given in its JSON tag is treated as -// having that name, rather than being anonymous. -// An anonymous struct field of interface type is treated the same as having -// that type as its name, rather than being anonymous. -// -// The Go visibility rules for struct fields are amended for JSON when -// deciding which field to marshal or unmarshal. If there are -// multiple fields at the same level, and that level is the least -// nested (and would therefore be the nesting level selected by the -// usual Go rules), the following extra rules apply: -// -// 1) Of those fields, if any are JSON-tagged, only tagged fields are considered, -// even if there are multiple untagged fields that would otherwise conflict. -// -// 2) If there is exactly one field (tagged or not according to the first rule), that is selected. -// -// 3) Otherwise there are multiple fields, and all are ignored; no error occurs. -// -// Handling of anonymous struct fields is new in Go 1.1. -// Prior to Go 1.1, anonymous struct fields were ignored. To force ignoring of -// an anonymous struct field in both current and earlier versions, give the field -// a JSON tag of "-". -// -// Map values encode as JSON objects. The map's key type must either be a -// string, an integer type, or implement encoding.TextMarshaler. The map keys -// are sorted and used as JSON object keys by applying the following rules, -// subject to the UTF-8 coercion described for string values above: -// - string keys are used directly -// - encoding.TextMarshalers are marshaled -// - integer keys are converted to strings -// -// Pointer values encode as the value pointed to. -// A nil pointer encodes as the null JSON value. -// -// Interface values encode as the value contained in the interface. -// A nil interface value encodes as the null JSON value. -// -// Channel, complex, and function values cannot be encoded in JSON. -// Attempting to encode such a value causes Marshal to return -// an UnsupportedTypeError. -// -// JSON cannot represent cyclic data structures and Marshal does not -// handle them. Passing cyclic structures to Marshal will result in -// an infinite recursion. -func Marshal(v interface{}) ([]byte, error) { - return MarshalWithOption(v) -} - -// MarshalNoEscape returns the JSON encoding of v and doesn't escape v. -func MarshalNoEscape(v interface{}) ([]byte, error) { - return marshalNoEscape(v) -} - -// MarshalContext returns the JSON encoding of v with context.Context and EncodeOption. -func MarshalContext(ctx context.Context, v interface{}, optFuncs ...EncodeOptionFunc) ([]byte, error) { - return marshalContext(ctx, v, optFuncs...) -} - -// MarshalWithOption returns the JSON encoding of v with EncodeOption. -func MarshalWithOption(v interface{}, optFuncs ...EncodeOptionFunc) ([]byte, error) { - return marshal(v, optFuncs...) -} - -// MarshalIndent is like Marshal but applies Indent to format the output. -// Each JSON element in the output will begin on a new line beginning with prefix -// followed by one or more copies of indent according to the indentation nesting. -func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) { - return MarshalIndentWithOption(v, prefix, indent) -} - -// MarshalIndentWithOption is like Marshal but applies Indent to format the output with EncodeOption. -func MarshalIndentWithOption(v interface{}, prefix, indent string, optFuncs ...EncodeOptionFunc) ([]byte, error) { - return marshalIndent(v, prefix, indent, optFuncs...) -} - -// Unmarshal parses the JSON-encoded data and stores the result -// in the value pointed to by v. If v is nil or not a pointer, -// Unmarshal returns an InvalidUnmarshalError. -// -// Unmarshal uses the inverse of the encodings that -// Marshal uses, allocating maps, slices, and pointers as necessary, -// with the following additional rules: -// -// To unmarshal JSON into a pointer, Unmarshal first handles the case of -// the JSON being the JSON literal null. In that case, Unmarshal sets -// the pointer to nil. Otherwise, Unmarshal unmarshals the JSON into -// the value pointed at by the pointer. If the pointer is nil, Unmarshal -// allocates a new value for it to point to. -// -// To unmarshal JSON into a value implementing the Unmarshaler interface, -// Unmarshal calls that value's UnmarshalJSON method, including -// when the input is a JSON null. -// Otherwise, if the value implements encoding.TextUnmarshaler -// and the input is a JSON quoted string, Unmarshal calls that value's -// UnmarshalText method with the unquoted form of the string. -// -// To unmarshal JSON into a struct, Unmarshal matches incoming object -// keys to the keys used by Marshal (either the struct field name or its tag), -// preferring an exact match but also accepting a case-insensitive match. By -// default, object keys which don't have a corresponding struct field are -// ignored (see Decoder.DisallowUnknownFields for an alternative). -// -// To unmarshal JSON into an interface value, -// Unmarshal stores one of these in the interface value: -// -// bool, for JSON booleans -// float64, for JSON numbers -// string, for JSON strings -// []interface{}, for JSON arrays -// map[string]interface{}, for JSON objects -// nil for JSON null -// -// To unmarshal a JSON array into a slice, Unmarshal resets the slice length -// to zero and then appends each element to the slice. -// As a special case, to unmarshal an empty JSON array into a slice, -// Unmarshal replaces the slice with a new empty slice. -// -// To unmarshal a JSON array into a Go array, Unmarshal decodes -// JSON array elements into corresponding Go array elements. -// If the Go array is smaller than the JSON array, -// the additional JSON array elements are discarded. -// If the JSON array is smaller than the Go array, -// the additional Go array elements are set to zero values. -// -// To unmarshal a JSON object into a map, Unmarshal first establishes a map to -// use. If the map is nil, Unmarshal allocates a new map. Otherwise Unmarshal -// reuses the existing map, keeping existing entries. Unmarshal then stores -// key-value pairs from the JSON object into the map. The map's key type must -// either be any string type, an integer, implement json.Unmarshaler, or -// implement encoding.TextUnmarshaler. -// -// If a JSON value is not appropriate for a given target type, -// or if a JSON number overflows the target type, Unmarshal -// skips that field and completes the unmarshaling as best it can. -// If no more serious errors are encountered, Unmarshal returns -// an UnmarshalTypeError describing the earliest such error. In any -// case, it's not guaranteed that all the remaining fields following -// the problematic one will be unmarshaled into the target object. -// -// The JSON null value unmarshals into an interface, map, pointer, or slice -// by setting that Go value to nil. Because null is often used in JSON to mean -// “not present,” unmarshaling a JSON null into any other Go type has no effect -// on the value and produces no error. -// -// When unmarshaling quoted strings, invalid UTF-8 or -// invalid UTF-16 surrogate pairs are not treated as an error. -// Instead, they are replaced by the Unicode replacement -// character U+FFFD. -func Unmarshal(data []byte, v interface{}) error { - return unmarshal(data, v) -} - -// UnmarshalContext parses the JSON-encoded data and stores the result -// in the value pointed to by v. If you implement the UnmarshalerContext interface, -// call it with ctx as an argument. -func UnmarshalContext(ctx context.Context, data []byte, v interface{}, optFuncs ...DecodeOptionFunc) error { - return unmarshalContext(ctx, data, v) -} - -func UnmarshalWithOption(data []byte, v interface{}, optFuncs ...DecodeOptionFunc) error { - return unmarshal(data, v, optFuncs...) -} - -func UnmarshalNoEscape(data []byte, v interface{}, optFuncs ...DecodeOptionFunc) error { - return unmarshalNoEscape(data, v, optFuncs...) -} - -// A Token holds a value of one of these types: -// -// Delim, for the four JSON delimiters [ ] { } -// bool, for JSON booleans -// float64, for JSON numbers -// Number, for JSON numbers -// string, for JSON string literals -// nil, for JSON null -type Token = json.Token - -// A Number represents a JSON number literal. -type Number = json.Number - -// RawMessage is a raw encoded JSON value. -// It implements Marshaler and Unmarshaler and can -// be used to delay JSON decoding or precompute a JSON encoding. -type RawMessage = json.RawMessage - -// A Delim is a JSON array or object delimiter, one of [ ] { or }. -type Delim = json.Delim - -// Compact appends to dst the JSON-encoded src with -// insignificant space characters elided. -func Compact(dst *bytes.Buffer, src []byte) error { - return encoder.Compact(dst, src, false) -} - -// Indent appends to dst an indented form of the JSON-encoded src. -// Each element in a JSON object or array begins on a new, -// indented line beginning with prefix followed by one or more -// copies of indent according to the indentation nesting. -// The data appended to dst does not begin with the prefix nor -// any indentation, to make it easier to embed inside other formatted JSON data. -// Although leading space characters (space, tab, carriage return, newline) -// at the beginning of src are dropped, trailing space characters -// at the end of src are preserved and copied to dst. -// For example, if src has no trailing spaces, neither will dst; -// if src ends in a trailing newline, so will dst. -func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error { - return encoder.Indent(dst, src, prefix, indent) -} - -// HTMLEscape appends to dst the JSON-encoded src with <, >, &, U+2028 and U+2029 -// characters inside string literals changed to \u003c, \u003e, \u0026, \u2028, \u2029 -// so that the JSON will be safe to embed inside HTML